@backstage/frontend-plugin-api 0.11.0-next.0 → 0.11.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/dist/apis/definitions/AnalyticsApi.esm.js.map +1 -1
  3. package/dist/apis/definitions/AppTreeApi.esm.js.map +1 -1
  4. package/dist/apis/definitions/RouteResolutionApi.esm.js.map +1 -1
  5. package/dist/blueprints/AnalyticsImplementationBlueprint.esm.js +24 -0
  6. package/dist/blueprints/AnalyticsImplementationBlueprint.esm.js.map +1 -0
  7. package/dist/blueprints/AppRootElementBlueprint.esm.js +1 -3
  8. package/dist/blueprints/AppRootElementBlueprint.esm.js.map +1 -1
  9. package/dist/blueprints/AppRootWrapperBlueprint.esm.js +1 -5
  10. package/dist/blueprints/AppRootWrapperBlueprint.esm.js.map +1 -1
  11. package/dist/blueprints/PageBlueprint.esm.js +7 -9
  12. package/dist/blueprints/PageBlueprint.esm.js.map +1 -1
  13. package/dist/blueprints/RouterBlueprint.esm.js +2 -2
  14. package/dist/blueprints/RouterBlueprint.esm.js.map +1 -1
  15. package/dist/blueprints/SignInPageBlueprint.esm.js +1 -1
  16. package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -1
  17. package/dist/components/ExtensionBoundary.esm.js +8 -7
  18. package/dist/components/ExtensionBoundary.esm.js.map +1 -1
  19. package/dist/frontend-internal/src/wiring/InternalExtensionDefinition.esm.js.map +1 -1
  20. package/dist/frontend-internal/src/wiring/createExtensionDataContainer.esm.js.map +1 -1
  21. package/dist/index.d.ts +259 -218
  22. package/dist/index.esm.js +1 -0
  23. package/dist/index.esm.js.map +1 -1
  24. package/dist/routing/RouteRef.esm.js +8 -2
  25. package/dist/routing/RouteRef.esm.js.map +1 -1
  26. package/dist/wiring/createExtension.esm.js.map +1 -1
  27. package/dist/wiring/createExtensionBlueprint.esm.js +2 -2
  28. package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
  29. package/dist/wiring/createExtensionDataRef.esm.js.map +1 -1
  30. package/dist/wiring/createFrontendPlugin.esm.js.map +1 -1
  31. package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
  32. package/dist/wiring/resolveInputOverrides.esm.js.map +1 -1
  33. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ReactNode, JSX as JSX$1, ComponentType, PropsWithChildren } from 'react';
3
+ import { ReactNode, JSX as JSX$1, ComponentType } from 'react';
4
4
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
5
- import { ApiHolder, ConfigApi, ApiRef, ApiFactory, AnyApiFactory, IconComponent as IconComponent$2, SignInPageProps, AppTheme } from '@backstage/core-plugin-api';
5
+ import { ApiHolder, ConfigApi, ApiRef, TypesToApiRefs, ApiFactory, AnyApiFactory, IconComponent as IconComponent$2, SignInPageProps, AppTheme } from '@backstage/core-plugin-api';
6
6
  export { AlertApi, AlertMessage, AnyApiFactory, AnyApiRef, ApiFactory, ApiHolder, ApiRef, ApiRefConfig, AppTheme, AppThemeApi, AuthProviderInfo, AuthRequestOptions, BackstageIdentityApi, BackstageIdentityResponse, BackstageUserIdentity, ConfigApi, DiscoveryApi, ErrorApi, ErrorApiError, ErrorApiErrorContext, FeatureFlag, FeatureFlagState, FeatureFlagsApi, FeatureFlagsSaveOptions, FetchApi, IdentityApi, OAuthApi, OAuthRequestApi, OAuthRequester, OAuthRequesterOptions, OAuthScope, OpenIdConnectApi, PendingOAuthRequest, ProfileInfo, ProfileInfoApi, SessionApi, SessionState, StorageApi, StorageValueSnapshot, TypesToApiRefs, alertApiRef, appThemeApiRef, atlassianAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, configApiRef, createApiFactory, createApiRef, discoveryApiRef, errorApiRef, featureFlagsApiRef, fetchApiRef, githubAuthApiRef, gitlabAuthApiRef, googleAuthApiRef, identityApiRef, microsoftAuthApiRef, oauthRequestApiRef, oktaAuthApiRef, oneloginAuthApiRef, storageApiRef, useApi, useApiHolder, vmwareCloudAuthApiRef, withApis } from '@backstage/core-plugin-api';
7
7
  import { Expand, JsonObject } from '@backstage/types';
8
8
  import { z } from 'zod';
@@ -12,11 +12,11 @@ import { TranslationResource, TranslationMessages } from '@backstage/core-plugin
12
12
  export { TranslationMessages, TranslationMessagesOptions, TranslationRef, TranslationRefOptions, TranslationResource, TranslationResourceOptions, createTranslationMessages, createTranslationRef, createTranslationResource, useTranslationRef } from '@backstage/core-plugin-api/alpha';
13
13
 
14
14
  /**
15
- * Common analytics context attributes.
15
+ * Analytics context envelope.
16
16
  *
17
17
  * @public
18
18
  */
