@lwrjs/types 0.13.0-alpha.6 → 0.13.0-alpha.8
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 +19 -0
- package/build/serviceAPI/serviceAPI.d.ts +14 -2
- package/build/views.d.ts +5 -0
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -373,6 +373,7 @@ export interface ResourceDefinition {
|
|
|
373
373
|
content?: string;
|
|
374
374
|
stream?: () => Readable;
|
|
375
375
|
isPreload?: boolean;
|
|
376
|
+
version?: string;
|
|
376
377
|
}
|
|
377
378
|
export interface AssetMetadata {
|
|
378
379
|
assetReferences?: AssetReference[];
|
|
@@ -624,6 +625,16 @@ export interface LwrStringBuilder {
|
|
|
624
625
|
toString(): string;
|
|
625
626
|
original: string;
|
|
626
627
|
}
|
|
628
|
+
export interface DecisionTree<Artifact extends SiteArtifact> {
|
|
629
|
+
/**
|
|
630
|
+
* Insert an artifact into the tree based on a path of decisions
|
|
631
|
+
*/
|
|
632
|
+
insert(siteArtifactId: string, artifact: Artifact, debug?: boolean, localeFallbacks?: Record<string, string[]>): void;
|
|
633
|
+
/**
|
|
634
|
+
* Retrieve an artifact from the tree based on a path of decisions
|
|
635
|
+
*/
|
|
636
|
+
find(siteArtifactId: string | Partial<AbstractModuleId>, debug?: boolean, localeId?: string): Artifact | undefined;
|
|
637
|
+
}
|
|
627
638
|
export interface SiteMetadata {
|
|
628
639
|
/**
|
|
629
640
|
* Get the path that all site metadata is relative to
|
|
@@ -655,6 +666,14 @@ export interface SiteMetadata {
|
|
|
655
666
|
* @returns
|
|
656
667
|
*/
|
|
657
668
|
persistSiteMetadata(): Promise<void>;
|
|
669
|
+
/**
|
|
670
|
+
* Get get decision tree to figure out the best site bundle to use.
|
|
671
|
+
*/
|
|
672
|
+
getSiteBundlesDecisionTree(): DecisionTree<SiteBundle>;
|
|
673
|
+
/**
|
|
674
|
+
* Get get decision tree to figure out the best site resource to use.
|
|
675
|
+
*/
|
|
676
|
+
getSiteResourcesDecisionTree(): DecisionTree<SiteResource>;
|
|
658
677
|
}
|
|
659
678
|
export interface SiteBundles {
|
|
660
679
|
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
|
|
5
|
+
export type ServerDataCallbackParams = {
|
|
6
6
|
serverData: ServerData;
|
|
7
|
+
};
|
|
8
|
+
export interface ServerDataCallback {
|
|
9
|
+
(params: ServerDataCallbackParams): void | null;
|
|
7
10
|
}
|
|
8
|
-
|
|
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.
|
|
11
|
+
"version": "0.13.0-alpha.8",
|
|
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": "
|
|
32
|
+
"gitHead": "91e731eae1457bbbebeb274fa0ea5574705c51a2"
|
|
33
33
|
}
|