@backstage/frontend-plugin-api 0.7.0-next.3 → 0.8.0-next.0

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 (63) hide show
  1. package/CHANGELOG.md +245 -0
  2. package/dist/blueprints/ApiBlueprint.esm.js +8 -5
  3. package/dist/blueprints/ApiBlueprint.esm.js.map +1 -1
  4. package/dist/blueprints/AppRootElementBlueprint.esm.js.map +1 -1
  5. package/dist/blueprints/AppRootWrapperBlueprint.esm.js +5 -4
  6. package/dist/blueprints/AppRootWrapperBlueprint.esm.js.map +1 -1
  7. package/dist/blueprints/IconBundleBlueprint.esm.js +1 -1
  8. package/dist/blueprints/IconBundleBlueprint.esm.js.map +1 -1
  9. package/dist/blueprints/NavItemBlueprint.esm.js +5 -4
  10. package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -1
  11. package/dist/blueprints/NavLogoBlueprint.esm.js +5 -4
  12. package/dist/blueprints/NavLogoBlueprint.esm.js.map +1 -1
  13. package/dist/blueprints/PageBlueprint.esm.js +1 -7
  14. package/dist/blueprints/PageBlueprint.esm.js.map +1 -1
  15. package/dist/blueprints/RouterBlueprint.esm.js +5 -4
  16. package/dist/blueprints/RouterBlueprint.esm.js.map +1 -1
  17. package/dist/blueprints/SignInPageBlueprint.esm.js +5 -4
  18. package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -1
  19. package/dist/blueprints/ThemeBlueprint.esm.js +8 -7
  20. package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -1
  21. package/dist/blueprints/TranslationBlueprint.esm.js +6 -5
  22. package/dist/blueprints/TranslationBlueprint.esm.js.map +1 -1
  23. package/dist/components/ExtensionBoundary.esm.js +10 -1
  24. package/dist/components/ExtensionBoundary.esm.js.map +1 -1
  25. package/dist/extensions/createComponentExtension.esm.js +13 -17
  26. package/dist/extensions/createComponentExtension.esm.js.map +1 -1
  27. package/dist/index.d.ts +378 -498
  28. package/dist/index.esm.js +1 -12
  29. package/dist/index.esm.js.map +1 -1
  30. package/dist/schema/createSchemaFromZod.esm.js.map +1 -1
  31. package/dist/wiring/createExtension.esm.js +21 -27
  32. package/dist/wiring/createExtension.esm.js.map +1 -1
  33. package/dist/wiring/createExtensionBlueprint.esm.js +58 -61
  34. package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
  35. package/dist/wiring/createExtensionDataRef.esm.js.map +1 -1
  36. package/dist/wiring/createExtensionInput.esm.js +2 -1
  37. package/dist/wiring/createExtensionInput.esm.js.map +1 -1
  38. package/dist/wiring/createExtensionOverrides.esm.js.map +1 -1
  39. package/dist/wiring/{createPlugin.esm.js → createFrontendPlugin.esm.js} +11 -5
  40. package/dist/wiring/createFrontendPlugin.esm.js.map +1 -0
  41. package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
  42. package/package.json +6 -6
  43. package/dist/extensions/createApiExtension.esm.js +0 -34
  44. package/dist/extensions/createApiExtension.esm.js.map +0 -1
  45. package/dist/extensions/createAppRootElementExtension.esm.js +0 -25
  46. package/dist/extensions/createAppRootElementExtension.esm.js.map +0 -1
  47. package/dist/extensions/createAppRootWrapperExtension.esm.js +0 -32
  48. package/dist/extensions/createAppRootWrapperExtension.esm.js.map +0 -1
  49. package/dist/extensions/createNavItemExtension.esm.js +0 -35
  50. package/dist/extensions/createNavItemExtension.esm.js.map +0 -1
  51. package/dist/extensions/createNavLogoExtension.esm.js +0 -30
  52. package/dist/extensions/createNavLogoExtension.esm.js.map +0 -1
  53. package/dist/extensions/createPageExtension.esm.js +0 -38
  54. package/dist/extensions/createPageExtension.esm.js.map +0 -1
  55. package/dist/extensions/createRouterExtension.esm.js +0 -32
  56. package/dist/extensions/createRouterExtension.esm.js.map +0 -1
  57. package/dist/extensions/createSignInPageExtension.esm.js +0 -34
  58. package/dist/extensions/createSignInPageExtension.esm.js.map +0 -1
  59. package/dist/extensions/createThemeExtension.esm.js +0 -24
  60. package/dist/extensions/createThemeExtension.esm.js.map +0 -1
  61. package/dist/extensions/createTranslationExtension.esm.js +0 -22
  62. package/dist/extensions/createTranslationExtension.esm.js.map +0 -1
  63. package/dist/wiring/createPlugin.esm.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -2,9 +2,9 @@
2
2
  import * as React from 'react';
3
3
  import React__default, { ReactNode, JSX as JSX$1, ComponentType, PropsWithChildren } from 'react';