19
- type CommonAnalyticsContext = {
19
+ interface AnalyticsContextValue {
20
20
  /**
21
21
  * The nearest known parent plugin where the event was captured.
22
22
  */
@@ -25,15 +25,8 @@ type CommonAnalyticsContext = {
25
25
  * The nearest known parent extension where the event was captured.
26
26
  */
27
27
  extensionId: string;
28
- };
29
- /**
30
- * Analytics context envelope.
31
- *
32
- * @public
33
- */
34
- type AnalyticsContextValue = CommonAnalyticsContext & {
35
- [param in string]: string | boolean | number | undefined;
36
- };
28
+ [key: string]: string | boolean | number | undefined;
29
+ }
37
30
 
38
31
  /**
39
32
  * Provides components in the child react tree an Analytics Context, ensuring
@@ -58,9 +51,11 @@ type ExtensionDataValue<TData, TId extends string> = {
58
51
  readonly value: TData;
59
52
  };
60
53
  /** @public */
61
- type ExtensionDataRef<TData, TId extends string = string, TConfig extends {
54
+ type ExtensionDataRef<TData = unknown, TId extends string = string, TConfig extends {
62
55
  optional?: true;
63
- } = {}> = {
56
+ } = {
57
+ optional?: true;
58
+ }> = {
64
59
  readonly $$type: '@backstage/ExtensionDataRef';
65
60
  readonly id: TId;
66
61
  readonly T: TData;
@@ -68,10 +63,11 @@ type ExtensionDataRef<TData, TId extends string = string, TConfig extends {
68
63
  };
69
64
  /** @public */
70
65
  type ExtensionDataRefToValue<TDataRef extends AnyExtensionDataRef> = TDataRef extends ExtensionDataRef<infer IData, infer IId, any> ? ExtensionDataValue<IData, IId> : never;
71
- /** @public */
72
- type AnyExtensionDataRef = ExtensionDataRef<unknown, string, {
73
- optional?: true;
74
- }>;
66
+ /**
67
+ * @deprecated Use `ExtensionDataRef` without type parameters instead.
68
+ * @public
69
+ */
70
+ type AnyExtensionDataRef = ExtensionDataRef;
75
71
  /** @public */
76
72
  interface ConfigurableExtensionDataRef<TData, TId extends string, TConfig extends {
77
73
  optional?: true;
@@ -120,7 +116,8 @@ declare function createRouteRef<TParams extends {
120
116
  [param in TParamKeys]: string;
121
117
  } | undefined = undefined, TParamKeys extends string = string>(config?: {
122
118
  /** A list of parameter names that the path that this route ref is bound to must contain */
123
- readonly params: string extends TParamKeys ? (keyof TParams)[] : TParamKeys[];
119
+ readonly params?: string extends TParamKeys ? (keyof TParams)[] : TParamKeys[];
120
+ aliasFor?: string;
124
121
  }): RouteRef<keyof TParams extends never ? undefined : string extends TParamKeys ? TParams : {
125
122
  [param in TParamKeys]: string;
126
123
  }>;
@@ -165,12 +162,12 @@ declare function createExtensionInput<UExtensionData extends ExtensionDataRef<un
165
162
 
166
163
  /** @public */
167
164
  type ResolveInputValueOverrides<TInputs extends {
168
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
165
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
169
166
  optional: boolean;
170
167
  singleton: boolean;
171
168
  }>;
172
169
  } = {
173
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
170
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
174
171
  optional: boolean;
175
172
  singleton: boolean;
176
173
  }>;
@@ -192,6 +189,77 @@ type ResolveInputValueOverrides<TInputs extends {
192
189
  }> ? ISingleton extends true ? Iterable<ExtensionDataRefToValue<IDataRefs>> : Array<Iterable<ExtensionDataRefToValue<IDataRefs>>> : never;
193
190
  }>;
194
191
 
192
+ /** @public */
193
+ interface CreateFrontendModuleOptions<TPluginId extends string, TExtensions extends readonly ExtensionDefinition[]> {
194
+ pluginId: TPluginId;
195
+ extensions?: TExtensions;
196
+ featureFlags?: FeatureFlagConfig[];
197
+ }
198
+ /** @public */
199
+ interface FrontendModule {
200
+ readonly $$type: '@backstage/FrontendModule';
201
+ readonly pluginId: string;
202
+ }
203
+ /** @public */
204
+ declare function createFrontendModule<TId extends string, TExtensions extends readonly ExtensionDefinition[] = []>(options: CreateFrontendModuleOptions<TId, TExtensions>): FrontendModule;
205
+
206
+ /** @public */
207
+ type PortableSchema<TOutput, TInput = TOutput> = {
208
+ parse: (input: TInput) => TOutput;
209
+ schema: JsonObject;
210
+ };
211
+
212
+ /** @public */
213
+ interface Extension<TConfig, TConfigInput = TConfig> {
214
+ $$type: '@backstage/Extension';
215
+ readonly id: string;
216
+ readonly attachTo: ExtensionAttachToSpec;
217
+ readonly disabled: boolean;
218
+ readonly configSchema?: PortableSchema<TConfig, TConfigInput>;
219
+ }
220
+ /** @ignore */
221
+ type ResolveExtensionId<TExtension extends ExtensionDefinition, TNamespace extends string> = TExtension extends ExtensionDefinition<{
222
+ kind: infer IKind extends string | undefined;
223
+ name: infer IName extends string | undefined;
224
+ params: any;
225
+ }> ? [string] extends [IKind | IName] ? never : (undefined extends IName ? TNamespace : `${TNamespace}/${IName}`) extends infer INamePart extends string ? IKind extends string ? `${IKind}:${INamePart}` : INamePart : never : never;
226
+
227
+ type CompareChars<A extends string, B extends string> = [A, B] extends [
228
+ `${infer IAHead}${infer IARest}`,
229
+ `${infer IBHead}${infer IBRest}`
230
+ ] ? IAHead extends IBHead ? IBRest extends '' ? IARest extends '' ? 'eq' : 'gt' : IARest extends '' ? 'lt' : CompareChars<IARest, IBRest> : `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz` extends `${string}${IAHead}${string}${IBHead}${string}` ? 'lt' : 'gt' : 'eq';
231
+ type CompareStrings<A extends string | undefined, B extends string | undefined> = A extends B ? 'eq' : A extends undefined ? 'lt' : B extends undefined ? 'gt' : CompareChars<A & string, B & string>;
232
+ type CompareExtensions<A extends ExtensionDefinition, B extends ExtensionDefinition> = CompareStrings<A['T']['kind'], B['T']['kind']> extends 'eq' ? CompareStrings<A['T']['name'], B['T']['name']> : CompareStrings<A['T']['kind'], B['T']['kind']>;
233
+ type SortExtensionsInner<TPivot extends ExtensionDefinition, TRest extends readonly ExtensionDefinition[], TLow extends readonly ExtensionDefinition[], THigh extends readonly ExtensionDefinition[]> = TRest extends [
234
+ infer IHead extends ExtensionDefinition,
235
+ ...infer IRest extends readonly ExtensionDefinition[]
236
+ ] ? CompareExtensions<IHead, TPivot> extends 'lt' ? SortExtensionsInner<TPivot, IRest, [...TLow, IHead], THigh> : SortExtensionsInner<TPivot, IRest, TLow, [...THigh, IHead]> : [low: TLow, high: THigh];
237
+ type SortExtensions<T extends readonly ExtensionDefinition[]> = T extends [
238
+ infer IPivot extends ExtensionDefinition,
239
+ ...infer IRest extends readonly ExtensionDefinition[]
240
+ ] ? SortExtensionsInner<IPivot, IRest, [], []> extends [
241
+ low: infer ILow extends readonly ExtensionDefinition[],
242
+ high: infer IHigh extends readonly ExtensionDefinition[]
243
+ ] ? [...SortExtensions<ILow>, IPivot, ...SortExtensions<IHigh>] : 'invalid SortExtensionsInner' : [];
244
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
245
+ type PopUnion$1<U> = UnionToIntersection<U extends any ? () => U : never> extends () => infer R ? [next: R, rest: Exclude<U, R>] : undefined;
246
+ type UnionToArray<U, T = U, TResult extends T[] = []> = PopUnion$1<U> extends [
247
+ next: infer INext extends T,
248
+ rest: infer IRest extends T
249
+ ] ? UnionToArray<IRest, T, [INext, ...TResult]> : TResult;
250
+ type ExtensionArrayToMap<T extends ExtensionDefinition[], TId extends string, TOut extends {
251
+ [KId in string]: ExtensionDefinition;
252
+ } = {}> = T extends [
253
+ infer IHead extends ExtensionDefinition,
254
+ ...infer IRest extends ExtensionDefinition[]
255
+ ] ? ExtensionArrayToMap<IRest, TId, TOut & {
256
+ [K in ResolveExtensionId<IHead, TId>]: IHead;
257
+ }> : TOut extends infer O ? {
258
+ [K in keyof O]: O[K];
259
+ } : never;
260
+ /** @ignore */
261
+ type MakeSortedExtensionsMap<UExtensions extends ExtensionDefinition, TId extends string> = ExtensionArrayToMap<SortExtensions<UnionToArray<UExtensions>>, TId>;
262
+
195
263
  /**
196
264
  * Descriptor of a route relative to an absolute {@link RouteRef}.
197
265
  *
@@ -319,77 +387,6 @@ declare function useRouteRef<TParams extends AnyRouteRefParams>(routeRef: RouteR
319
387
  */
320
388
  declare function useRouteRefParams<Params extends AnyRouteRefParams>(_routeRef: RouteRef<Params> | SubRouteRef<Params>): Params;
321
389
 
322
- /** @public */
323
- interface CreateFrontendModuleOptions<TPluginId extends string, TExtensions extends readonly ExtensionDefinition[]> {
324
- pluginId: TPluginId;
325
- extensions?: TExtensions;
326
- featureFlags?: FeatureFlagConfig[];
327
- }
328
- /** @public */
329
- interface FrontendModule {
330
- readonly $$type: '@backstage/FrontendModule';
331
- readonly pluginId: string;
332
- }
333
- /** @public */
334
- declare function createFrontendModule<TId extends string, TExtensions extends readonly ExtensionDefinition[] = []>(options: CreateFrontendModuleOptions<TId, TExtensions>): FrontendModule;
335
-
336
- /** @public */
337
- type PortableSchema<TOutput, TInput = TOutput> = {
338
- parse: (input: TInput) => TOutput;
339
- schema: JsonObject;
340
- };
341
-
342
- /** @public */
343
- interface Extension<TConfig, TConfigInput = TConfig> {
344
- $$type: '@backstage/Extension';
345
- readonly id: string;
346
- readonly attachTo: ExtensionAttachToSpec;
347
- readonly disabled: boolean;
348
- readonly configSchema?: PortableSchema<TConfig, TConfigInput>;
349
- }
350
- /** @ignore */
351
- type ResolveExtensionId<TExtension extends ExtensionDefinition, TNamespace extends string> = TExtension extends ExtensionDefinition<{
352
- kind: infer IKind extends string | undefined;
353
- name: infer IName extends string | undefined;
354
- params: any;
355
- }> ? [string] extends [IKind | IName] ? never : (undefined extends IName ? TNamespace : `${TNamespace}/${IName}`) extends infer INamePart extends string ? IKind extends string ? `${IKind}:${INamePart}` : INamePart : never : never;
356
-
357
- type CompareChars<A extends string, B extends string> = [A, B] extends [
358
- `${infer IAHead}${infer IARest}`,
359
- `${infer IBHead}${infer IBRest}`
360
- ] ? IAHead extends IBHead ? IBRest extends '' ? IARest extends '' ? 'eq' : 'gt' : IARest extends '' ? 'lt' : CompareChars<IARest, IBRest> : `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz` extends `${string}${IAHead}${string}${IBHead}${string}` ? 'lt' : 'gt' : 'eq';
361
- type CompareStrings<A extends string | undefined, B extends string | undefined> = A extends B ? 'eq' : A extends undefined ? 'lt' : B extends undefined ? 'gt' : CompareChars<A & string, B & string>;
362
- type CompareExtensions<A extends ExtensionDefinition, B extends ExtensionDefinition> = CompareStrings<A['T']['kind'], B['T']['kind']> extends 'eq' ? CompareStrings<A['T']['name'], B['T']['name']> : CompareStrings<A['T']['kind'], B['T']['kind']>;
363
- type SortExtensionsInner<TPivot extends ExtensionDefinition, TRest extends readonly ExtensionDefinition[], TLow extends readonly ExtensionDefinition[], THigh extends readonly ExtensionDefinition[]> = TRest extends [
364
- infer IHead extends ExtensionDefinition,
365
- ...infer IRest extends readonly ExtensionDefinition[]
366
- ] ? CompareExtensions<IHead, TPivot> extends 'lt' ? SortExtensionsInner<TPivot, IRest, [...TLow, IHead], THigh> : SortExtensionsInner<TPivot, IRest, TLow, [...THigh, IHead]> : [low: TLow, high: THigh];
367
- type SortExtensions<T extends readonly ExtensionDefinition[]> = T extends [
368
- infer IPivot extends ExtensionDefinition,
369
- ...infer IRest extends readonly ExtensionDefinition[]
370
- ] ? SortExtensionsInner<IPivot, IRest, [], []> extends [
371
- low: infer ILow extends readonly ExtensionDefinition[],
372
- high: infer IHigh extends readonly ExtensionDefinition[]
373
- ] ? [...SortExtensions<ILow>, IPivot, ...SortExtensions<IHigh>] : 'invalid SortExtensionsInner' : [];
374
- type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
375
- type PopUnion$1<U> = UnionToIntersection<U extends any ? () => U : never> extends () => infer R ? [next: R, rest: Exclude<U, R>] : undefined;
376
- type UnionToArray<U, T = U, TResult extends T[] = []> = PopUnion$1<U> extends [
377
- next: infer INext extends T,
378
- rest: infer IRest extends T
379
- ] ? UnionToArray<IRest, T, [INext, ...TResult]> : TResult;
380
- type ExtensionArrayToMap<T extends ExtensionDefinition[], TId extends string, TOut extends {
381
- [KId in string]: ExtensionDefinition;
382
- } = {}> = T extends [
383
- infer IHead extends ExtensionDefinition,
384
- ...infer IRest extends ExtensionDefinition[]
385
- ] ? ExtensionArrayToMap<IRest, TId, TOut & {
386
- [K in ResolveExtensionId<IHead, TId>]: IHead;
387
- }> : TOut extends infer O ? {
388
- [K in keyof O]: O[K];
389
- } : never;
390
- /** @ignore */
391
- type MakeSortedExtensionsMap<UExtensions extends ExtensionDefinition, TId extends string> = ExtensionArrayToMap<SortExtensions<UnionToArray<UExtensions>>, TId>;
392
-
393
390
  /**
394
391
  * Information about the plugin.
395
392
  *
@@ -450,7 +447,15 @@ type FrontendPluginInfoOptions = {
450
447
  manifest?: () => Promise<JsonObject>;
451
448
  };
452
449
  /** @public */
453
- interface FrontendPlugin<TRoutes extends AnyRoutes = AnyRoutes, TExternalRoutes extends AnyExternalRoutes = AnyExternalRoutes, TExtensionMap extends {
450
+ interface FrontendPlugin<TRoutes extends {
451
+ [name in string]: RouteRef | SubRouteRef;
452
+ } = {
453
+ [name in string]: RouteRef | SubRouteRef;
454
+ }, TExternalRoutes extends {
455
+ [name in string]: ExternalRouteRef;
456
+ } = {
457
+ [name in string]: ExternalRouteRef;
458
+ }, TExtensionMap extends {
454
459
  [id in string]: ExtensionDefinition;
455
460
  } = {
456
461
  [id in string]: ExtensionDefinition;
@@ -473,7 +478,11 @@ interface FrontendPlugin<TRoutes extends AnyRoutes = AnyRoutes, TExternalRoutes
473
478
  }): FrontendPlugin<TRoutes, TExternalRoutes, TExtensionMap>;
474
479
  }
475
480
  /** @public */
476
- interface PluginOptions<TId extends string, TRoutes extends AnyRoutes, TExternalRoutes extends AnyExternalRoutes, TExtensions extends readonly ExtensionDefinition[]> {
481
+ interface PluginOptions<TId extends string, TRoutes extends {
482
+ [name in string]: RouteRef | SubRouteRef;
483
+ }, TExternalRoutes extends {
484
+ [name in string]: ExternalRouteRef;
485
+ }, TExtensions extends readonly ExtensionDefinition[]> {
477
486
  pluginId: TId;
478
487
  routes?: TRoutes;
479
488
  externalRoutes?: TExternalRoutes;
@@ -482,12 +491,20 @@ interface PluginOptions<TId extends string, TRoutes extends AnyRoutes, TExternal
482
491
  info?: FrontendPluginInfoOptions;
483
492
  }
484
493
  /** @public */
485
- declare function createFrontendPlugin<TId extends string, TRoutes extends AnyRoutes = {}, TExternalRoutes extends AnyExternalRoutes = {}, TExtensions extends readonly ExtensionDefinition[] = []>(options: PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>): FrontendPlugin<TRoutes, TExternalRoutes, MakeSortedExtensionsMap<TExtensions[number], TId>>;
494
+ declare function createFrontendPlugin<TId extends string, TRoutes extends {
495
+ [name in string]: RouteRef | SubRouteRef;
496
+ } = {}, TExternalRoutes extends {
497
+ [name in string]: ExternalRouteRef;
498
+ } = {}, TExtensions extends readonly ExtensionDefinition[] = []>(options: PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>): FrontendPlugin<TRoutes, TExternalRoutes, MakeSortedExtensionsMap<TExtensions[number], TId>>;
486
499
  /**
487
500
  * @public
488
501
  * @deprecated The `id` option is deprecated, use `pluginId` instead.
489
502
  */
490
- declare function createFrontendPlugin<TId extends string, TRoutes extends AnyRoutes = {}, TExternalRoutes extends AnyExternalRoutes = {}, TExtensions extends readonly ExtensionDefinition[] = []>(options: Omit<PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>, 'pluginId'> & {
503
+ declare function createFrontendPlugin<TId extends string, TRoutes extends {
504
+ [name in string]: RouteRef | SubRouteRef;
505
+ } = {}, TExternalRoutes extends {
506
+ [name in string]: ExternalRouteRef;
507
+ } = {}, TExtensions extends readonly ExtensionDefinition[] = []>(options: Omit<PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>, 'pluginId'> & {
491
508
  id: string;
492
509
  }): FrontendPlugin<TRoutes, TExternalRoutes, MakeSortedExtensionsMap<TExtensions[number], TId>>;
493
510
 
@@ -501,21 +518,13 @@ type FeatureFlagConfig = {
501
518
  name: string;
502
519
  };
503
520
  /** @public */
504
- type AnyRoutes = {
505
- [name in string]: RouteRef | SubRouteRef;
506
- };
507
- /** @public */
508
- type AnyExternalRoutes = {
509
- [name in string]: ExternalRouteRef;
510
- };
511
- /** @public */
512
- type ExtensionDataContainer<UExtensionData extends AnyExtensionDataRef> = Iterable<UExtensionData extends ExtensionDataRef<infer IData, infer IId, infer IConfig> ? IConfig['optional'] extends true ? never : ExtensionDataValue<IData, IId> : never> & {
521
+ type ExtensionDataContainer<UExtensionData extends ExtensionDataRef> = Iterable<UExtensionData extends ExtensionDataRef<infer IData, infer IId, infer IConfig> ? IConfig['optional'] extends true ? never : ExtensionDataValue<IData, IId> : never> & {
513
522
  get<TId extends UExtensionData['id']>(ref: ExtensionDataRef<any, TId, any>): UExtensionData extends ExtensionDataRef<infer IData, TId, infer IConfig> ? IConfig['optional'] extends true ? IData | undefined : IData : never;
514
523
  };
515
524
  /** @public */
516
525
  type ExtensionFactoryMiddleware = (originalFactory: (contextOverrides?: {
517
526
  config?: JsonObject;
518
- }) => ExtensionDataContainer<AnyExtensionDataRef>, context: {
527
+ }) => ExtensionDataContainer<ExtensionDataRef>, context: {
519
528
  node: AppNode;
520
529
  apis: ApiHolder;
521
530
  config?: JsonObject;
@@ -538,7 +547,7 @@ type FrontendFeature = FrontendPlugin | FrontendModule;
538
547
  *
539
548
  * @public
540
549
  */
541
- type ExtensionBlueprintParamsDefiner<TParams extends object = object, TInput = any> = (params: TInput) => ExtensionBlueprintParams<TParams>;
550
+ type ExtensionBlueprintDefineParams<TParams extends object = object, TInput = any> = (params: TInput) => ExtensionBlueprintParams<TParams>;
542
551
  /**
543
552
  * An opaque type that represents a set of parameters to be passed to a blueprint.
544
553
  *
@@ -565,22 +574,21 @@ declare function createExtensionBlueprintParams<T extends object = object>(param
565
574
  /**
566
575
  * @public
567
576
  */
568
- type CreateExtensionBlueprintOptions<TKind extends string, TName extends string | undefined, TParams extends object | ExtensionBlueprintParamsDefiner, UOutput extends AnyExtensionDataRef, TInputs extends {
569
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
577
+ type CreateExtensionBlueprintOptions<TKind extends string, TParams extends object | ExtensionBlueprintDefineParams, UOutput extends ExtensionDataRef, TInputs extends {
578
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
570
579
  optional: boolean;
571
580
  singleton: boolean;
572
581
  }>;
573
582
  }, TConfigSchema extends {
574
583
  [key in string]: (zImpl: typeof z) => z.ZodType;
575
584
  }, UFactoryOutput extends ExtensionDataValue<any, any>, TDataRefs extends {
576
- [name in string]: AnyExtensionDataRef;
585
+ [name in string]: ExtensionDataRef;
577
586
  }> = {
578
587
  kind: TKind;
579
588
  attachTo: ExtensionAttachToSpec;
580
589
  disabled?: boolean;
581
590
  inputs?: TInputs;
582
591
  output: Array<UOutput>;
583
- name?: TName;
584
592
  config?: {
585
593
  schema: TConfigSchema;
586
594
  };
@@ -615,15 +623,15 @@ type CreateExtensionBlueprintOptions<TKind extends string, TName extends string
615
623
  * Usage of the above example blueprint:
616
624
  * ```ts
617
625
  * const example = ExampleBlueprint.make({
618
- * params: define => define({
626
+ * params: defineParams => defineParams({
619
627
  * component: ...,
620
628
  * fetcher: ...,
621
629
  * }),
622
630
  * });
623
631
  * ```
624
632
  */
625
- defineParams?: TParams extends ExtensionBlueprintParamsDefiner ? TParams : 'The defineParams option must be a function if provided, see the docs for details';
626
- factory(params: TParams extends ExtensionBlueprintParamsDefiner ? ReturnType<TParams>['T'] : TParams, context: {
633
+ defineParams?: TParams extends ExtensionBlueprintDefineParams ? TParams : 'The defineParams option must be a function if provided, see the docs for details';
634
+ factory(params: TParams extends ExtensionBlueprintDefineParams ? ReturnType<TParams>['T'] : TParams, context: {
627
635
  node: AppNode;
628
636
  apis: ApiHolder;
629
637
  config: {
@@ -636,47 +644,46 @@ type CreateExtensionBlueprintOptions<TKind extends string, TName extends string
636
644
  /** @public */
637
645
  type ExtensionBlueprintParameters = {
638
646
  kind: string;
639
- name?: string;
640
- params?: object | ExtensionBlueprintParamsDefiner;
647
+ params?: object | ExtensionBlueprintDefineParams;
641
648
  configInput?: {
642
649
  [K in string]: any;
643
650
  };
644
651
  config?: {
645
652
  [K in string]: any;
646
653
  };
647
- output?: AnyExtensionDataRef;
654
+ output?: ExtensionDataRef;
648
655
  inputs?: {
649
- [KName in string]: ExtensionInput<AnyExtensionDataRef, {
656
+ [KName in string]: ExtensionInput<ExtensionDataRef, {
650
657
  optional: boolean;
651
658
  singleton: boolean;
652
659
  }>;
653
660
  };
654
661
  dataRefs?: {
655
- [name in string]: AnyExtensionDataRef;
662
+ [name in string]: ExtensionDataRef;
656
663
  };
657
664
  };
658
665
  /** @ignore */
659
- type ParamsFactory<TDefiner extends ExtensionBlueprintParamsDefiner> = (define: TDefiner) => ReturnType<TDefiner>;
666
+ type ParamsFactory<TDefiner extends ExtensionBlueprintDefineParams> = (defineParams: TDefiner) => ReturnType<TDefiner>;
660
667
  /**
661
668
  * Represents any form of params input that can be passed to a blueprint.
662
669
  * This also includes the invalid form of passing a plain params object to a blueprint that uses a definition callback.
663
670
  *
664
671
  * @ignore
665
672
  */
666
- type AnyParamsInput$1<TParams extends object | ExtensionBlueprintParamsDefiner> = TParams extends ExtensionBlueprintParamsDefiner<infer IParams> ? IParams | ParamsFactory<TParams> : TParams | ParamsFactory<ExtensionBlueprintParamsDefiner<TParams, TParams>>;
673
+ type AnyParamsInput$1<TParams extends object | ExtensionBlueprintDefineParams> = TParams extends ExtensionBlueprintDefineParams<infer IParams> ? IParams | ParamsFactory<TParams> : TParams | ParamsFactory<ExtensionBlueprintDefineParams<TParams, TParams>>;
667
674
  /**
668
675
  * @public
669
676
  */
670
677
  interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionBlueprintParameters> {
671
678
  dataRefs: T['dataRefs'];
672
- make<TNewName extends string | undefined, TParamsInput extends AnyParamsInput$1<NonNullable<T['params']>>>(args: {
673
- name?: TNewName;
679
+ make<TName extends string | undefined, TParamsInput extends AnyParamsInput$1<NonNullable<T['params']>>>(args: {
680
+ name?: TName;
674
681
  attachTo?: ExtensionAttachToSpec;
675
682
  disabled?: boolean;
676
- params: TParamsInput extends ExtensionBlueprintParamsDefiner ? TParamsInput : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `<blueprint>.make({ params: define => define(<params>) })`' : TParamsInput;
683
+ params: TParamsInput extends ExtensionBlueprintDefineParams ? TParamsInput : T['params'] extends ExtensionBlueprintDefineParams ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `<blueprint>.make({ params: defineParams => defineParams(<params>) })`' : T['params'];
677
684
  }): ExtensionDefinition<{
678
685
  kind: T['kind'];
679
- name: string | undefined extends TNewName ? T['name'] : TNewName;
686
+ name: string | undefined extends TName ? undefined : TName;
680
687
  config: T['config'];
681
688
  configInput: T['configInput'];
682
689
  output: T['output'];
@@ -689,15 +696,15 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
689
696
  * You must either pass `params` directly, or define a `factory` that can
690
697
  * optionally call the original factory with the same params.
691
698
  */
692
- makeWithOverrides<TNewName extends string | undefined, TExtensionConfigSchema extends {
699
+ makeWithOverrides<TName extends string | undefined, TExtensionConfigSchema extends {
693
700
  [key in string]: (zImpl: typeof z) => z.ZodType;
694
- }, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends AnyExtensionDataRef, TExtraInputs extends {
695
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
701
+ }, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends ExtensionDataRef, TExtraInputs extends {
702
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
696
703
  optional: boolean;
697
704
  singleton: boolean;
698
705
  }>;
699
706
  }>(args: {
700
- name?: TNewName;
707
+ name?: TName;
701
708
  attachTo?: ExtensionAttachToSpec;
702
709
  disabled?: boolean;
703
710
  inputs?: TExtraInputs & {
@@ -709,7 +716,7 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
709
716
  [KName in keyof T['config']]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
710
717
  };
711
718
  };
712
- factory(originalFactory: <TParamsInput extends AnyParamsInput$1<NonNullable<T['params']>>>(params: TParamsInput extends ExtensionBlueprintParamsDefiner ? TParamsInput : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(define => define(<params>))`' : TParamsInput, context?: {
719
+ factory(originalFactory: <TParamsInput extends AnyParamsInput$1<NonNullable<T['params']>>>(params: TParamsInput extends ExtensionBlueprintDefineParams ? TParamsInput : T['params'] extends ExtensionBlueprintDefineParams ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(defineParams => defineParams(<params>))`' : T['params'], context?: {
713
720
  config?: T['config'];
714
721
  inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>;
715
722
  }) => ExtensionDataContainer<NonNullable<T['output']>>, context: {
@@ -719,7 +726,7 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
719
726
  [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
720
727
  };
721
728
  inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>;
722
- }): Iterable<UFactoryOutput> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>;
729
+ }): Iterable<UFactoryOutput> & VerifyExtensionFactoryOutput<ExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>;
723
730
  }): ExtensionDefinition<{
724
731
  config: (string extends keyof TExtensionConfigSchema ? {} : {
725
732
  [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
@@ -727,10 +734,10 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
727
734
  configInput: (string extends keyof TExtensionConfigSchema ? {} : z.input<z.ZodObject<{
728
735
  [key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>;
729
736
  }>>) & T['configInput'];
730
- output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
737
+ output: ExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
731
738
  inputs: T['inputs'] & TExtraInputs;
732
739
  kind: T['kind'];
733
- name: string | undefined extends TNewName ? T['name'] : TNewName;
740
+ name: string | undefined extends TName ? undefined : TName;
734
741
  params: T['params'];
735
742
  }>;
736
743
  }
@@ -740,20 +747,19 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
740
747
  *
741
748
  * @public
742
749
  */
743
- declare function createExtensionBlueprint<TParams extends object | ExtensionBlueprintParamsDefiner, UOutput extends AnyExtensionDataRef, TInputs extends {
744
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
750
+ declare function createExtensionBlueprint<TParams extends object | ExtensionBlueprintDefineParams, UOutput extends ExtensionDataRef, TInputs extends {
751
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
745
752
  optional: boolean;
746
753
  singleton: boolean;
747
754
  }>;
748
755
  }, TConfigSchema extends {
749
756
  [key in string]: (zImpl: typeof z) => z.ZodType;
750
- }, UFactoryOutput extends ExtensionDataValue<any, any>, TKind extends string, TName extends string | undefined = undefined, TDataRefs extends {
751
- [name in string]: AnyExtensionDataRef;
752
- } = never>(options: CreateExtensionBlueprintOptions<TKind, TName, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs>): ExtensionBlueprint<{
757
+ }, UFactoryOutput extends ExtensionDataValue<any, any>, TKind extends string, TDataRefs extends {
758
+ [name in string]: ExtensionDataRef;
759
+ } = never>(options: CreateExtensionBlueprintOptions<TKind, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs>): ExtensionBlueprint<{
753
760
  kind: TKind;
754
- name: TName;
755
761
  params: TParams;
756
- output: UOutput;
762
+ output: UOutput extends ExtensionDataRef<infer IData, infer IId, infer IConfig> ? ExtensionDataRef<IData, IId, IConfig> : never;
757
763
  inputs: string extends keyof TInputs ? {} : TInputs;
758
764
  config: string extends keyof TConfigSchema ? {} : {
759
765
  [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
@@ -768,7 +774,7 @@ declare function createExtensionBlueprint<TParams extends object | ExtensionBlue
768
774
  * Convert a single extension input into a matching resolved input.
769
775
  * @public
770
776
  */
771
- type ResolvedExtensionInput<TExtensionInput extends ExtensionInput<any, any>> = TExtensionInput['extensionData'] extends Array<AnyExtensionDataRef> ? {
777
+ type ResolvedExtensionInput<TExtensionInput extends ExtensionInput<any, any>> = TExtensionInput['extensionData'] extends Array<ExtensionDataRef> ? {
772
778
  node: AppNode;
773
779
  } & ExtensionDataContainer<TExtensionInput['extensionData'][number]> : never;
774
780
  /**
@@ -785,7 +791,7 @@ type PopUnion<U> = ToIntersection<U extends any ? () => U : never> extends () =>
785
791
  /** @ignore */
786
792
  type JoinStringUnion<U, TDiv extends string = ', ', TResult extends string = ''> = PopUnion<U> extends [infer IRest extends string, infer INext extends string] ? TResult extends '' ? JoinStringUnion<IRest, TDiv, INext> : JoinStringUnion<IRest, TDiv, `${TResult}${TDiv}${INext}`> : TResult;
787
793
  /** @ignore */
788
- type VerifyExtensionFactoryOutput<UDeclaredOutput extends AnyExtensionDataRef, UFactoryOutput extends ExtensionDataValue<any, any>> = (UDeclaredOutput extends any ? UDeclaredOutput['config']['optional'] extends true ? never : UDeclaredOutput['id'] : never) extends infer IRequiredOutputIds ? [IRequiredOutputIds] extends [UFactoryOutput['id']] ? [UFactoryOutput['id']] extends [UDeclaredOutput['id']] ? {} : `Error: The extension factory has undeclared output(s): ${JoinStringUnion<Exclude<UFactoryOutput['id'], UDeclaredOutput['id']>>}` : `Error: The extension factory is missing the following output(s): ${JoinStringUnion<Exclude<IRequiredOutputIds, UFactoryOutput['id']>>}` : never;
794
+ type VerifyExtensionFactoryOutput<UDeclaredOutput extends ExtensionDataRef, UFactoryOutput extends ExtensionDataValue<any, any>> = (UDeclaredOutput extends any ? UDeclaredOutput['config']['optional'] extends true ? never : UDeclaredOutput['id'] : never) extends infer IRequiredOutputIds ? [IRequiredOutputIds] extends [UFactoryOutput['id']] ? [UFactoryOutput['id']] extends [UDeclaredOutput['id']] ? {} : `Error: The extension factory has undeclared output(s): ${JoinStringUnion<Exclude<UFactoryOutput['id'], UDeclaredOutput['id']>>}` : `Error: The extension factory is missing the following output(s): ${JoinStringUnion<Exclude<IRequiredOutputIds, UFactoryOutput['id']>>}` : never;
789
795
  /** @public */
790
796
  type ExtensionAttachToSpec = {
791
797
  id: string;
@@ -795,8 +801,8 @@ type ExtensionAttachToSpec = {
795
801
  input: string;
796
802
  }>;
797
803
  /** @public */
798
- type CreateExtensionOptions<TKind extends string | undefined, TName extends string | undefined, UOutput extends AnyExtensionDataRef, TInputs extends {
799
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
804
+ type CreateExtensionOptions<TKind extends string | undefined, TName extends string | undefined, UOutput extends ExtensionDataRef, TInputs extends {
805
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
800
806
  optional: boolean;
801
807
  singleton: boolean;
802
808
  }>;
@@ -831,29 +837,29 @@ type ExtensionDefinitionParameters = {
831
837
  config?: {
832
838
  [K in string]: any;
833
839
  };
834
- output?: AnyExtensionDataRef;
840
+ output?: ExtensionDataRef;
835
841
  inputs?: {
836
- [KName in string]: ExtensionInput<AnyExtensionDataRef, {
842
+ [KName in string]: ExtensionInput<ExtensionDataRef, {
837
843
  optional: boolean;
838
844
  singleton: boolean;
839
845
  }>;
840
846
  };
841
- params?: object | ExtensionBlueprintParamsDefiner;
847
+ params?: object | ExtensionBlueprintDefineParams;
842
848
  };
843
849
  /**
844
850
  * Same as the one in `createExtensionBlueprint`, but with `ParamsFactory` inlined.
845
851
  * It can't be exported because it breaks API reports.
846
852
  * @ignore
847
853
  */
848
- type AnyParamsInput<TParams extends object | ExtensionBlueprintParamsDefiner> = TParams extends ExtensionBlueprintParamsDefiner<infer IParams> ? IParams | ((define: TParams) => ReturnType<TParams>) : TParams | ((define: ExtensionBlueprintParamsDefiner<TParams, TParams>) => ReturnType<ExtensionBlueprintParamsDefiner<TParams, TParams>>);
854
+ type AnyParamsInput<TParams extends object | ExtensionBlueprintDefineParams> = TParams extends ExtensionBlueprintDefineParams<infer IParams> ? IParams | ((define: TParams) => ReturnType<TParams>) : TParams | ((define: ExtensionBlueprintDefineParams<TParams, TParams>) => ReturnType<ExtensionBlueprintDefineParams<TParams, TParams>>);
849
855
  /** @public */
850
856
  type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefinitionParameters> = {
851
857
  $$type: '@backstage/ExtensionDefinition';
852
858
  readonly T: T;
853
859
  override<TExtensionConfigSchema extends {
854
860
  [key in string]: (zImpl: typeof z) => z.ZodType;
855
- }, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends AnyExtensionDataRef, TExtraInputs extends {
856
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
861
+ }, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends ExtensionDataRef, TExtraInputs extends {
862
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
857
863
  optional: boolean;
858
864
  singleton: boolean;
859
865
  }>;
@@ -873,7 +879,7 @@ type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefi
873
879
  config?: T['config'];
874
880
  inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>;
875
881
  } & ([T['params']] extends [never] ? {} : {
876
- params?: TFactoryParamsReturn extends ExtensionBlueprintParamsDefiner ? TFactoryParamsReturn : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(define => define(<params>))`' : Partial<T['params']>;
882
+ params?: TFactoryParamsReturn extends ExtensionBlueprintDefineParams ? TFactoryParamsReturn : T['params'] extends ExtensionBlueprintDefineParams ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(defineParams => defineParams(<params>))`' : Partial<T['params']>;
877
883
  })>) => ExtensionDataContainer<NonNullable<T['output']>>, context: {
878
884
  node: AppNode;
879
885
  apis: ApiHolder;
@@ -883,11 +889,11 @@ type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefi
883
889
  inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>;
884
890
  }): Iterable<UFactoryOutput>;
885
891
  } & ([T['params']] extends [never] ? {} : {
886
- params?: TParamsInput extends ExtensionBlueprintParamsDefiner ? TParamsInput : T['params'] extends ExtensionBlueprintParamsDefiner ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(define => define(<params>))`' : Partial<T['params']>;
887
- })> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>): ExtensionDefinition<{
892
+ params?: TParamsInput extends ExtensionBlueprintDefineParams ? TParamsInput : T['params'] extends ExtensionBlueprintDefineParams ? 'Error: This blueprint uses advanced parameter types and requires you to pass parameters as using the following callback syntax: `originalFactory(defineParams => defineParams(<params>))`' : Partial<T['params']>;
893
+ })> & VerifyExtensionFactoryOutput<ExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>): ExtensionDefinition<{
888
894
  kind: T['kind'];
889
895
  name: T['name'];
890
- output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
896
+ output: ExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
891
897
  inputs: T['inputs'] & TExtraInputs;
892
898
  config: T['config'] & {
893
899
  [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
@@ -898,8 +904,8 @@ type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefi
898
904
  }>;
899
905
  };
900
906
  /** @public */
901
- declare function createExtension<UOutput extends AnyExtensionDataRef, TInputs extends {
902
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
907
+ declare function createExtension<UOutput extends ExtensionDataRef, TInputs extends {
908
+ [inputName in string]: ExtensionInput<ExtensionDataRef, {
903
909
  optional: boolean;
904
910
  singleton: boolean;
905
911
  }>;
@@ -912,7 +918,7 @@ declare function createExtension<UOutput extends AnyExtensionDataRef, TInputs ex
912
918
  configInput: string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{
913
919
  [key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
914
920
  }>>;
915
- output: UOutput;
921
+ output: UOutput extends ExtensionDataRef<infer IData, infer IId, infer IConfig> ? ExtensionDataRef<IData, IId, IConfig> : never;
916
922
  inputs: TInputs;
917
923
  params: never;
918
924
  kind: string | undefined extends TKind ? undefined : TKind;
@@ -954,10 +960,6 @@ interface AppNodeSpec {
954
960
  readonly disabled: boolean;
955
961
  readonly config?: unknown;
956
962
  readonly plugin?: FrontendPlugin;
957
- /**
958
- * @deprecated Use {@link AppNodeSpec.plugin} instead.
959
- */
960
- readonly source?: FrontendPlugin;
961
963
  }
962
964
  /**
963
965
  * The connections from this {@link AppNode} to other nodes.
@@ -1046,12 +1048,6 @@ declare const appTreeApiRef: _backstage_core_plugin_api.ApiRef<AppTreeApi>;
1046
1048
  /** @public */
1047
1049
  interface ExtensionBoundaryProps {
1048
1050
  node: AppNode;
1049
- /**
1050
- * This explicitly marks the extension as routable for the purpose of
1051
- * capturing analytics events. If not provided, the extension boundary will be
1052
- * marked as routable if it outputs a routePath.
1053
- */
1054
- routable?: boolean;
1055
1051
  children: ReactNode;
1056
1052
  }
1057
1053
  /** @public */
@@ -1321,21 +1317,17 @@ declare const dialogApiRef: _backstage_core_plugin_api.ApiRef<DialogApi>;
1321
1317
  * @public
1322
1318
  */
1323
1319
  type RouteFunc<TParams extends AnyRouteRefParams> = (...[params]: TParams extends undefined ? readonly [] : readonly [params: TParams]) => string;
1324
- /**
1325
- * @public
1326
- */
1327
- type RouteResolutionApiResolveOptions = {
1328
- /**
1329
- * An absolute path to use as a starting point when resolving the route.
1330
- * If no path is provided the route will be resolved from the root of the app.
1331
- */
1332
- sourcePath?: string;
1333
- };
1334
1320
  /**
1335
1321
  * @public
1336
1322
  */
1337
1323
  interface RouteResolutionApi {
1338
- resolve<TParams extends AnyRouteRefParams>(anyRouteRef: RouteRef<TParams> | SubRouteRef<TParams> | ExternalRouteRef<TParams>, options?: RouteResolutionApiResolveOptions): RouteFunc<TParams> | undefined;
1324
+ resolve<TParams extends AnyRouteRefParams>(anyRouteRef: RouteRef<TParams> | SubRouteRef<TParams> | ExternalRouteRef<TParams>, options?: {
1325
+ /**
1326
+ * An absolute path to use as a starting point when resolving the route.
1327
+ * If no path is provided the route will be resolved from the root of the app.
1328
+ */
1329
+ sourcePath?: string;
1330
+ }): RouteFunc<TParams> | undefined;
1339
1331
  }
1340
1332
  /**
1341
1333
  * The `ApiRef` of {@link RouteResolutionApi}.
@@ -1418,6 +1410,25 @@ type AnalyticsTracker = {
1418
1410
  attributes?: AnalyticsEventAttributes;
1419
1411
  }) => void;
1420
1412
  };
1413
+ /**
1414
+ * Analytics implementations are used to track user behavior in a Backstage
1415
+ * instance.
1416
+ *
1417
+ * @remarks
1418
+ *
1419
+ * To instrument your App or Plugin, retrieve an analytics tracker using the
1420
+ * `useAnalytics()` hook. This will return a pre-configured `AnalyticsTracker`
1421
+ * with relevant methods for instrumentation.
1422
+ *
1423
+ * @public
1424
+ */
1425
+ type AnalyticsImplementation = {
1426
+ /**
1427
+ * Primary event handler responsible for compiling and forwarding events to
1428
+ * an analytics system.
1429
+ */
1430
+ captureEvent(event: AnalyticsEvent): void;
1431
+ };
1421
1432
  /**
1422
1433
  * The Analytics API is used to track user behavior in a Backstage instance.
1423
1434
  *
@@ -1439,6 +1450,11 @@ type AnalyticsApi = {
1439
1450
  /**
1440
1451
  * The API reference of {@link AnalyticsApi}.
1441
1452
  *
1453
+ * @remarks
1454
+ *
1455
+ * To define a concrete Analytics Implementation, use
1456
+ * {@link AnalyticsImplementationBlueprint} instead.
1457
+ *
1442
1458
  * @public
1443
1459
  */
1444
1460
  declare const analyticsApiRef: ApiRef<AnalyticsApi>;
@@ -1450,6 +1466,30 @@ declare const analyticsApiRef: ApiRef<AnalyticsApi>;
1450
1466
  */
1451
1467
  declare function useAnalytics(): AnalyticsTracker;
1452
1468
 
1469
+ /** @public */
1470
+ type AnalyticsImplementationFactory<Deps extends {
1471
+ [name in string]: unknown;
1472
+ } = {}> = {
1473
+ deps: TypesToApiRefs<Deps>;
1474
+ factory(deps: Deps): AnalyticsImplementation;
1475
+ };
1476
+ /**
1477
+ * Creates analytics implementations.
1478
+ *
1479
+ * @public
1480
+ */
1481
+ declare const AnalyticsImplementationBlueprint: ExtensionBlueprint<{
1482
+ kind: "analytics";
1483
+ params: <TDeps extends { [name in string]: unknown; }>(params: AnalyticsImplementationFactory<TDeps>) => ExtensionBlueprintParams<AnalyticsImplementationFactory<{}>>;
1484
+ output: ExtensionDataRef<AnalyticsImplementationFactory<{}>, "core.analytics.factory", {}>;
1485
+ inputs: {};
1486
+ config: {};
1487
+ configInput: {};
1488
+ dataRefs: {
1489
+ factory: ConfigurableExtensionDataRef<AnalyticsImplementationFactory<{}>, "core.analytics.factory", {}>;
1490
+ };
1491
+ }>;
1492
+
1453
1493
  /**
1454
1494
  * Creates utility API extensions.
1455
1495
  *
@@ -1457,9 +1497,8 @@ declare function useAnalytics(): AnalyticsTracker;
1457
1497
  */
1458
1498
  declare const ApiBlueprint: ExtensionBlueprint<{
1459
1499
  kind: "api";
1460
- name: undefined;
1461
1500
  params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: ApiFactory<TApi, TImpl, TDeps>) => ExtensionBlueprintParams<AnyApiFactory>;
1462
- output: ConfigurableExtensionDataRef<AnyApiFactory, "core.api.factory", {}>;
1501
+ output: ExtensionDataRef<AnyApiFactory, "core.api.factory", {}>;
1463
1502
  inputs: {};
1464
1503
  config: {};
1465
1504
  configInput: {};
@@ -1476,11 +1515,10 @@ declare const ApiBlueprint: ExtensionBlueprint<{
1476
1515
  */
1477
1516
  declare const AppRootElementBlueprint: ExtensionBlueprint<{
1478
1517
  kind: "app-root-element";
1479
- name: undefined;
1480
1518
  params: {
1481
- element: JSX.Element | (() => JSX.Element);
1519
+ element: JSX.Element;
1482
1520
  };
1483
- output: ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>;
1521
+ output: ExtensionDataRef<react.JSX.Element, "core.reactElement", {}>;
1484
1522
  inputs: {};
1485
1523
  config: {};
1486
1524
  configInput: {};
@@ -1496,31 +1534,33 @@ declare const AppRootElementBlueprint: ExtensionBlueprint<{
1496
1534
  */
1497
1535
  declare const AppRootWrapperBlueprint: ExtensionBlueprint<{
1498
1536
  kind: "app-root-wrapper";
1499
- name: undefined;
1500
1537
  params: {
1501
- Component: ComponentType<PropsWithChildren<{}>>;
1538
+ /** @deprecated use the `component` parameter instead */
1539
+ Component?: [error: "Use the `component` parameter instead"];
1540
+ component: (props: {
1541
+ children: ReactNode;
1542
+ }) => JSX.Element | null;
1502
1543
  };
1503
- output: ConfigurableExtensionDataRef<ComponentType<{
1504
- children?: react.ReactNode | undefined;
1505
- }>, "app.root.wrapper", {}>;
1544
+ output: ExtensionDataRef<(props: {
1545
+ children: ReactNode;
1546
+ }) => JSX.Element | null, "app.root.wrapper", {}>;
1506
1547
  inputs: {};
1507
1548
  config: {};
1508
1549
  configInput: {};
1509
1550
  dataRefs: {
1510
- component: ConfigurableExtensionDataRef<ComponentType<{
1511
- children?: react.ReactNode | undefined;
1512
- }>, "app.root.wrapper", {}>;
1551
+ component: ConfigurableExtensionDataRef<(props: {
1552
+ children: ReactNode;
1553
+ }) => JSX.Element | null, "app.root.wrapper", {}>;
1513
1554
  };
1514
1555
  }>;
1515
1556
 
1516
1557
  /** @public */
1517
1558
  declare const IconBundleBlueprint: ExtensionBlueprint<{
1518
1559
  kind: "icon-bundle";
1519
- name: undefined;
1520
1560
  params: {
1521
1561
  icons: { [key in string]: IconComponent; };
1522
1562
  };
1523
- output: ConfigurableExtensionDataRef<{
1563
+ output: ExtensionDataRef<{
1524
1564
  [x: string]: IconComponent;
1525
1565
  }, "core.icons", {}>;
1526
1566
  inputs: {};
@@ -1568,11 +1608,10 @@ type NavContentComponent = (props: NavContentComponentProps) => JSX.Element | nu
1568
1608
  */
1569
1609
  declare const NavContentBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
1570
1610
  kind: "nav-content";
1571
- name: undefined;
1572
1611
  params: {
1573
1612
  component: NavContentComponent;
1574
1613
  };
1575
- output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<NavContentComponent, "core.nav-content.component", {}>;
1614
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<NavContentComponent, "core.nav-content.component", {}>;
1576
1615
  inputs: {};
1577
1616
  config: {};
1578
1617
  configInput: {};
@@ -1588,13 +1627,12 @@ declare const NavContentBlueprint: _backstage_frontend_plugin_api.ExtensionBluep
1588
1627
  */
1589
1628
  declare const NavItemBlueprint: ExtensionBlueprint<{
1590
1629
  kind: "nav-item";
1591
- name: undefined;
1592
1630
  params: {
1593
1631
  title: string;
1594
1632
  icon: IconComponent$2;
1595
1633
  routeRef: RouteRef<undefined>;
1596
1634
  };
1597
- output: ConfigurableExtensionDataRef<{
1635
+ output: ExtensionDataRef<{
1598
1636
  title: string;
1599
1637
  icon: IconComponent$2;
1600
1638
  routeRef: RouteRef<undefined>;
@@ -1618,13 +1656,16 @@ declare const NavItemBlueprint: ExtensionBlueprint<{
1618
1656
  */
1619
1657
  declare const PageBlueprint: ExtensionBlueprint<{
1620
1658
  kind: "page";
1621
- name: undefined;
1622
1659
  params: {
1623
- defaultPath: string;
1660
+ /**
1661
+ * @deprecated Use the `path` param instead.
1662
+ */
1663
+ defaultPath?: [Error: `Use the 'path' param instead`];
1664
+ path: string;
1624
1665
  loader: () => Promise<JSX.Element>;
1625
1666
  routeRef?: RouteRef;
1626
1667
  };
1627
- output: ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | ConfigurableExtensionDataRef<string, "core.routing.path", {}> | ConfigurableExtensionDataRef<RouteRef<AnyRouteRefParams>, "core.routing.ref", {
1668
+ output: ExtensionDataRef<string, "core.routing.path", {}> | ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | ExtensionDataRef<RouteRef<AnyRouteRefParams>, "core.routing.ref", {
1628
1669
  optional: true;
1629
1670
  }>;
1630
1671
  inputs: {};
@@ -1640,20 +1681,23 @@ declare const PageBlueprint: ExtensionBlueprint<{
1640
1681
  /** @public */
1641
1682
  declare const RouterBlueprint: ExtensionBlueprint<{
1642
1683
  kind: "app-router-component";
1643
- name: undefined;
1644
1684
  params: {
1645
- Component: ComponentType<PropsWithChildren<{}>>;
1685
+ /** @deprecated use the `component` parameter instead */
1686
+ Component?: [error: "Use the `component` parameter instead"];
1687
+ component: (props: {
1688
+ children: ReactNode;
1689
+ }) => JSX.Element | null;
1646
1690
  };
1647
- output: ConfigurableExtensionDataRef<ComponentType<{
1648
- children?: react.ReactNode | undefined;
1649
- }>, "app.router.wrapper", {}>;
1691
+ output: ExtensionDataRef<(props: {
1692
+ children: ReactNode;
1693
+ }) => JSX.Element | null, "app.router.wrapper", {}>;
1650
1694
  inputs: {};
1651
1695
  config: {};
1652
1696
  configInput: {};
1653
1697
  dataRefs: {
1654
- component: ConfigurableExtensionDataRef<ComponentType<{
1655
- children?: react.ReactNode | undefined;
1656
- }>, "app.router.wrapper", {}>;
1698
+ component: ConfigurableExtensionDataRef<(props: {
1699
+ children: ReactNode;
1700
+ }) => JSX.Element | null, "app.router.wrapper", {}>;
1657
1701
  };
1658
1702
  }>;
1659
1703
 
@@ -1664,11 +1708,10 @@ declare const RouterBlueprint: ExtensionBlueprint<{
1664
1708
  */
1665
1709
  declare const SignInPageBlueprint: ExtensionBlueprint<{
1666
1710
  kind: "sign-in-page";
1667
- name: undefined;
1668
1711
  params: {
1669
1712
  loader: () => Promise<ComponentType<SignInPageProps>>;
1670
1713
  };
1671
- output: ConfigurableExtensionDataRef<ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
1714
+ output: ExtensionDataRef<ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
1672
1715
  inputs: {};
1673
1716
  config: {};
1674
1717
  configInput: {};
@@ -1684,11 +1727,10 @@ declare const SignInPageBlueprint: ExtensionBlueprint<{
1684
1727
  */
1685
1728
  declare const ThemeBlueprint: ExtensionBlueprint<{
1686
1729
  kind: "theme";
1687
- name: undefined;
1688
1730
  params: {
1689
1731
  theme: AppTheme;
1690
1732
  };
1691
- output: ConfigurableExtensionDataRef<AppTheme, "core.theme.theme", {}>;
1733
+ output: ExtensionDataRef<AppTheme, "core.theme.theme", {}>;
1692
1734
  inputs: {};
1693
1735
  config: {};
1694
1736
  configInput: {};
@@ -1704,11 +1746,10 @@ declare const ThemeBlueprint: ExtensionBlueprint<{
1704
1746
  */
1705
1747
  declare const TranslationBlueprint: ExtensionBlueprint<{
1706
1748
  kind: "translation";
1707
- name: undefined;
1708
1749
  params: {
1709
1750
  resource: TranslationResource | TranslationMessages;
1710
1751
  };
1711
- output: ConfigurableExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
1752
+ output: ExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
1712
1753
  [x: string]: string;
1713
1754
  }, boolean>, "core.translation.translation", {}>;
1714
1755
  inputs: {};
@@ -1734,12 +1775,12 @@ declare function createComponentExtension<TProps extends {}>(options: {
1734
1775
  }): ExtensionDefinition<{
1735
1776
  config: {};
1736
1777
  configInput: {};
1737
- output: ConfigurableExtensionDataRef<{
1778
+ output: ExtensionDataRef<{
1738
1779
  ref: ComponentRef;
1739
1780
  impl: ComponentType;
1740
1781
  }, "core.component.component", {}>;
1741
1782
  inputs: {
1742
- [x: string]: ExtensionInput<AnyExtensionDataRef, {
1783
+ [x: string]: ExtensionInput<ExtensionDataRef, {
1743
1784
  optional: boolean;
1744
1785
  singleton: boolean;
1745
1786
  }>;
@@ -1756,4 +1797,4 @@ declare namespace createComponentExtension {
1756
1797
  }, "core.component.component", {}>;
1757
1798
  }
1758
1799
 
1759
- export { type AnalyticsApi, AnalyticsContext, type AnalyticsContextValue, type AnalyticsEvent, type AnalyticsEventAttributes, type AnalyticsTracker, type AnyExtensionDataRef, type AnyExternalRoutes, type AnyRouteRefParams, type AnyRoutes, ApiBlueprint, type AppNode, type AppNodeEdges, type AppNodeInstance, type AppNodeSpec, AppRootElementBlueprint, AppRootWrapperBlueprint, type AppTree, type AppTreeApi, type CommonAnalyticsContext, type ComponentRef, type ComponentsApi, type ConfigurableExtensionDataRef, type CoreErrorBoundaryFallbackProps, type CoreNotFoundErrorPageProps, type CoreProgressProps, type CreateExtensionBlueprintOptions, type CreateExtensionOptions, type CreateFrontendFeatureLoaderOptions, type CreateFrontendModuleOptions, type DialogApi, type DialogApiDialog, type Extension, type ExtensionAttachToSpec, type ExtensionBlueprint, type ExtensionBlueprintParameters, type ExtensionBlueprintParams, type ExtensionBlueprintParamsDefiner, ExtensionBoundary, type ExtensionBoundaryProps, type ExtensionDataContainer, type ExtensionDataRef, type ExtensionDataRefToValue, type ExtensionDataValue, type ExtensionDefinition, type ExtensionDefinitionParameters, type ExtensionFactoryMiddleware, type ExtensionInput, type ExternalRouteRef, type FeatureFlagConfig, type FrontendFeature, type FrontendFeatureLoader, type FrontendModule, type FrontendPlugin, type FrontendPluginInfo, type FrontendPluginInfoOptions, IconBundleBlueprint, type IconComponent, type IconsApi, NavContentBlueprint, type NavContentComponent, type NavContentComponentProps, NavItemBlueprint, PageBlueprint, type PluginOptions, type PortableSchema, type ResolveInputValueOverrides, type ResolvedExtensionInput, type ResolvedExtensionInputs, type RouteFunc, type RouteRef, type RouteResolutionApi, type RouteResolutionApiResolveOptions, RouterBlueprint, SignInPageBlueprint, type SubRouteRef, ThemeBlueprint, TranslationBlueprint, analyticsApiRef, appTreeApiRef, componentsApiRef, coreComponentRefs, coreExtensionData, createComponentExtension, createComponentRef, createExtension, createExtensionBlueprint, createExtensionBlueprintParams, createExtensionDataRef, createExtensionInput, createExternalRouteRef, createFrontendFeatureLoader, createFrontendModule, createFrontendPlugin, createRouteRef, createSubRouteRef, dialogApiRef, iconsApiRef, routeResolutionApiRef, useAnalytics, useAppNode, useComponentRef, useRouteRef, useRouteRefParams };
1800
+ export { type AnalyticsApi, AnalyticsContext, type AnalyticsContextValue, type AnalyticsEvent, type AnalyticsEventAttributes, type AnalyticsImplementation, AnalyticsImplementationBlueprint, type AnalyticsImplementationFactory, type AnalyticsTracker, type AnyExtensionDataRef, type AnyRouteRefParams, ApiBlueprint, type AppNode, type AppNodeEdges, type AppNodeInstance, type AppNodeSpec, AppRootElementBlueprint, AppRootWrapperBlueprint, type AppTree, type AppTreeApi, type ComponentRef, type ComponentsApi, type ConfigurableExtensionDataRef, type CoreErrorBoundaryFallbackProps, type CoreNotFoundErrorPageProps, type CoreProgressProps, type CreateExtensionBlueprintOptions, type CreateExtensionOptions, type CreateFrontendFeatureLoaderOptions, type CreateFrontendModuleOptions, type DialogApi, type DialogApiDialog, type Extension, type ExtensionAttachToSpec, type ExtensionBlueprint, type ExtensionBlueprintDefineParams, type ExtensionBlueprintParameters, type ExtensionBlueprintParams, ExtensionBoundary, type ExtensionBoundaryProps, type ExtensionDataContainer, type ExtensionDataRef, type ExtensionDataRefToValue, type ExtensionDataValue, type ExtensionDefinition, type ExtensionDefinitionParameters, type ExtensionFactoryMiddleware, type ExtensionInput, type ExternalRouteRef, type FeatureFlagConfig, type FrontendFeature, type FrontendFeatureLoader, type FrontendModule, type FrontendPlugin, type FrontendPluginInfo, type FrontendPluginInfoOptions, IconBundleBlueprint, type IconComponent, type IconsApi, NavContentBlueprint, type NavContentComponent, type NavContentComponentProps, NavItemBlueprint, PageBlueprint, type PluginOptions, type PortableSchema, type ResolveInputValueOverrides, type ResolvedExtensionInput, type ResolvedExtensionInputs, type RouteFunc, type RouteRef, type RouteResolutionApi, RouterBlueprint, SignInPageBlueprint, type SubRouteRef, ThemeBlueprint, TranslationBlueprint, analyticsApiRef, appTreeApiRef, componentsApiRef, coreComponentRefs, coreExtensionData, createComponentExtension, createComponentRef, createExtension, createExtensionBlueprint, createExtensionBlueprintParams, createExtensionDataRef, createExtensionInput, createExternalRouteRef, createFrontendFeatureLoader, createFrontendModule, createFrontendPlugin, createRouteRef, createSubRouteRef, dialogApiRef, iconsApiRef, routeResolutionApiRef, useAnalytics, useAppNode, useComponentRef, useRouteRef, useRouteRefParams };