chore: fixing api-reports and changeset
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
'@backstage/frontend-plugin-api': patch
|
||||
---
|
||||
|
||||
Introduce a new way to create extension types and kinds, with `createExtensionKind`.
|
||||
Introduce a new way to encapsulate extension kinds that replaces the extension creator pattern with `createExtensionBlueprint`
|
||||
|
||||
This allows the creation of extension with the following pattern:
|
||||
This allows the creation of extension instances with the following pattern:
|
||||
|
||||
```tsx
|
||||
// create the extension kind
|
||||
// create the extension blueprint which is used to create instances
|
||||
const EntityCardBlueprint = createExtensionBlueprint({
|
||||
kind: 'entity-card',
|
||||
attachTo: { id: 'test', input: 'default' },
|
||||
@@ -21,7 +21,7 @@ const EntityCardBlueprint = createExtensionBlueprint({
|
||||
},
|
||||
});
|
||||
|
||||
// create an instance of the extension kind with props
|
||||
// create an instance of the extension blueprint with params
|
||||
const testExtension = EntityCardBlueprint.make({
|
||||
name: 'foo',
|
||||
params: {
|
||||
|
||||
@@ -499,6 +499,51 @@ export function createExtension<
|
||||
options: CreateExtensionOptions<TOutput, TInputs, TConfig>,
|
||||
): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @public
|
||||
export function createExtensionBlueprint<
|
||||
TParams,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
>(
|
||||
options: CreateExtensionBlueprintOptions<TParams, TInputs, TOutput, TConfig>,
|
||||
): ExtensionBlueprint<TParams, TInputs, TOutput, TConfig>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface CreateExtensionBlueprintOptions<
|
||||
TParams,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
> {
|
||||
// (undocumented)
|
||||
attachTo: {
|
||||
id: string;
|
||||
input: string;
|
||||
};
|
||||
// (undocumented)
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
// (undocumented)
|
||||
disabled?: boolean;
|
||||
// (undocumented)
|
||||
factory(
|
||||
context: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
params: TParams,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
// (undocumented)
|
||||
inputs?: TInputs;
|
||||
// (undocumented)
|
||||
kind: string;
|
||||
// (undocumented)
|
||||
namespace?: string;
|
||||
// (undocumented)
|
||||
output: TOutput;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export function createExtensionDataRef<TData>(
|
||||
id: string,
|
||||
@@ -522,16 +567,6 @@ export function createExtensionInput<
|
||||
}
|
||||
>;
|
||||
|
||||
// @public
|
||||
export function createExtensionKind<
|
||||
TOptions,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
>(
|
||||
options: ExtensionKindOptions<TOptions, TInputs, TOutput, TConfig>,
|
||||
): ExtensionKind<TOptions, TInputs, TOutput, TConfig>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface CreateExtensionOptions<
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
@@ -843,6 +878,45 @@ export interface Extension<TConfig> {
|
||||
readonly id: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionBlueprint<
|
||||
TParams,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
> {
|
||||
// (undocumented)
|
||||
make(args: {
|
||||
namespace?: string;
|
||||
name?: string;
|
||||
attachTo?: {
|
||||
id: string;
|
||||
input: string;
|
||||
};
|
||||
disabled?: boolean;
|
||||
inputs?: TInputs;
|
||||
output?: TOutput;
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
params: TParams;
|
||||
factory?(
|
||||
context: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
orignalFactory(
|
||||
context?: {
|
||||
node?: AppNode;
|
||||
config?: TConfig;
|
||||
inputs?: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
params?: TParams,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
},
|
||||
params: TParams,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
}): ExtensionDefinition<TConfig>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export function ExtensionBoundary(
|
||||
props: ExtensionBoundaryProps,
|
||||
@@ -923,91 +997,6 @@ export interface ExtensionInput<
|
||||
extensionData: TExtensionData;
|
||||
}
|
||||
|
||||
// @public
|
||||
export class ExtensionKind<
|
||||
TOptions,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
> {
|
||||
// (undocumented)
|
||||
static create<
|
||||
TOptions,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
>(
|
||||
options: ExtensionKindOptions<TOptions, TInputs, TOutput, TConfig>,
|
||||
): ExtensionKind<TOptions, TInputs, TOutput, TConfig>;
|
||||
// (undocumented)
|
||||
new(args: {
|
||||
namespace?: string;
|
||||
name?: string;
|
||||
attachTo?: {
|
||||
id: string;
|
||||
input: string;
|
||||
};
|
||||
disabled?: boolean;
|
||||
inputs?: TInputs;
|
||||
output?: TOutput;
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
options: TOptions;
|
||||
factory?(
|
||||
context: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
orignalFactory(
|
||||
context?: {
|
||||
node?: AppNode;
|
||||
config?: TConfig;
|
||||
inputs?: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
options?: TOptions,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
},
|
||||
options: TOptions,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
}): ExtensionDefinition<TConfig>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionKindOptions<
|
||||
TOptions,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
> {
|
||||
// (undocumented)
|
||||
attachTo: {
|
||||
id: string;
|
||||
input: string;
|
||||
};
|
||||
// (undocumented)
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
// (undocumented)
|
||||
disabled?: boolean;
|
||||
// (undocumented)
|
||||
factory(
|
||||
context: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
options: TOptions,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
// (undocumented)
|
||||
inputs?: TInputs;
|
||||
// (undocumented)
|
||||
kind: string;
|
||||
// (undocumented)
|
||||
name?: string;
|
||||
// (undocumented)
|
||||
namespace?: string;
|
||||
// (undocumented)
|
||||
output: TOutput;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionOverrides {
|
||||
// (undocumented)
|
||||
|
||||
Reference in New Issue
Block a user