@lwrjs/types 0.10.0-alpha.15 → 0.10.0-alpha.16

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/config.d.ts CHANGED
@@ -8,7 +8,7 @@ export interface View {
8
8
  }
9
9
  export interface LwrBaseRoute extends View {
10
10
  properties?: Record<string, any>;
11
- routeHandler?: string;
11
+ routeHandler?: ServiceConfig;
12
12
  cache?: CacheResponse;
13
13
  subRoutes?: string;
14
14
  }
@@ -18,12 +18,14 @@ export interface LwrRoute extends LwrBaseRoute {
18
18
  }
19
19
  export interface NormalizedLwrRoute extends LwrRoute {
20
20
  bootstrap: NormalizedLwrAppBootstrapConfig;
21
+ routeHandler?: ServiceEntry;
21
22
  }
22
23
  export interface LwrErrorRoute extends LwrBaseRoute {
23
24
  status: 404 | 500;
24
25
  }
25
26
  export interface NormalizedLwrErrorRoute extends LwrErrorRoute {
26
27
  bootstrap: NormalizedLwrAppBootstrapConfig;
28
+ routeHandler?: ServiceEntry;
27
29
  }
28
30
  export interface NormalizedLwrAppBootstrapConfig {
29
31
  autoBoot: boolean;
@@ -44,12 +46,15 @@ export interface LwrLockerConfig {
44
46
  clientOnly?: boolean;
45
47
  }
46
48
  export interface RouteHandlersConfig {
47
- [id: string]: string;
49
+ [id: string]: ServiceConfig;
50
+ }
51
+ export interface NormalizedRouteHandlersConfig {
52
+ [id: string]: ServiceEntry;
48
53
  }
49
54
  export interface LocalizedViewRequest extends ViewRequest {
50
55
  locale?: string;
51
56
  }
52
- export declare type RouteHandlerFunction = (viewRequest: LocalizedViewRequest, handlerContext: HandlerContext) => Promise<RouteHandlerViewResponse>;
57
+ export declare type RouteHandlerFunction = (viewRequest: LocalizedViewRequest, handlerContext: HandlerContext, routeHandlerOptions?: any) => Promise<RouteHandlerViewResponse>;
53
58
  export interface ResourcePaths {
54
59
  rootDir: string;
55
60
  assets: AssetConfig[];
@@ -59,7 +64,7 @@ export interface ResourcePaths {
59
64
  export declare type RouteHandlerView = Pick<View, 'contentTemplate' | 'layoutTemplate' | 'rootComponent'>;
60
65
  export interface RouteHandlerViewApi {
61
66
  hasViewResponse(view: RouteHandlerView, viewParams?: ViewParams, renderOptions?: RenderOptions): boolean;
62
- getViewResponse(view: RouteHandlerView, viewParams?: ViewParams, renderOptions?: RenderOptions): Promise<ViewResponse | undefined>;
67
+ getViewResponse(view: RouteHandlerView, viewParams?: ViewParams, renderOptions?: RenderOptions): Promise<ViewResponse>;
63
68
  }
64
69
  export interface HandlerContext extends ResourcePaths {
65
70
  route: LwrRoute | LwrErrorRoute;
@@ -115,6 +120,7 @@ export interface BuildOptions {
115
120
  export interface NormalizedLwrGlobalConfig extends Required<Omit<LwrGlobalConfig, 'lwc'>> {
116
121
  routes: NormalizedLwrRoute[];
117
122
  errorRoutes: NormalizedLwrErrorRoute[];
123
+ routeHandlers: NormalizedRouteHandlersConfig;
118
124
  assets: AssetConfig[];
119
125
  lwrVersion: string;
120
126
  amdLoader: string;
@@ -158,7 +164,7 @@ export interface Services {
158
164
  uriTransformers: ResolvedServiceEntry<UriTransformPlugin>[];
159
165
  }
160
166
  export interface RouteHandlers {
161
- [id: string]: RouteHandlerFunction;
167
+ [id: string]: [RouteHandlerFunction, any?];
162
168
  }
163
169
  interface AssetConfigCommon {
164
170
  urlPath: string;
package/build/index.d.ts CHANGED
@@ -466,6 +466,15 @@ export interface CompilerResult {
466
466
  export interface BundleFiles {
467
467
  [filename: string]: string;
468
468
  }
469
+ interface ImportMetaEnv {
470
+ [key: string]: any;
471
+ SSR: boolean;
472
+ }
473
+ declare global {
474
+ interface ImportMeta {
475
+ readonly env: ImportMetaEnv;
476
+ }
477
+ }
469
478
  export interface ClientBootstrapConfig {
470
479
  appId?: string;
471
480
  bootstrapModule: string;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "build": "tsc -b"
9
9
  },
10
10
  "type": "module",
11
- "version": "0.10.0-alpha.15",
11
+ "version": "0.10.0-alpha.16",
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": ">=16.0.0 <20"
31
31
  },
32
- "gitHead": "70557f63a46167c40cf1415f12af69f78ae402d6"
32
+ "gitHead": "c5a13d471330c0f738d0c783fd1b69f456c544bd"
33
33
  }