@lwrjs/types 0.13.0-alpha.6 → 0.13.0-alpha.7

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.
package/build/index.d.ts CHANGED
@@ -624,6 +624,16 @@ export interface LwrStringBuilder {
624
624
  toString(): string;
625
625
  original: string;
626
626
  }
627
+ export interface DecisionTree<Artifact extends SiteArtifact> {
628
+ /**
629
+ * Insert an artifact into the tree based on a path of decisions
630
+ */
631
+ insert(siteArtifactId: string, artifact: Artifact, debug?: boolean, localeFallbacks?: Record<string, string[]>): void;
632
+ /**
633
+ * Retrieve an artifact from the tree based on a path of decisions
634
+ */
635
+ find(siteArtifactId: string | Partial<AbstractModuleId>, debug?: boolean, localeId?: string): Artifact | undefined;
636
+ }
627
637
  export interface SiteMetadata {
628
638
  /**
629
639
  * Get the path that all site metadata is relative to
@@ -655,6 +665,10 @@ export interface SiteMetadata {
655
665
  * @returns
656
666
  */
657
667
  persistSiteMetadata(): Promise<void>;
668
+ /**
669
+ * Get get decision tree to figure out the best site bundle to use.
670
+ */
671
+ getSiteBundlesDecisionTree(): DecisionTree<SiteBundle>;
658
672
  }
659
673
  export interface SiteBundles {
660
674
  bundles: Record<string, SiteBundle>;
@@ -2,15 +2,27 @@ import type { ServerData } from '../index';
2
2
  import type { RegisterLoaderHooks } from './loaderPlugins/loaderPlugins';
3
3
  import type { RegisterHandleStaleModuleHook } from './handleStaleModule/handleStaleModule';
4
4
  import type { AppMetadata } from './appMetadata/appMetadata';
5
- export interface DataServiceAPI {
5
+ export type ServerDataCallbackParams = {
6
6
  serverData: ServerData;
7
+ };
8
+ export interface ServerDataCallback {
9
+ (params: ServerDataCallbackParams): void | null;
7
10
  }
8
- export interface ServiceAPI extends DataServiceAPI {
11
+ interface RegisterServerDataCallback {
12
+ (hook: ServerDataCallback): void;
13
+ }
14
+ export interface ServiceAPI {
9
15
  addLoaderPlugin: NoOp | RegisterLoaderHooks;
10
16
  handleStaleModule: RegisterHandleStaleModuleHook;
17
+ addServerDataCallback: RegisterServerDataCallback;
11
18
  appMetadata: AppMetadata;
12
19
  }
20
+ export interface ServerServiceAPI {
21
+ addLoaderPlugin: NoOp | RegisterLoaderHooks;
22
+ addServerDataCallback: RegisterServerDataCallback;
23
+ }
13
24
  export interface NoOp {
14
25
  (): void;
15
26
  }
27
+ export {};
16
28
  //# sourceMappingURL=serviceAPI.d.ts.map
package/build/views.d.ts CHANGED
@@ -85,6 +85,7 @@ export interface LinkedViewDefinition {
85
85
  viewRecord: RenderedViewRecord;
86
86
  immutable: boolean;
87
87
  cache?: CacheResponse;
88
+ nonce?: string;
88
89
  }
89
90
  export interface ViewRequestQs {
90
91
  [key: string]: undefined | string | string[];
@@ -109,6 +110,7 @@ export interface ViewResponse {
109
110
  metadata?: {
110
111
  viewDefinition?: LinkedViewDefinition;
111
112
  };
113
+ locale?: string;
112
114
  }
113
115
  export type RouteHandlerViewResponse = ViewDefinitionResponse | ViewResponse;
114
116
  export interface ViewDefinitionResponse {
@@ -119,6 +121,7 @@ export interface ViewDefinitionResponse {
119
121
  cache?: CacheResponse;
120
122
  headers?: Record<string, string>;
121
123
  cookie?: 'wip';
124
+ locale?: string;
122
125
  }
123
126
  export interface ViewProvider {
124
127
  name: string;
@@ -175,11 +178,13 @@ export interface ViewPageContext {
175
178
  url: string;
176
179
  basePath?: string;
177
180
  locale?: string;
181
+ nonce?: string;
178
182
  }
179
183
  export type ViewModuleResourceContext = {
180
184
  isPreload?: boolean;
181
185
  isSSR?: boolean;
182
186
  async?: boolean;
187
+ nonce?: string;
183
188
  };
184
189
  export interface ViewRegistry {
185
190
  addViewProviders(providers: ViewProvider[]): void;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "build": "tsc -b"
9
9
  },
10
10
  "type": "module",
11
- "version": "0.13.0-alpha.6",
11
+ "version": "0.13.0-alpha.7",
12
12
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
13
13
  "repository": {
14
14
  "type": "git",
@@ -29,5 +29,5 @@
29
29
  "engines": {
30
30
  "node": ">=18.0.0"
31
31
  },
32
- "gitHead": "88d503249ff6b135416208763fae8a33b5e874de"
32
+ "gitHead": "4b77dea6ac8d473a4113ad7b345b3a37b0b8a3f8"
33
33
  }