@lwrjs/types 0.11.0-alpha.13 → 0.11.0-alpha.15

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
@@ -119,7 +119,7 @@ export interface LwrGlobalConfig {
119
119
  type RequiredPick<T, K extends keyof T> = {
120
120
  [P in K]-?: T[P];
121
121
  };
122
- export type OnStartConfig = RequiredPick<LwrGlobalConfig, 'basePath' | 'i18n' | 'routes'>;
122
+ export type OnStartConfig = RequiredPick<LwrGlobalConfig, 'basePath' | 'i18n' | 'routes' | 'errorRoutes'>;
123
123
  export interface BuildOptions {
124
124
  target?: string;
125
125
  input?: string;
package/build/index.d.ts CHANGED
@@ -157,7 +157,7 @@ export interface ServerModeConfig {
157
157
  compat: CompatMode;
158
158
  watchFiles: boolean;
159
159
  debug: boolean;
160
- defaultLocale: string;
160
+ i18n: I18NConfig;
161
161
  hmrEnabled: boolean;
162
162
  immutableAssets: boolean;
163
163
  env: {
@@ -488,6 +488,9 @@ declare global {
488
488
  readonly env: ImportMetaEnv;
489
489
  }
490
490
  }
491
+ export type ServerData = {
492
+ [prop: string]: Json;
493
+ };
491
494
  export interface ClientBootstrapConfig {
492
495
  appId?: string;
493
496
  bootstrapModule: string;
@@ -496,7 +499,7 @@ export interface ClientBootstrapConfig {
496
499
  preloadModules?: string[];
497
500
  rootComponent?: string;
498
501
  rootComponents?: string[];
499
- serverData?: Json;
502
+ serverData?: ServerData;
500
503
  customInit?: Function;
501
504
  onError?: Function;
502
505
  baseUrl?: string;
package/build/server.d.ts CHANGED
@@ -4,7 +4,7 @@ import type { Application as ExpressApp } from 'express';
4
4
  import type { default as Koa, Context } from 'koa';
5
5
  import type http from 'http';
6
6
  import type { Readable } from 'stream';
7
- import type { I18NConfig, NormalizedLwrGlobalConfig, RuntimeContext, RuntimeEnvironment } from './index.js';
7
+ import type { NormalizedLwrGlobalConfig, RuntimeContext, RuntimeEnvironment } from './index.js';
8
8
  export type ServerTypes = 'koa' | 'express' | 'fs';
9
9
  export type ServerTypeImpl<T extends ServerTypes> = T extends 'koa' ? Koa : T extends 'express' ? ExpressApp : T extends 'fs' ? LwrDispatcher : never;
10
10
  export interface FsContext extends Context {
@@ -85,7 +85,7 @@ export interface MiddlewareRequest {
85
85
  /**
86
86
  * Use the request parameters to resolve the runtime context(ie. environment and parameters)
87
87
  */
88
- getRuntimeContext(defaultRuntimeEnvironment: RuntimeEnvironment, i18n: I18NConfig): RuntimeContext;
88
+ getRuntimeContext(defaultRuntimeEnvironment: RuntimeEnvironment): RuntimeContext;
89
89
  }
90
90
  export interface MiddlewareResponse {
91
91
  set(header: any): void;
@@ -1,7 +1,11 @@
1
+ import type { ServerData } from '../index';
1
2
  import type { RegisterLoaderHooks } from './loaderPlugins/loaderPlugins';
2
3
  import type { RegisterHandleStaleModuleHook } from './handleStaleModule/handleStaleModule';
3
4
  import type { AppMetadata } from './appMetadata/appMetadata';
4
- export interface ServiceAPI {
5
+ export interface DataServiceAPI {
6
+ serverData: ServerData;
7
+ }
8
+ export interface ServiceAPI extends DataServiceAPI {
5
9
  addLoaderPlugin: NoOp | RegisterLoaderHooks;
6
10
  handleStaleModule: RegisterHandleStaleModuleHook;
7
11
  appMetadata: AppMetadata;
package/build/views.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { LwrErrorRoute, LwrRoute, RouteHandlerFunction, RouteHandlerView, View } from './config.js';
3
- import type { AssetSource, UriDefinition, Endpoints, FlattenedModuleGraphs, ImportMetadata, Json, LwrStringBuilder, ResourceDefinition, RuntimeEnvironment, RuntimeParams, Specifier } from './index.js';
3
+ import type { AssetSource, UriDefinition, Endpoints, FlattenedModuleGraphs, ImportMetadata, Json, LwrStringBuilder, ResourceDefinition, RuntimeEnvironment, RuntimeParams, Specifier, ServerData } from './index.js';
4
4
  export type ViewIdentity = Pick<View, 'id' | 'rootComponent' | 'contentTemplate'>;
5
5
  export interface ViewSource {
6
6
  name: string;
@@ -44,9 +44,7 @@ export interface CustomElementReference {
44
44
  export interface RenderedViewMetadata {
45
45
  customElements: CustomElementReference[];
46
46
  assetReferences: AssetReference[];
47
- serverData?: {
48
- [prop: string]: Json;
49
- };
47
+ serverData?: ServerData;
50
48
  serverDebug?: {
51
49
  message?: string;
52
50
  };
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "build": "tsc -b"
9
9
  },
10
10
  "type": "module",
11
- "version": "0.11.0-alpha.13",
11
+ "version": "0.11.0-alpha.15",
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"
31
31
  },
32
- "gitHead": "101ac765e89de3b378b4c049cdeb0cfc635ae22a"
32
+ "gitHead": "3c6c6d17b2f57a5b67d32e40a1e574abb7d9afea"
33
33
  }