@lwrjs/types 0.8.0-alpha.0 → 0.8.0-alpha.10

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
@@ -32,7 +32,7 @@ export interface LwrAppBootstrapConfig {
32
32
  };
33
33
  services?: string[];
34
34
  configAsSrc?: boolean;
35
- experimentalSSR?: boolean;
35
+ ssr?: boolean;
36
36
  }
37
37
  export declare type NormalizedLwrAppBootstrapConfig = Required<LwrAppBootstrapConfig>;
38
38
  export interface LwrLockerConfig {
package/build/index.d.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
5
+ /// <reference types="node" />
2
6
  import { EventEmitter } from 'events';
3
7
  import fs from 'fs';
4
8
  import { Server } from 'http';
5
9
  import { Readable } from 'stream';
6
10
  import { BundleConfig, EnvironmentConfig, HooksPlugin, LwrLockerConfig, NormalizedLwrErrorRoute, NormalizedLwrGlobalConfig, NormalizedLwrRoute, ResolverModuleRecord } from './config.js';
7
11
  import { AssetReference, CompiledView, PublicViewRegistry, ViewProvider, ViewRegistry, ViewTransformPlugin } from './views.js';
12
+ export * from './lwr-shim.js';
8
13
  export * from './config.js';
9
14
  export * from './server.js';
10
15
  export * from './views.js';
@@ -323,6 +328,7 @@ export interface ResourceDefinition {
323
328
  src?: string;
324
329
  inline?: boolean;
325
330
  async?: boolean;
331
+ defer?: boolean;
326
332
  nonce?: string;
327
333
  content?: string;
328
334
  stream?: Readable;
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './lwr-shim.js';
1
2
  export * from './config.js';
2
3
  export * from './server.js';
3
4
  export * from './views.js';
@@ -0,0 +1,16 @@
1
+ import { AssetProvider, HooksPlugin, ModuleProvider, ProviderContext, ResourceProvider, ViewProvider, ViewTransformPlugin } from './index';
2
+ interface LwrShim {
3
+ LWC_VERSION: string;
4
+ LWR_VERSION: string;
5
+ getAssetProviders(context: Partial<ProviderContext>): AssetProvider[];
6
+ getHooks(): HooksPlugin[];
7
+ getModuleProviders(context: Partial<ProviderContext>): ModuleProvider[];
8
+ getResourceProviders(context: Partial<ProviderContext>): ResourceProvider[];
9
+ getViewProviders(context: Partial<ProviderContext>): ViewProvider[];
10
+ getViewTransformers(context: Partial<ProviderContext>): ViewTransformPlugin[];
11
+ }
12
+ declare global {
13
+ const LWR: LwrShim | undefined;
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=lwr-shim.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=lwr-shim.js.map
package/build/server.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { Application as ExpressApp } from 'express';
3
4
  import Koa, { Context } from 'koa';
4
5
  import http from 'http';
5
- import http2 from 'http2';
6
6
  import { Readable } from 'stream';
7
7
  import { RuntimeContext, RuntimeEnvironment } from './index';
8
8
  export declare type ServerTypes = 'koa' | 'express' | 'fs';
@@ -27,7 +27,6 @@ export interface InternalAppServer<T extends ServerTypes> {
27
27
  getImpl(): ServerTypeImpl<T>;
28
28
  getInternalRequestKey(): string;
29
29
  createHttpServer(): http.Server;
30
- createHttp2Server(): http2.Http2Server;
31
30
  use(middleware: MiddlewareFunction): void;
32
31
  all(path: string | Array<string>, middleware: MiddlewareFunction): void;
33
32
  get(path: string | Array<string>, middleware: MiddlewareFunction): void;
package/build/views.d.ts CHANGED
@@ -166,6 +166,11 @@ export interface ViewPageContext {
166
166
  title?: string;
167
167
  url: string;
168
168
  }
169
+ export declare type ViewModuleResourceContext = {
170
+ isPreload?: boolean;
171
+ isSSR?: boolean;
172
+ async?: boolean;
173
+ };
169
174
  export interface ViewRegistry {
170
175
  addViewProviders(providers: ViewProvider[]): void;
171
176
  initializeViewProviders(): Promise<void[]>;
@@ -175,7 +180,7 @@ export interface ViewRegistry {
175
180
  getPublicApi(): PublicViewRegistry;
176
181
  }
177
182
  export declare type PublicViewRegistry = Pick<ViewRegistry, 'getView' | 'getViewDefinition'>;
178
- export interface PropsRequestContext {
183
+ export interface SsrRequestContext {
179
184
  props: Json;
180
185
  params: {
181
186
  [key: string]: string;
@@ -184,10 +189,17 @@ export interface PropsRequestContext {
184
189
  [key: string]: string;
185
190
  };
186
191
  locale: string;
187
- fetch: Function;
188
192
  }
189
- export interface PropsResponse {
190
- props: Json;
193
+ export interface PageDataResponse {
194
+ props?: Json;
195
+ markup?: {
196
+ links?: {
197
+ href: string;
198
+ as?: string;
199
+ rel?: string;
200
+ fetchpriority?: 'high' | 'low' | 'auto';
201
+ }[];
202
+ };
191
203
  }
192
204
  export {};
193
205
  //# sourceMappingURL=views.d.ts.map
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "build": "tsc -b"
9
9
  },
10
10
  "type": "module",
11
- "version": "0.8.0-alpha.0",
11
+ "version": "0.8.0-alpha.10",
12
12
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
13
13
  "repository": {
14
14
  "type": "git",
@@ -18,7 +18,6 @@
18
18
  "bugs": {
19
19
  "url": "https://github.com/salesforce/lwr/issues"
20
20
  },
21
- "types": "build/index.d.ts",
22
21
  "main": "build/index.js",
23
22
  "files": [
24
23
  "build/**/*.js",
@@ -27,5 +26,5 @@
27
26
  "engines": {
28
27
  "node": ">=14.15.4 <19"
29
28
  },
30
- "gitHead": "2e1f60ed13f9f8079f1333af9b614cd24715f3ad"
29
+ "gitHead": "55922351f484d77784d86ef7b03ebe788fa3e12c"
31
30
  }