4
4
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
5
- import { ApiRef, AnyApiFactory, IconComponent as IconComponent$1, SignInPageProps, AppTheme, AnyApiRef } from '@backstage/core-plugin-api';
5
+ import { ApiHolder, ApiRef, AnyApiFactory, IconComponent as IconComponent$1, 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
- import { z, ZodSchema, ZodTypeDef } from 'zod';
7
+ import { z } from 'zod';
8
8
  import { JsonObject } from '@backstage/types';
9
9
  import { TranslationResource, TranslationMessages } from '@backstage/core-plugin-api/alpha';
10
10
  export { TranslationMessages, TranslationMessagesOptions, TranslationRef, TranslationRefOptions, TranslationResource, TranslationResourceOptions, createTranslationMessages, createTranslationRef, createTranslationResource, useTranslationRef } from '@backstage/core-plugin-api/alpha';
@@ -238,7 +238,7 @@ type AnyExtensionDataRef = ExtensionDataRef<unknown, string, {
238
238
  interface ConfigurableExtensionDataRef<TData, TId extends string, TConfig extends {
239
239
  optional?: true;
240
240
  } = {}> extends ExtensionDataRef<TData, TId, TConfig> {
241
- optional(): ConfigurableExtensionDataRef<TData, TId, TData & {
241
+ optional(): ConfigurableExtensionDataRef<TData, TId, TConfig & {
242
242
  optional: true;
243
243
  }>;
244
244
  (t: TData): ExtensionDataValue<TData, TId>;
@@ -262,18 +262,6 @@ declare const coreExtensionData: {
262
262
  routeRef: ConfigurableExtensionDataRef<RouteRef<AnyRouteRefParams>, "core.routing.ref", {}>;
263
263
  };
264
264
 
265
- /** @public */
266
- type PortableSchema<TOutput, TInput = TOutput> = {
267
- parse: (input: TInput) => TOutput;
268
- schema: JsonObject;
269
- };
270
-
271
- /**
272
- * @public
273
- * @deprecated Use the `config.schema` option of `createExtension` instead, or use `createExtensionBlueprint`.
274
- */
275
- declare function createSchemaFromZod<TOutput, TInput>(schemaCreator: (zImpl: typeof z) => ZodSchema<TOutput, ZodTypeDef, TInput>): PortableSchema<TOutput, TInput>;
276
-
277
265
  /**
278
266
  * Utility type to expand type aliases into their equivalent type.
279
267
  * @ignore
@@ -295,46 +283,32 @@ type CoreErrorBoundaryFallbackProps = {
295
283
  };
296
284
 
297
285
  /** @public */
298
- interface ExtensionInput<TExtensionData extends ExtensionDataRef<unknown, string, {
286
+ interface ExtensionInput<UExtensionData extends ExtensionDataRef<unknown, string, {
299
287
  optional?: true;
300
288
  }>, TConfig extends {
301
289
  singleton: boolean;
302
290
  optional: boolean;
303
291
  }> {
304
292
  $$type: '@backstage/ExtensionInput';
305
- extensionData: Array<TExtensionData>;
306
- config: TConfig;
307
- }
308
- /**
309
- * @public
310
- * @deprecated This type will be removed. Use `ExtensionInput` instead.
311
- */
312
- interface LegacyExtensionInput<TExtensionDataMap extends AnyExtensionDataMap, TConfig extends {
313
- singleton: boolean;
314
- optional: boolean;
315
- }> {
316
- $$type: '@backstage/ExtensionInput';
317
- extensionData: TExtensionDataMap;
293
+ extensionData: Array<UExtensionData>;
318
294
  config: TConfig;
295
+ replaces?: Array<{
296
+ id: string;
297
+ input: string;
298
+ }>;
319
299
  }
320
- /**
321
- * @public
322
- * @deprecated Use the following form instead: `createExtensionInput([dataRef1, dataRef2])`
323
- */
324
- declare function createExtensionInput<TExtensionDataMap extends AnyExtensionDataMap, TConfig extends {
325
- singleton?: boolean;
326
- optional?: boolean;
327
- }>(extensionData: TExtensionDataMap, config?: TConfig): LegacyExtensionInput<TExtensionDataMap, {
328
- singleton: TConfig['singleton'] extends true ? true : false;
329
- optional: TConfig['optional'] extends true ? true : false;
330
- }>;
331
300
  /** @public */
332
301
  declare function createExtensionInput<UExtensionData extends ExtensionDataRef<unknown, string, {
333
302
  optional?: true;
334
303
  }>, TConfig extends {
335
304
  singleton?: boolean;
336
305
  optional?: boolean;
337
- }>(extensionData: Array<UExtensionData>, config?: TConfig): ExtensionInput<UExtensionData, {
306
+ }>(extensionData: Array<UExtensionData>, config?: TConfig & {
307
+ replaces?: Array<{
308
+ id: string;
309
+ input: string;
310
+ }>;
311
+ }): ExtensionInput<UExtensionData, {
338
312
  singleton: TConfig['singleton'] extends true ? true : false;
339
313
  optional: TConfig['optional'] extends true ? true : false;
340
314
  }>;
@@ -373,78 +347,22 @@ type ExtensionDataContainer<UExtensionData extends AnyExtensionDataRef> = Iterab
373
347
  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;
374
348
  };
375
349
 
376
- /**
377
- * @public
378
- * @deprecated Extension data maps will be removed.
379
- */
380
- type AnyExtensionDataMap = {
381
- [name in string]: AnyExtensionDataRef;
382
- };
383
- /**
384
- * @public
385
- * @deprecated This type will be removed.
386
- */
387
- type AnyExtensionInputMap = {
388
- [inputName in string]: LegacyExtensionInput<AnyExtensionDataMap, {
389
- optional: boolean;
390
- singleton: boolean;
391
- }>;
392
- };
393
- /**
394
- * Converts an extension data map into the matching concrete data values type.
395
- * @public
396
- * @deprecated Extension data maps will be removed.
397
- */
398
- type ExtensionDataValues<TExtensionData extends AnyExtensionDataMap> = {
399
- [DataName in keyof TExtensionData as TExtensionData[DataName]['config'] extends {
400
- optional: true;
401
- } ? never : DataName]: TExtensionData[DataName]['T'];
402
- } & {
403
- [DataName in keyof TExtensionData as TExtensionData[DataName]['config'] extends {
404
- optional: true;
405
- } ? DataName : never]?: TExtensionData[DataName]['T'];
406
- };
407
350
  /**
408
351
  * Convert a single extension input into a matching resolved input.
409
352
  * @public
410
353
  */
411
354
  type ResolvedExtensionInput<TExtensionInput extends ExtensionInput<any, any>> = TExtensionInput['extensionData'] extends Array<AnyExtensionDataRef> ? {
412
355
  node: AppNode;
413
- } & ExtensionDataContainer<TExtensionInput['extensionData'][number]> : TExtensionInput['extensionData'] extends AnyExtensionDataMap ? {
414
- node: AppNode;
415
- output: ExtensionDataValues<TExtensionInput['extensionData']>;
416
- } : never;
356
+ } & ExtensionDataContainer<TExtensionInput['extensionData'][number]> : never;
417
357
  /**
418
358
  * Converts an extension input map into a matching collection of resolved inputs.
419
359
  * @public
420
360
  */
421
361
  type ResolvedExtensionInputs<TInputs extends {
422
- [name in string]: ExtensionInput<any, any> | LegacyExtensionInput<any, any>;
362
+ [name in string]: ExtensionInput<any, any>;
423
363
  }> = {
424
364
  [InputName in keyof TInputs]: false extends TInputs[InputName]['config']['singleton'] ? Array<Expand<ResolvedExtensionInput<TInputs[InputName]>>> : false extends TInputs[InputName]['config']['optional'] ? Expand<ResolvedExtensionInput<TInputs[InputName]>> : Expand<ResolvedExtensionInput<TInputs[InputName]> | undefined>;
425
365
  };
426
- /**
427
- * @public
428
- * @deprecated This way of structuring the options is deprecated, this type will be removed in the future
429
- */
430
- interface LegacyCreateExtensionOptions<TOutput extends AnyExtensionDataMap, TInputs extends AnyExtensionInputMap, TConfig, TConfigInput> {
431
- kind?: string;
432
- namespace?: string;
433
- name?: string;
434
- attachTo: {
435
- id: string;
436
- input: string;
437
- };
438
- disabled?: boolean;
439
- inputs?: TInputs;
440
- output: TOutput;
441
- configSchema?: PortableSchema<TConfig, TConfigInput>;
442
- factory(context: {
443
- node: AppNode;
444
- config: TConfig;
445
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
446
- }): Expand<ExtensionDataValues<TOutput>>;
447
- }
448
366
  type ToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
449
367
  type PopUnion<U> = ToIntersection<U extends any ? () => U : never> extends () => infer R ? [rest: Exclude<U, R>, next: R] : undefined;
450
368
  /** @ignore */
@@ -475,6 +393,7 @@ type CreateExtensionOptions<TKind extends string | undefined, TNamespace extends
475
393
  };
476
394
  factory(context: {
477
395
  node: AppNode;
396
+ apis: ApiHolder;
478
397
  config: {
479
398
  [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
480
399
  };
@@ -482,22 +401,28 @@ type CreateExtensionOptions<TKind extends string | undefined, TNamespace extends
482
401
  }): Iterable<UFactoryOutput>;
483
402
  } & VerifyExtensionFactoryOutput<UOutput, UFactoryOutput>;
484
403
  /** @public */
485
- interface ExtensionDefinition<TConfig, TConfigInput = TConfig, UOutput extends AnyExtensionDataRef = AnyExtensionDataRef, TInputs extends {
486
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
487
- optional: boolean;
488
- singleton: boolean;
489
- }>;
490
- } = {}, TKind extends string | undefined = string | undefined, TNamespace extends string | undefined = string | undefined, TName extends string | undefined = string | undefined> {
491
- $$type: '@backstage/ExtensionDefinition';
492
- readonly kind?: TKind;
493
- readonly namespace?: TNamespace;
494
- readonly name?: TName;
495
- readonly attachTo: {
496
- id: string;
497
- input: string;
404
+ type ExtensionDefinitionParameters = {
405
+ kind?: string;
406
+ namespace?: string;
407
+ name?: string;
408
+ configInput?: {
409
+ [K in string]: any;
498
410
  };
499
- readonly disabled: boolean;
500
- readonly configSchema?: PortableSchema<TConfig, TConfigInput>;
411
+ config?: {
412
+ [K in string]: any;
413
+ };
414
+ output?: AnyExtensionDataRef;
415
+ inputs?: {
416
+ [KName in string]: ExtensionInput<AnyExtensionDataRef, {
417
+ optional: boolean;
418
+ singleton: boolean;
419
+ }>;
420
+ };
421
+ };
422
+ /** @public */
423
+ type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefinitionParameters> = {
424
+ $$type: '@backstage/ExtensionDefinition';
425
+ readonly T: T;
501
426
  override<TExtensionConfigSchema extends {
502
427
  [key in string]: (zImpl: typeof z) => z.ZodType;
503
428
  }, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends AnyExtensionDataRef, TExtraInputs extends {
@@ -512,30 +437,39 @@ interface ExtensionDefinition<TConfig, TConfigInput = TConfig, UOutput extends A
512
437
  };
513
438
  disabled?: boolean;
514
439
  inputs?: TExtraInputs & {
515
- [KName in keyof TInputs]?: `Error: Input '${KName & string}' is already defined in parent definition`;
440
+ [KName in keyof T['inputs']]?: `Error: Input '${KName & string}' is already defined in parent definition`;
516
441
  };
517
442
  output?: Array<UNewOutput>;
518
443
  config?: {
519
444
  schema: TExtensionConfigSchema & {
520
- [KName in keyof TConfig]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
445
+ [KName in keyof T['config']]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
521
446
  };
522
447
  };
523
448
  factory(originalFactory: (context?: {
524
- config?: TConfig;
525
- inputs?: ResolveInputValueOverrides<TInputs>;
526
- }) => ExtensionDataContainer<UOutput>, context: {
449
+ config?: T['config'];
450
+ inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>;
451
+ }) => ExtensionDataContainer<NonNullable<T['output']>>, context: {
527
452
  node: AppNode;
528
- config: TConfig & {
453
+ apis: ApiHolder;
454
+ config: T['config'] & {
529
455
  [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
530
456
  };
531
- inputs: Expand<ResolvedExtensionInputs<TInputs & TExtraInputs>>;
457
+ inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>;
532
458
  }): Iterable<UFactoryOutput>;
533
- } & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? UOutput : UNewOutput, UFactoryOutput>): ExtensionDefinition<{
534
- [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
535
- } & TConfig, z.input<z.ZodObject<{
536
- [key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>;
537
- }>> & TConfigInput, AnyExtensionDataRef extends UNewOutput ? UOutput : UNewOutput, TInputs & TExtraInputs, TKind, TNamespace, TName>;
538
- }
459
+ } & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>): ExtensionDefinition<{
460
+ kind: T['kind'];
461
+ namespace: T['namespace'];
462
+ name: T['name'];
463
+ output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
464
+ inputs: T['inputs'] & TExtraInputs;
465
+ config: T['config'] & {
466
+ [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
467
+ };
468
+ configInput: T['configInput'] & z.input<z.ZodObject<{
469
+ [key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>;
470
+ }>>;
471
+ }>;
472
+ };
539
473
  /** @public */
540
474
  declare function createExtension<UOutput extends AnyExtensionDataRef, TInputs extends {
541
475
  [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
@@ -545,15 +479,24 @@ declare function createExtension<UOutput extends AnyExtensionDataRef, TInputs ex
545
479
  }, TConfigSchema extends {
546
480
  [key: string]: (zImpl: typeof z) => z.ZodType;
547
481
  }, UFactoryOutput extends ExtensionDataValue<any, any>, const TKind extends string | undefined = undefined, const TNamespace extends string | undefined = undefined, const TName extends string | undefined = undefined>(options: CreateExtensionOptions<TKind, TNamespace, TName, UOutput, TInputs, TConfigSchema, UFactoryOutput>): ExtensionDefinition<{
548
- [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
549
- }, z.input<z.ZodObject<{
550
- [key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
551
- }>>, UOutput, TInputs, string | undefined extends TKind ? undefined : TKind, string | undefined extends TNamespace ? undefined : TNamespace, string | undefined extends TName ? undefined : TName>;
552
- /**
553
- * @public
554
- * @deprecated - use the array format of `output` instead, see TODO-doc-link
555
- */
556
- declare function createExtension<TOutput extends AnyExtensionDataMap, TInputs extends AnyExtensionInputMap, TConfig, TConfigInput>(options: LegacyCreateExtensionOptions<TOutput, TInputs, TConfig, TConfigInput>): ExtensionDefinition<TConfig, TConfigInput, never, never>;
482
+ config: string extends keyof TConfigSchema ? {} : {
483
+ [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
484
+ };
485
+ configInput: string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{
486
+ [key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
487
+ }>>;
488
+ output: UOutput;
489
+ inputs: TInputs;
490
+ kind: string | undefined extends TKind ? undefined : TKind;
491
+ namespace: string | undefined extends TNamespace ? undefined : TNamespace;
492
+ name: string | undefined extends TName ? undefined : TName;
493
+ }>;
494
+
495
+ /** @public */
496
+ type PortableSchema<TOutput, TInput = TOutput> = {
497
+ parse: (input: TInput) => TOutput;
498
+ schema: JsonObject;
499
+ };
557
500
 
558
501
  /** @public */
559
502
  interface Extension<TConfig, TConfigInput = TConfig> {
@@ -567,7 +510,11 @@ interface Extension<TConfig, TConfigInput = TConfig> {
567
510
  readonly configSchema?: PortableSchema<TConfig, TConfigInput>;
568
511
  }
569
512
  /** @ignore */
570
- type ResolveExtensionId<TExtension extends ExtensionDefinition<any>, TDefaultNamespace extends string | undefined> = TExtension extends ExtensionDefinition<any, any, any, any, infer IKind, infer INamespace, infer IName> ? [string | undefined] extends [IKind | INamespace | IName] ? never : ((undefined extends TDefaultNamespace ? INamespace : TDefaultNamespace) extends infer ISelectedNamespace extends string ? undefined extends IName ? ISelectedNamespace : `${ISelectedNamespace}/${IName}` : IName) extends infer INamePart extends string ? IKind extends string ? `${IKind}:${INamePart}` : INamePart : never : never;
513
+ type ResolveExtensionId<TExtension extends ExtensionDefinition, TDefaultNamespace extends string | undefined> = TExtension extends ExtensionDefinition<{
514
+ kind: infer IKind extends string | undefined;
515
+ namespace: infer INamespace extends string | undefined;
516
+ name: infer IName extends string | undefined;
517
+ }> ? [string | undefined] extends [IKind | INamespace | IName] ? never : ((undefined extends TDefaultNamespace ? INamespace : TDefaultNamespace) extends infer ISelectedNamespace extends string ? undefined extends IName ? ISelectedNamespace : `${ISelectedNamespace}/${IName}` : IName) extends infer INamePart extends string ? IKind extends string ? `${IKind}:${INamePart}` : INamePart : never : never;
571
518
 
572
519
  /**
573
520
  * Feature flag configuration.
@@ -588,7 +535,7 @@ type AnyExternalRoutes = {
588
535
  };
589
536
  /** @public */
590
537
  interface BackstagePlugin<TRoutes extends AnyRoutes = AnyRoutes, TExternalRoutes extends AnyExternalRoutes = AnyExternalRoutes, TExtensionMap extends {
591
- [id in string]: ExtensionDefinition<any, any>;
538
+ [id in string]: ExtensionDefinition;
592
539
  } = {}> {
593
540
  readonly $$type: '@backstage/BackstagePlugin';
594
541
  readonly id: string;
@@ -596,7 +543,7 @@ interface BackstagePlugin<TRoutes extends AnyRoutes = AnyRoutes, TExternalRoutes
596
543
  readonly externalRoutes: TExternalRoutes;
597
544
  getExtension<TId extends keyof TExtensionMap>(id: TId): TExtensionMap[TId];
598
545
  withOverrides(options: {
599
- extensions: Array<ExtensionDefinition<any, any>>;
546
+ extensions: Array<ExtensionDefinition>;
600
547
  }): BackstagePlugin<TRoutes, TExternalRoutes, TExtensionMap>;
601
548
  }
602
549
  /** @public */
@@ -607,7 +554,7 @@ interface ExtensionOverrides {
607
554
  type FrontendFeature = BackstagePlugin | ExtensionOverrides;
608
555
 
609
556
  /** @public */
610
- interface PluginOptions<TId extends string, TRoutes extends AnyRoutes, TExternalRoutes extends AnyExternalRoutes, TExtensions extends readonly ExtensionDefinition<any, any>[]> {
557
+ interface PluginOptions<TId extends string, TRoutes extends AnyRoutes, TExternalRoutes extends AnyExternalRoutes, TExtensions extends readonly ExtensionDefinition[]> {
611
558
  id: TId;
612
559
  routes?: TRoutes;
613
560
  externalRoutes?: TExternalRoutes;
@@ -615,13 +562,18 @@ interface PluginOptions<TId extends string, TRoutes extends AnyRoutes, TExternal
615
562
  featureFlags?: FeatureFlagConfig[];
616
563
  }
617
564
  /** @public */
618
- declare function createPlugin<TId extends string, TRoutes extends AnyRoutes = {}, TExternalRoutes extends AnyExternalRoutes = {}, TExtensions extends readonly ExtensionDefinition<any, any>[] = []>(options: PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>): BackstagePlugin<TRoutes, TExternalRoutes, {
565
+ declare function createFrontendPlugin<TId extends string, TRoutes extends AnyRoutes = {}, TExternalRoutes extends AnyExternalRoutes = {}, TExtensions extends readonly ExtensionDefinition[] = []>(options: PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>): BackstagePlugin<TRoutes, TExternalRoutes, {
619
566
  [KExtension in TExtensions[number] as ResolveExtensionId<KExtension, TId>]: KExtension;
620
567
  }>;
568
+ /**
569
+ * @public
570
+ * @deprecated Use {@link createFrontendPlugin} instead.
571
+ */
572
+ declare const createPlugin: typeof createFrontendPlugin;
621
573
 
622
574
  /** @public */
623
575
  interface ExtensionOverridesOptions {
624
- extensions: ExtensionDefinition<any, any>[];
576
+ extensions: ExtensionDefinition[];
625
577
  featureFlags?: FeatureFlagConfig[];
626
578
  }
627
579
  /** @public */
@@ -655,6 +607,7 @@ type CreateExtensionBlueprintOptions<TKind extends string, TNamespace extends st
655
607
  };
656
608
  factory(params: TParams, context: {
657
609
  node: AppNode;
610
+ apis: ApiHolder;
658
611
  config: {
659
612
  [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
660
613
  };
@@ -662,22 +615,34 @@ type CreateExtensionBlueprintOptions<TKind extends string, TNamespace extends st
662
615
  }): Iterable<UFactoryOutput>;
663
616
  dataRefs?: TDataRefs;
664
617
  } & VerifyExtensionFactoryOutput<UOutput, UFactoryOutput>;
618
+ /** @public */
619
+ type ExtensionBlueprintParameters = {
620
+ kind: string;
621
+ namespace?: string;
622
+ name?: string;
623
+ params?: object;
624
+ configInput?: {
625
+ [K in string]: any;
626
+ };
627
+ config?: {
628
+ [K in string]: any;
629
+ };
630
+ output?: AnyExtensionDataRef;
631
+ inputs?: {
632
+ [KName in string]: ExtensionInput<AnyExtensionDataRef, {
633
+ optional: boolean;
634
+ singleton: boolean;
635
+ }>;
636
+ };
637
+ dataRefs?: {
638
+ [name in string]: AnyExtensionDataRef;
639
+ };
640
+ };
665
641
  /**
666
642
  * @public
667
643
  */
668
- interface ExtensionBlueprint<TKind extends string, TNamespace extends string | undefined, TName extends string | undefined, TParams, UOutput extends AnyExtensionDataRef, TInputs extends {
669
- [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
670
- optional: boolean;
671
- singleton: boolean;
672
- }>;
673
- }, TConfig extends {
674
- [key in string]: unknown;
675
- }, TConfigInput extends {
676
- [key in string]: unknown;
677
- }, TDataRefs extends {
678
- [name in string]: AnyExtensionDataRef;
679
- }> {
680
- dataRefs: TDataRefs;
644
+ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionBlueprintParameters> {
645
+ dataRefs: T['dataRefs'];
681
646
  make<TNewNamespace extends string | undefined, TNewName extends string | undefined>(args: {
682
647
  namespace?: TNewNamespace;
683
648
  name?: TNewName;
@@ -686,8 +651,16 @@ interface ExtensionBlueprint<TKind extends string, TNamespace extends string | u
686
651
  input: string;
687
652
  };
688
653
  disabled?: boolean;
689
- params: TParams;
690
- }): ExtensionDefinition<TConfig, TConfigInput, UOutput, TInputs, TKind, string | undefined extends TNewNamespace ? TNamespace : TNewNamespace, string | undefined extends TNewName ? TName : TNewName>;
654
+ params: T['params'];
655
+ }): ExtensionDefinition<{
656
+ kind: T['kind'];
657
+ namespace: string | undefined extends TNewNamespace ? T['namespace'] : TNewNamespace;
658
+ name: string | undefined extends TNewName ? T['name'] : TNewName;
659
+ config: T['config'];
660
+ configInput: T['configInput'];
661
+ output: T['output'];
662
+ inputs: T['inputs'];
663
+ }>;
691
664
  /**
692
665
  * Creates a new extension from the blueprint.
693
666
  *
@@ -710,29 +683,38 @@ interface ExtensionBlueprint<TKind extends string, TNamespace extends string | u
710
683
  };
711
684
  disabled?: boolean;
712
685
  inputs?: TExtraInputs & {
713
- [KName in keyof TInputs]?: `Error: Input '${KName & string}' is already defined in parent definition`;
686
+ [KName in keyof T['inputs']]?: `Error: Input '${KName & string}' is already defined in parent definition`;
714
687
  };
715
688
  output?: Array<UNewOutput>;
716
689
  config?: {
717
690
  schema: TExtensionConfigSchema & {
718
- [KName in keyof TConfig]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
691
+ [KName in keyof T['config']]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
719
692
  };
720
693
  };
721
- factory(originalFactory: (params: TParams, context?: {
722
- config?: TConfig;
723
- inputs?: ResolveInputValueOverrides<TInputs>;
724
- }) => ExtensionDataContainer<UOutput>, context: {
694
+ factory(originalFactory: (params: T['params'], context?: {
695
+ config?: T['config'];
696
+ inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>;
697
+ }) => ExtensionDataContainer<NonNullable<T['output']>>, context: {
725
698
  node: AppNode;
726
- config: TConfig & {
699
+ apis: ApiHolder;
700
+ config: T['config'] & {
727
701
  [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
728
702
  };
729
- inputs: Expand<ResolvedExtensionInputs<TInputs & TExtraInputs>>;
730
- }): Iterable<UFactoryOutput> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? UOutput : UNewOutput, UFactoryOutput>;
703
+ inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>;
704
+ }): Iterable<UFactoryOutput> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>;
731
705
  }): ExtensionDefinition<{
732
- [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
733
- } & TConfig, z.input<z.ZodObject<{
734
- [key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>;
735
- }>> & TConfigInput, AnyExtensionDataRef extends UNewOutput ? UOutput : UNewOutput, TInputs & TExtraInputs, TKind, string | undefined extends TNewNamespace ? TNamespace : TNewNamespace, string | undefined extends TNewName ? TName : TNewName>;
706
+ config: (string extends keyof TExtensionConfigSchema ? {} : {
707
+ [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
708
+ }) & T['config'];
709
+ configInput: (string extends keyof TExtensionConfigSchema ? {} : z.input<z.ZodObject<{
710
+ [key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>;
711
+ }>>) & T['configInput'];
712
+ output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
713
+ inputs: T['inputs'] & TExtraInputs;
714
+ kind: T['kind'];
715
+ namespace: string | undefined extends TNewNamespace ? T['namespace'] : TNewNamespace;
716
+ name: string | undefined extends TNewName ? T['name'] : TNewName;
717
+ }>;
736
718
  }
737
719
  /**
738
720
  * A simpler replacement for wrapping up `createExtension` inside a kind or type. This allows for a cleaner API for creating
@@ -740,7 +722,7 @@ interface ExtensionBlueprint<TKind extends string, TNamespace extends string | u
740
722
  *
741
723
  * @public
742
724
  */
743
- declare function createExtensionBlueprint<TParams, UOutput extends AnyExtensionDataRef, TInputs extends {
725
+ declare function createExtensionBlueprint<TParams extends object, UOutput extends AnyExtensionDataRef, TInputs extends {
744
726
  [inputName in string]: ExtensionInput<AnyExtensionDataRef, {
745
727
  optional: boolean;
746
728
  singleton: boolean;
@@ -749,11 +731,21 @@ declare function createExtensionBlueprint<TParams, UOutput extends AnyExtensionD
749
731
  [key in string]: (zImpl: typeof z) => z.ZodType;
750
732
  }, UFactoryOutput extends ExtensionDataValue<any, any>, TKind extends string, TNamespace extends string | undefined = undefined, TName extends string | undefined = undefined, TDataRefs extends {
751
733
  [name in string]: AnyExtensionDataRef;
752
- } = never>(options: CreateExtensionBlueprintOptions<TKind, TNamespace, TName, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs>): ExtensionBlueprint<TKind, TNamespace, TName, TParams, UOutput, string extends keyof TInputs ? {} : TInputs, string extends keyof TConfigSchema ? {} : {
753
- [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
754
- }, string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{
755
- [key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
756
- }>>, TDataRefs>;
734
+ } = never>(options: CreateExtensionBlueprintOptions<TKind, TNamespace, TName, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs>): ExtensionBlueprint<{
735
+ kind: TKind;
736
+ namespace: TNamespace;
737
+ name: TName;
738
+ params: TParams;
739
+ output: UOutput;
740
+ inputs: string extends keyof TInputs ? {} : TInputs;
741
+ config: string extends keyof TConfigSchema ? {} : {
742
+ [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
743
+ };
744
+ configInput: string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{
745
+ [key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
746
+ }>>;
747
+ dataRefs: TDataRefs;
748
+ }>;
757
749
 
758
750
  /**
759
751
  * The specification for this {@link AppNode} in the {@link AppTree}.
@@ -866,6 +858,10 @@ interface ExtensionBoundaryProps {
866
858
  }
867
859
  /** @public */
868
860
  declare function ExtensionBoundary(props: ExtensionBoundaryProps): React__default.JSX.Element;
861
+ /** @public */
862
+ declare namespace ExtensionBoundary {
863
+ function lazy(appNode: AppNode, lazyElement: () => Promise<JSX.Element>): JSX.Element;
864
+ }
869
865
 
870
866
  /** @public */
871
867
  type ComponentRef<T extends {} = {}> = {
@@ -1090,10 +1086,20 @@ declare function useAnalytics(): AnalyticsTracker;
1090
1086
  *
1091
1087
  * @public
1092
1088
  */
1093
- declare const ApiBlueprint: ExtensionBlueprint<"api", undefined, undefined, {
1094
- factory: AnyApiFactory;
1095
- }, ConfigurableExtensionDataRef<AnyApiFactory, "core.api.factory", {}>, {}, {}, {}, {
1096
- factory: ConfigurableExtensionDataRef<AnyApiFactory, "core.api.factory", {}>;
1089
+ declare const ApiBlueprint: ExtensionBlueprint<{
1090
+ kind: "api";
1091
+ namespace: undefined;
1092
+ name: undefined;
1093
+ params: {
1094
+ factory: AnyApiFactory;
1095
+ };
1096
+ output: ConfigurableExtensionDataRef<AnyApiFactory, "core.api.factory", {}>;
1097
+ inputs: {};
1098
+ config: {};
1099
+ configInput: {};
1100
+ dataRefs: {
1101
+ factory: ConfigurableExtensionDataRef<AnyApiFactory, "core.api.factory", {}>;
1102
+ };
1097
1103
  }>;
1098
1104
 
1099
1105
  /**
@@ -1102,9 +1108,19 @@ declare const ApiBlueprint: ExtensionBlueprint<"api", undefined, undefined, {
1102
1108
  *
1103
1109
  * @public
1104
1110
  */
1105
- declare const AppRootElementBlueprint: ExtensionBlueprint<"app-root-element", undefined, undefined, {
1106
- element: JSX.Element | (() => JSX.Element);
1107
- }, ConfigurableExtensionDataRef<React.JSX.Element, "core.reactElement", {}>, {}, {}, {}, never>;
1111
+ declare const AppRootElementBlueprint: ExtensionBlueprint<{
1112
+ kind: "app-root-element";
1113
+ namespace: undefined;
1114
+ name: undefined;
1115
+ params: {
1116
+ element: JSX.Element | (() => JSX.Element);
1117
+ };
1118
+ output: ConfigurableExtensionDataRef<React.JSX.Element, "core.reactElement", {}>;
1119
+ inputs: {};
1120
+ config: {};
1121
+ configInput: {};
1122
+ dataRefs: never;
1123
+ }>;
1108
1124
 
1109
1125
  /**
1110
1126
  * Creates a extensions that render a React wrapper at the app root, enclosing
@@ -1113,33 +1129,53 @@ declare const AppRootElementBlueprint: ExtensionBlueprint<"app-root-element", un
1113
1129
  *
1114
1130
  * @public
1115
1131
  */
1116
- declare const AppRootWrapperBlueprint: ExtensionBlueprint<"app-root-wrapper", undefined, undefined, {
1117
- Component: ComponentType<PropsWithChildren<{}>>;
1118
- }, ConfigurableExtensionDataRef<React__default.ComponentType<{
1119
- children?: React__default.ReactNode;
1120
- }>, "app.root.wrapper", {}>, {}, {}, {}, {
1121
- component: ConfigurableExtensionDataRef<React__default.ComponentType<{
1132
+ declare const AppRootWrapperBlueprint: ExtensionBlueprint<{
1133
+ kind: "app-root-wrapper";
1134
+ namespace: undefined;
1135
+ name: undefined;
1136
+ params: {
1137
+ Component: ComponentType<PropsWithChildren<{}>>;
1138
+ };
1139
+ output: ConfigurableExtensionDataRef<React__default.ComponentType<{
1122
1140
  children?: React__default.ReactNode;
1123
1141
  }>, "app.root.wrapper", {}>;
1142
+ inputs: {};
1143
+ config: {};
1144
+ configInput: {};
1145
+ dataRefs: {
1146
+ component: ConfigurableExtensionDataRef<React__default.ComponentType<{
1147
+ children?: React__default.ReactNode;
1148
+ }>, "app.root.wrapper", {}>;
1149
+ };
1124
1150
  }>;
1125
1151
 
1126
1152
  /** @public */
1127
- declare const IconBundleBlueprint: ExtensionBlueprint<"icon-bundle", "app", undefined, {
1128
- icons: {
1129
- [x: string]: IconComponent;
1153
+ declare const IconBundleBlueprint: ExtensionBlueprint<{
1154
+ kind: "icon-bundle";
1155
+ namespace: "app";
1156
+ name: undefined;
1157
+ params: {
1158
+ icons: {
1159
+ [x: string]: IconComponent;
1160
+ };
1130
1161
  };
1131
- }, ConfigurableExtensionDataRef<{
1132
- [x: string]: IconComponent;
1133
- }, "core.icons", {}>, {}, {
1134
- icons: string;
1135
- test: string;
1136
- }, {
1137
- test: string;
1138
- icons?: string | undefined;
1139
- }, {
1140
- icons: ConfigurableExtensionDataRef<{
1162
+ output: ConfigurableExtensionDataRef<{
1141
1163
  [x: string]: IconComponent;
1142
1164
  }, "core.icons", {}>;
1165
+ inputs: {};
1166
+ config: {
1167
+ icons: string;
1168
+ test: string;
1169
+ };
1170
+ configInput: {
1171
+ test: string;
1172
+ icons?: string | undefined;
1173
+ };
1174
+ dataRefs: {
1175
+ icons: ConfigurableExtensionDataRef<{
1176
+ [x: string]: IconComponent;
1177
+ }, "core.icons", {}>;
1178
+ };
1143
1179
  }>;
1144
1180
 
1145
1181
  /**
@@ -1147,20 +1183,30 @@ declare const IconBundleBlueprint: ExtensionBlueprint<"icon-bundle", "app", unde
1147
1183
  *
1148
1184
  * @public
1149
1185
  */
1150
- declare const NavItemBlueprint: ExtensionBlueprint<"nav-item", undefined, undefined, {
1151
- title: string;
1152
- icon: IconComponent$1;
1153
- routeRef: RouteRef<undefined>;
1154
- }, ConfigurableExtensionDataRef<{
1155
- title: string;
1156
- icon: IconComponent$1;
1157
- routeRef: RouteRef<undefined>;
1158
- }, "core.nav-item.target", {}>, {}, {}, {}, {
1159
- target: ConfigurableExtensionDataRef<{
1186
+ declare const NavItemBlueprint: ExtensionBlueprint<{
1187
+ kind: "nav-item";
1188
+ namespace: undefined;
1189
+ name: undefined;
1190
+ params: {
1191
+ title: string;
1192
+ icon: IconComponent$1;
1193
+ routeRef: RouteRef<undefined>;
1194
+ };
1195
+ output: ConfigurableExtensionDataRef<{
1160
1196
  title: string;
1161
1197
  icon: IconComponent$1;
1162
1198
  routeRef: RouteRef<undefined>;
1163
1199
  }, "core.nav-item.target", {}>;
1200
+ inputs: {};
1201
+ config: {};
1202
+ configInput: {};
1203
+ dataRefs: {
1204
+ target: ConfigurableExtensionDataRef<{
1205
+ title: string;
1206
+ icon: IconComponent$1;
1207
+ routeRef: RouteRef<undefined>;
1208
+ }, "core.nav-item.target", {}>;
1209
+ };
1164
1210
  }>;
1165
1211
 
1166
1212
  /**
@@ -1168,17 +1214,27 @@ declare const NavItemBlueprint: ExtensionBlueprint<"nav-item", undefined, undefi
1168
1214
  *
1169
1215
  * @public
1170
1216
  */
1171
- declare const NavLogoBlueprint: ExtensionBlueprint<"nav-logo", undefined, undefined, {
1172
- logoIcon: JSX.Element;
1173
- logoFull: JSX.Element;
1174
- }, ConfigurableExtensionDataRef<{
1175
- logoIcon?: JSX.Element | undefined;
1176
- logoFull?: JSX.Element | undefined;
1177
- }, "core.nav-logo.logo-elements", {}>, {}, {}, {}, {
1178
- logoElements: ConfigurableExtensionDataRef<{
1217
+ declare const NavLogoBlueprint: ExtensionBlueprint<{
1218
+ kind: "nav-logo";
1219
+ namespace: undefined;
1220
+ name: undefined;
1221
+ params: {
1222
+ logoIcon: JSX.Element;
1223
+ logoFull: JSX.Element;
1224
+ };
1225
+ output: ConfigurableExtensionDataRef<{
1179
1226
  logoIcon?: JSX.Element | undefined;
1180
1227
  logoFull?: JSX.Element | undefined;
1181
1228
  }, "core.nav-logo.logo-elements", {}>;
1229
+ inputs: {};
1230
+ config: {};
1231
+ configInput: {};
1232
+ dataRefs: {
1233
+ logoElements: ConfigurableExtensionDataRef<{
1234
+ logoIcon?: JSX.Element | undefined;
1235
+ logoFull?: JSX.Element | undefined;
1236
+ }, "core.nav-logo.logo-elements", {}>;
1237
+ };
1182
1238
  }>;
1183
1239
 
1184
1240
  /**
@@ -1186,27 +1242,47 @@ declare const NavLogoBlueprint: ExtensionBlueprint<"nav-logo", undefined, undefi
1186
1242
  *
1187
1243
  * @public
1188
1244
  */
1189
- declare const PageBlueprint: ExtensionBlueprint<"page", undefined, undefined, {
1190
- defaultPath: string;
1191
- loader: () => Promise<JSX.Element>;
1192
- routeRef?: RouteRef<AnyRouteRefParams> | undefined;
1193
- }, ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | ConfigurableExtensionDataRef<string, "core.routing.path", {}> | ConfigurableExtensionDataRef<RouteRef<AnyRouteRefParams>, "core.routing.ref", RouteRef<AnyRouteRefParams> & {
1194
- optional: true;
1195
- }>, {}, {
1196
- path: string | undefined;
1197
- }, {
1198
- path?: string | undefined;
1199
- }, never>;
1245
+ declare const PageBlueprint: ExtensionBlueprint<{
1246
+ kind: "page";
1247
+ namespace: undefined;
1248
+ name: undefined;
1249
+ params: {
1250
+ defaultPath: string;
1251
+ loader: () => Promise<JSX.Element>;
1252
+ routeRef?: RouteRef<AnyRouteRefParams> | undefined;
1253
+ };
1254
+ output: ConfigurableExtensionDataRef<React.JSX.Element, "core.reactElement", {}> | ConfigurableExtensionDataRef<string, "core.routing.path", {}> | ConfigurableExtensionDataRef<RouteRef<AnyRouteRefParams>, "core.routing.ref", {
1255
+ optional: true;
1256
+ }>;
1257
+ inputs: {};
1258
+ config: {
1259
+ path: string | undefined;
1260
+ };
1261
+ configInput: {
1262
+ path?: string | undefined;
1263
+ };
1264
+ dataRefs: never;
1265
+ }>;
1200
1266
 
1201
1267
  /** @public */
1202
- declare const RouterBlueprint: ExtensionBlueprint<"app-router-component", undefined, undefined, {
1203
- Component: ComponentType<PropsWithChildren<{}>>;
1204
- }, ConfigurableExtensionDataRef<ComponentType<{
1205
- children?: React.ReactNode;
1206
- }>, "app.router.wrapper", {}>, {}, {}, {}, {
1207
- component: ConfigurableExtensionDataRef<ComponentType<{
1268
+ declare const RouterBlueprint: ExtensionBlueprint<{
1269
+ kind: "app-router-component";
1270
+ namespace: undefined;
1271
+ name: undefined;
1272
+ params: {
1273
+ Component: ComponentType<PropsWithChildren<{}>>;
1274
+ };
1275
+ output: ConfigurableExtensionDataRef<ComponentType<{
1208
1276
  children?: React.ReactNode;
1209
1277
  }>, "app.router.wrapper", {}>;
1278
+ inputs: {};
1279
+ config: {};
1280
+ configInput: {};
1281
+ dataRefs: {
1282
+ component: ConfigurableExtensionDataRef<ComponentType<{
1283
+ children?: React.ReactNode;
1284
+ }>, "app.router.wrapper", {}>;
1285
+ };
1210
1286
  }>;
1211
1287
 
1212
1288
  /**
@@ -1214,10 +1290,20 @@ declare const RouterBlueprint: ExtensionBlueprint<"app-router-component", undefi
1214
1290
  *
1215
1291
  * @public
1216
1292
  */
1217
- declare const SignInPageBlueprint: ExtensionBlueprint<"sign-in-page", undefined, undefined, {
1218
- loader: () => Promise<ComponentType<SignInPageProps>>;
1219
- }, ConfigurableExtensionDataRef<React__default.ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>, {}, {}, {}, {
1220
- component: ConfigurableExtensionDataRef<React__default.ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
1293
+ declare const SignInPageBlueprint: ExtensionBlueprint<{
1294
+ kind: "sign-in-page";
1295
+ namespace: undefined;
1296
+ name: undefined;
1297
+ params: {
1298
+ loader: () => Promise<ComponentType<SignInPageProps>>;
1299
+ };
1300
+ output: ConfigurableExtensionDataRef<React__default.ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
1301
+ inputs: {};
1302
+ config: {};
1303
+ configInput: {};
1304
+ dataRefs: {
1305
+ component: ConfigurableExtensionDataRef<React__default.ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
1306
+ };
1221
1307
  }>;
1222
1308
 
1223
1309
  /**
@@ -1225,10 +1311,20 @@ declare const SignInPageBlueprint: ExtensionBlueprint<"sign-in-page", undefined,
1225
1311
  *
1226
1312
  * @public
1227
1313
  */
1228
- declare const ThemeBlueprint: ExtensionBlueprint<"theme", "app", undefined, {
1229
- theme: AppTheme;
1230
- }, ConfigurableExtensionDataRef<AppTheme, "core.theme.theme", {}>, {}, {}, {}, {
1231
- theme: ConfigurableExtensionDataRef<AppTheme, "core.theme.theme", {}>;
1314
+ declare const ThemeBlueprint: ExtensionBlueprint<{
1315
+ kind: "theme";
1316
+ namespace: "app";
1317
+ name: undefined;
1318
+ params: {
1319
+ theme: AppTheme;
1320
+ };
1321
+ output: ConfigurableExtensionDataRef<AppTheme, "core.theme.theme", {}>;
1322
+ inputs: {};
1323
+ config: {};
1324
+ configInput: {};
1325
+ dataRefs: {
1326
+ theme: ConfigurableExtensionDataRef<AppTheme, "core.theme.theme", {}>;
1327
+ };
1232
1328
  }>;
1233
1329
 
1234
1330
  /**
@@ -1236,251 +1332,53 @@ declare const ThemeBlueprint: ExtensionBlueprint<"theme", "app", undefined, {
1236
1332
  *
1237
1333
  * @public
1238
1334
  */
1239
- declare const TranslationBlueprint: ExtensionBlueprint<"translation", undefined, undefined, {
1240
- resource: TranslationResource | TranslationMessages;
1241
- }, ConfigurableExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
1242
- [x: string]: string;
1243
- }, boolean>, "core.translation.translation", {}>, {}, {}, {}, {
1244
- translation: ConfigurableExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
1335
+ declare const TranslationBlueprint: ExtensionBlueprint<{
1336
+ kind: "translation";
1337
+ namespace: undefined;
1338
+ name: undefined;
1339
+ params: {
1340
+ resource: TranslationResource | TranslationMessages;
1341
+ };
1342
+ output: ConfigurableExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
1245
1343
  [x: string]: string;
1246
1344
  }, boolean>, "core.translation.translation", {}>;
1247
- }>;
1248
-
1249
- /**
1250
- * @public
1251
- * @deprecated Use {@link ApiBlueprint} instead.
1252
- */
1253
- declare function createApiExtension<TConfig extends {}, TInputs extends AnyExtensionInputMap>(options: ({
1254
- api: AnyApiRef;
1255
- factory: (options: {
1256
- config: TConfig;
1257
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1258
- }) => AnyApiFactory;
1259
- } | {
1260
- factory: AnyApiFactory;
1261
- }) & {
1262
- configSchema?: PortableSchema<TConfig>;
1263
- inputs?: TInputs;
1264
- }): ExtensionDefinition<TConfig, TConfig, never, never, string | undefined, string | undefined, string | undefined>;
1265
- /** @public */
1266
- declare namespace createApiExtension {
1267
- const factoryDataRef: ConfigurableExtensionDataRef<AnyApiFactory, "core.api.factory", {}>;
1268
- }
1269
-
1270
- /**
1271
- * Creates an extension that renders a React element at the app root, outside of
1272
- * the app layout. This is useful for example for shared popups and similar.
1273
- *
1274
- * @public
1275
- * @deprecated Use {@link AppRootElementBlueprint} instead.
1276
- */
1277
- declare function createAppRootElementExtension<TConfig extends {}, TInputs extends AnyExtensionInputMap>(options: {
1278
- namespace?: string;
1279
- name?: string;
1280
- attachTo?: {
1281
- id: string;
1282
- input: string;
1283
- };
1284
- configSchema?: PortableSchema<TConfig>;
1285
- disabled?: boolean;
1286
- inputs?: TInputs;
1287
- element: JSX$1.Element | ((options: {
1288
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1289
- config: TConfig;
1290
- }) => JSX$1.Element);
1291
- }): ExtensionDefinition<TConfig>;
1292
-
1293
- /**
1294
- * Creates an extension that renders a React wrapper at the app root, enclosing
1295
- * the app layout. This is useful for example for adding global React contexts
1296
- * and similar.
1297
- *
1298
- * @public
1299
- * @deprecated Use {@link AppRootWrapperBlueprint} instead.
1300
- */
1301
- declare function createAppRootWrapperExtension<TConfig extends {}, TInputs extends AnyExtensionInputMap>(options: {
1302
- namespace?: string;
1303
- name?: string;
1304
- attachTo?: {
1305
- id: string;
1306
- input: string;
1307
- };
1308
- configSchema?: PortableSchema<TConfig>;
1309
- disabled?: boolean;
1310
- inputs?: TInputs;
1311
- Component: ComponentType<PropsWithChildren<{
1312
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1313
- config: TConfig;
1314
- }>>;
1315
- }): ExtensionDefinition<TConfig>;
1316
- /** @public */
1317
- declare namespace createAppRootWrapperExtension {
1318
- const componentDataRef: ConfigurableExtensionDataRef<React__default.ComponentType<{
1319
- children?: React__default.ReactNode;
1320
- }>, "app.root.wrapper", {}>;
1321
- }
1322
-
1323
- /**
1324
- * Creates an extension that replaces the router implementation at the app root.
1325
- * This is useful to be able to for example replace the BrowserRouter with a
1326
- * MemoryRouter in tests, or to add additional props to a BrowserRouter.
1327
- *
1328
- * @public
1329
- * @deprecated Use {@link RouterBlueprint} instead.
1330
- */
1331
- declare function createRouterExtension<TConfig extends {}, TInputs extends AnyExtensionInputMap>(options: {
1332
- namespace?: string;
1333
- name?: string;
1334
- attachTo?: {
1335
- id: string;
1336
- input: string;
1345
+ inputs: {};
1346
+ config: {};
1347
+ configInput: {};
1348
+ dataRefs: {
1349
+ translation: ConfigurableExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
1350
+ [x: string]: string;
1351
+ }, boolean>, "core.translation.translation", {}>;
1337
1352
  };
1338
- configSchema?: PortableSchema<TConfig>;
1339
- disabled?: boolean;
1340
- inputs?: TInputs;
1341
- Component: ComponentType<PropsWithChildren<{
1342
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1343
- config: TConfig;
1344
- }>>;
1345
- }): ExtensionDefinition<TConfig>;
1346
- /** @public */
1347
- declare namespace createRouterExtension {
1348
- const componentDataRef: ConfigurableExtensionDataRef<React__default.ComponentType<{
1349
- children?: React__default.ReactNode;
1350
- }>, "app.router.wrapper", {}>;
1351
- }
1352
-
1353
- /**
1354
- * Helper for creating extensions for a routable React page component.
1355
- *
1356
- * @public
1357
- * @deprecated Use {@link PageBlueprint} instead.
1358
- */
1359
- declare function createPageExtension<TConfig extends {
1360
- path: string;
1361
- }, TInputs extends AnyExtensionInputMap>(options: ({
1362
- defaultPath: string;
1363
- } | {
1364
- configSchema: PortableSchema<TConfig>;
1365
- }) & {
1366
- namespace?: string;
1367
- name?: string;
1368
- attachTo?: {
1369
- id: string;
1370
- input: string;
1371
- };
1372
- disabled?: boolean;
1373
- inputs?: TInputs;
1374
- routeRef?: RouteRef;
1375
- loader: (options: {
1376
- config: TConfig;
1377
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1378
- }) => Promise<JSX.Element>;
1379
- }): ExtensionDefinition<TConfig>;
1380
-
1381
- /**
1382
- * Helper for creating extensions for a nav item.
1383
- *
1384
- * @public
1385
- * @deprecated Use {@link NavItemBlueprint} instead.
1386
- */
1387
- declare function createNavItemExtension(options: {
1388
- namespace?: string;
1389
- name?: string;
1390
- routeRef: RouteRef<undefined>;
1391
- title: string;
1392
- icon: IconComponent$1;
1393
- }): ExtensionDefinition<{
1394
- title: string;
1395
- }, {
1396
- title?: string | undefined;
1397
- }, never, never, string | undefined, string | undefined, string | undefined>;
1398
- /** @public */
1399
- declare namespace createNavItemExtension {
1400
- const targetDataRef: ConfigurableExtensionDataRef<{
1401
- title: string;
1402
- icon: IconComponent$1;
1403
- routeRef: RouteRef<undefined>;
1404
- }, "core.nav-item.target", {}>;
1405
- }
1406
-
1407
- /**
1408
- * Helper for creating extensions for a nav logos.
1409
- *
1410
- * @public
1411
- * @deprecated Use {@link NavLogoBlueprint} instead.
1412
- */
1413
- declare function createNavLogoExtension(options: {
1414
- name?: string;
1415
- namespace?: string;
1416
- logoIcon: JSX.Element;
1417
- logoFull: JSX.Element;
1418
- }): ExtensionDefinition<unknown, unknown, never, never, string | undefined, string | undefined, string | undefined>;
1419
- /** @public */
1420
- declare namespace createNavLogoExtension {
1421
- const logoElementsDataRef: ConfigurableExtensionDataRef<{
1422
- logoIcon?: JSX.Element | undefined;
1423
- logoFull?: JSX.Element | undefined;
1424
- }, "core.nav-logo.logo-elements", {}>;
1425
- }
1426
-
1427
- /**
1428
- *
1429
- * @public
1430
- * @deprecated Use {@link SignInPageBlueprint} instead.
1431
- */
1432
- declare function createSignInPageExtension<TConfig extends {}, TInputs extends AnyExtensionInputMap>(options: {
1433
- namespace?: string;
1434
- name?: string;
1435
- attachTo?: {
1436
- id: string;
1437
- input: string;
1438
- };
1439
- configSchema?: PortableSchema<TConfig>;
1440
- disabled?: boolean;
1441
- inputs?: TInputs;
1442
- loader: (options: {
1443
- config: TConfig;
1444
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1445
- }) => Promise<ComponentType<SignInPageProps>>;
1446
- }): ExtensionDefinition<TConfig>;
1447
- /** @public */
1448
- declare namespace createSignInPageExtension {
1449
- const componentDataRef: ConfigurableExtensionDataRef<React__default.ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
1450
- }
1451
-
1452
- /**
1453
- * @public
1454
- * @deprecated Use {@link ThemeBlueprint} instead.
1455
- */
1456
- declare function createThemeExtension(theme: AppTheme): ExtensionDefinition<unknown, unknown, never, never, string | undefined, string | undefined, string | undefined>;
1457
- /**
1458
- * @public
1459
- * @deprecated Use {@link ThemeBlueprint} instead.
1460
- */
1461
- declare namespace createThemeExtension {
1462
- const themeDataRef: ConfigurableExtensionDataRef<AppTheme, "core.theme.theme", {}>;
1463
- }
1353
+ }>;
1464
1354
 
1465
1355
  /** @public */
1466
- declare function createComponentExtension<TProps extends {}, TConfig extends {}, TInputs extends AnyExtensionInputMap>(options: {
1356
+ declare function createComponentExtension<TProps extends {}>(options: {
1467
1357
  ref: ComponentRef<TProps>;
1468
1358
  name?: string;
1469
1359
  disabled?: boolean;
1470
- inputs?: TInputs;
1471
- configSchema?: PortableSchema<TConfig>;
1472
1360
  loader: {
1473
- lazy: (values: {
1474
- config: TConfig;
1475
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1476
- }) => Promise<ComponentType<TProps>>;
1361
+ lazy: () => Promise<ComponentType<TProps>>;
1477
1362
  } | {
1478
- sync: (values: {
1479
- config: TConfig;
1480
- inputs: Expand<ResolvedExtensionInputs<TInputs>>;
1481
- }) => ComponentType<TProps>;
1363
+ sync: () => ComponentType<TProps>;
1482
1364
  };
1483
- }): ExtensionDefinition<TConfig, TConfig, never, never, string | undefined, string | undefined, string | undefined>;
1365
+ }): ExtensionDefinition<{
1366
+ config: {};
1367
+ configInput: {};
1368
+ output: ConfigurableExtensionDataRef<{
1369
+ ref: ComponentRef;
1370
+ impl: ComponentType;
1371
+ }, "core.component.component", {}>;
1372
+ inputs: {
1373
+ [x: string]: ExtensionInput<AnyExtensionDataRef, {
1374
+ optional: boolean;
1375
+ singleton: boolean;
1376
+ }>;
1377
+ };
1378
+ kind: "component";
1379
+ namespace: string;
1380
+ name: string;
1381
+ }>;
1484
1382
  /** @public */
1485
1383
  declare namespace createComponentExtension {
1486
1384
  const componentDataRef: ConfigurableExtensionDataRef<{
@@ -1489,22 +1387,4 @@ declare namespace createComponentExtension {
1489
1387
  }, "core.component.component", {}>;
1490
1388
  }
1491
1389
 
1492
- /**
1493
- * @public
1494
- * @deprecated Use {@link TranslationBlueprint} instead.
1495
- */
1496
- declare function createTranslationExtension(options: {
1497
- name?: string;
1498
- resource: TranslationResource | TranslationMessages;
1499
- }): ExtensionDefinition<unknown, unknown, never, never, string | undefined, string | undefined, string | undefined>;
1500
- /**
1501
- * @public
1502
- * @deprecated Use {@link TranslationBlueprint} instead.
1503
- */
1504
- declare namespace createTranslationExtension {
1505
- const translationDataRef: ConfigurableExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
1506
- [x: string]: string;
1507
- }, boolean>, "core.translation.translation", {}>;
1508
- }
1509
-
1510
- export { type AnalyticsApi, AnalyticsContext, type AnalyticsContextValue, type AnalyticsEvent, type AnalyticsEventAttributes, type AnalyticsTracker, type AnyExtensionDataMap, type AnyExtensionDataRef, type AnyExtensionInputMap, type AnyExternalRoutes, type AnyRouteRefParams, type AnyRoutes, ApiBlueprint, type AppNode, type AppNodeEdges, type AppNodeInstance, type AppNodeSpec, AppRootElementBlueprint, AppRootWrapperBlueprint, type AppTree, type AppTreeApi, type BackstagePlugin, type CommonAnalyticsContext, type ComponentRef, type ComponentsApi, type ConfigurableExtensionDataRef, type CoreErrorBoundaryFallbackProps, type CoreNotFoundErrorPageProps, type CoreProgressProps, type CreateExtensionBlueprintOptions, type CreateExtensionOptions, type Extension, type ExtensionBlueprint, ExtensionBoundary, type ExtensionBoundaryProps, type ExtensionDataContainer, type ExtensionDataRef, type ExtensionDataRefToValue, type ExtensionDataValue, type ExtensionDataValues, type ExtensionDefinition, type ExtensionInput, type ExtensionOverrides, type ExtensionOverridesOptions, type ExternalRouteRef, type FeatureFlagConfig, type FrontendFeature, IconBundleBlueprint, type IconComponent, type IconsApi, type LegacyCreateExtensionOptions, type LegacyExtensionInput, NavItemBlueprint, NavLogoBlueprint, 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, createApiExtension, createAppRootElementExtension, createAppRootWrapperExtension, createComponentExtension, createComponentRef, createExtension, createExtensionBlueprint, createExtensionDataRef, createExtensionInput, createExtensionOverrides, createExternalRouteRef, createNavItemExtension, createNavLogoExtension, createPageExtension, createPlugin, createRouteRef, createRouterExtension, createSchemaFromZod, createSignInPageExtension, createSubRouteRef, createThemeExtension, createTranslationExtension, iconsApiRef, routeResolutionApiRef, useAnalytics, useComponentRef, useRouteRef, useRouteRefParams };
1390
+ 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 BackstagePlugin, type CommonAnalyticsContext, type ComponentRef, type ComponentsApi, type ConfigurableExtensionDataRef, type CoreErrorBoundaryFallbackProps, type CoreNotFoundErrorPageProps, type CoreProgressProps, type CreateExtensionBlueprintOptions, type CreateExtensionOptions, type Extension, type ExtensionBlueprint, type ExtensionBlueprintParameters, ExtensionBoundary, type ExtensionBoundaryProps, type ExtensionDataContainer, type ExtensionDataRef, type ExtensionDataRefToValue, type ExtensionDataValue, type ExtensionDefinition, type ExtensionDefinitionParameters, type ExtensionInput, type ExtensionOverrides, type ExtensionOverridesOptions, type ExternalRouteRef, type FeatureFlagConfig, type FrontendFeature, IconBundleBlueprint, type IconComponent, type IconsApi, NavItemBlueprint, NavLogoBlueprint, 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, createExtensionDataRef, createExtensionInput, createExtensionOverrides, createExternalRouteRef, createFrontendPlugin, createPlugin, createRouteRef, createSubRouteRef, iconsApiRef, routeResolutionApiRef, useAnalytics, useComponentRef, useRouteRef, useRouteRefParams };