API report updates for extension ID redesign
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -376,23 +376,18 @@ export type CoreProgressComponent = ComponentType<PropsWithChildren<{}>>;
|
||||
export function createApiExtension<
|
||||
TConfig extends {},
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
>(
|
||||
options: (
|
||||
| {
|
||||
api: AnyApiRef;
|
||||
factory: (options: {
|
||||
config: TConfig;
|
||||
inputs: Expand<ExtensionInputValues<TInputs>>;
|
||||
}) => AnyApiFactory;
|
||||
}
|
||||
| {
|
||||
factory: AnyApiFactory;
|
||||
}
|
||||
) & {
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
inputs?: TInputs;
|
||||
},
|
||||
): Extension<TConfig>;
|
||||
>(options: {
|
||||
factory:
|
||||
| AnyApiFactory
|
||||
| ((options: {
|
||||
config: TConfig;
|
||||
inputs: Expand<ExtensionInputValues<TInputs>>;
|
||||
}) => AnyApiFactory);
|
||||
namespace?: string;
|
||||
name?: string;
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
inputs?: TInputs;
|
||||
}): ExtensionDefinition<TConfig>;
|
||||
|
||||
export { createApiFactory };
|
||||
|
||||
@@ -430,7 +425,7 @@ export function createExtension<
|
||||
TConfig = never,
|
||||
>(
|
||||
options: CreateExtensionOptions<TOutput, TInputs, TConfig>,
|
||||
): Extension<TConfig>;
|
||||
): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @public (undocumented)
|
||||
export function createExtensionDataRef<TData>(
|
||||
@@ -477,10 +472,14 @@ export interface CreateExtensionOptions<
|
||||
inputs: Expand<ExtensionInputValues<TInputs>>;
|
||||
}): Expand<ExtensionDataValues<TOutput>>;
|
||||
// (undocumented)
|
||||
id: string;
|
||||
// (undocumented)
|
||||
inputs?: TInputs;
|
||||
// (undocumented)
|
||||
kind?: string;
|
||||
// (undocumented)
|
||||
name?: string;
|
||||
// (undocumented)
|
||||
namespace?: string;
|
||||
// (undocumented)
|
||||
output: TOutput;
|
||||
}
|
||||
|
||||
@@ -516,11 +515,12 @@ export function createExternalRouteRef<
|
||||
|
||||
// @public
|
||||
export function createNavItemExtension(options: {
|
||||
id: string;
|
||||
namespace?: string;
|
||||
name?: string;
|
||||
routeRef: RouteRef<undefined>;
|
||||
title: string;
|
||||
icon: IconComponent_2;
|
||||
}): Extension<{
|
||||
}): ExtensionDefinition<{
|
||||
title: string;
|
||||
}>;
|
||||
|
||||
@@ -539,7 +539,8 @@ export function createPageExtension<
|
||||
configSchema: PortableSchema<TConfig>;
|
||||
}
|
||||
) & {
|
||||
id: string;
|
||||
namespace?: string;
|
||||
name?: string;
|
||||
attachTo?: {
|
||||
id: string;
|
||||
input: string;
|
||||
@@ -552,7 +553,7 @@ export function createPageExtension<
|
||||
inputs: Expand<ExtensionInputValues<TInputs>>;
|
||||
}) => Promise<JSX.Element>;
|
||||
},
|
||||
): Extension<TConfig>;
|
||||
): ExtensionDefinition<TConfig>;
|
||||
|
||||
// @public (undocumented)
|
||||
export function createPlugin<
|
||||
@@ -616,7 +617,9 @@ export function createSubRouteRef<
|
||||
}): MakeSubRouteRef<PathParams<Path>, ParentParams>;
|
||||
|
||||
// @public (undocumented)
|
||||
export function createThemeExtension(theme: AppTheme): Extension<never>;
|
||||
export function createThemeExtension(
|
||||
theme: AppTheme,
|
||||
): ExtensionDefinition<never>;
|
||||
|
||||
export { DiscoveryApi };
|
||||
|
||||
@@ -703,6 +706,40 @@ export type ExtensionDataValues<TExtensionData extends AnyExtensionDataMap> = {
|
||||
: never]?: TExtensionData[DataName]['T'];
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionDefinition<TConfig> {
|
||||
// (undocumented)
|
||||
$$type: '@backstage/ExtensionDefinition';
|
||||
// (undocumented)
|
||||
attachTo: {
|
||||
id: string;
|
||||
input: string;
|
||||
};
|
||||
// (undocumented)
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
// (undocumented)
|
||||
disabled: boolean;
|
||||
// (undocumented)
|
||||
factory(options: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
inputs: Record<
|
||||
string,
|
||||
undefined | Record<string, unknown> | Array<Record<string, unknown>>
|
||||
>;
|
||||
}): ExtensionDataValues<any>;
|
||||
// (undocumented)
|
||||
inputs: AnyExtensionInputMap;
|
||||
// (undocumented)
|
||||
kind?: string;
|
||||
// (undocumented)
|
||||
name?: string;
|
||||
// (undocumented)
|
||||
namespace?: string;
|
||||
// (undocumented)
|
||||
output: AnyExtensionDataMap;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionInput<
|
||||
TExtensionData extends AnyExtensionDataMap,
|
||||
@@ -743,7 +780,7 @@ export interface ExtensionOverrides {
|
||||
// @public (undocumented)
|
||||
export interface ExtensionOverridesOptions {
|
||||
// (undocumented)
|
||||
extensions: Extension<unknown>[];
|
||||
extensions: ExtensionDefinition<unknown>[];
|
||||
// (undocumented)
|
||||
featureFlags?: FeatureFlagConfig[];
|
||||
}
|
||||
@@ -841,7 +878,7 @@ export interface PluginOptions<
|
||||
ExternalRoutes extends AnyExternalRoutes,
|
||||
> {
|
||||
// (undocumented)
|
||||
extensions?: Extension<unknown>[];
|
||||
extensions?: ExtensionDefinition<unknown>[];
|
||||
// (undocumented)
|
||||
externalRoutes?: ExternalRoutes;
|
||||
// (undocumented)
|
||||
|
||||
Reference in New Issue
Block a user