@finesoft/front 0.1.2 → 0.1.3
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/dist/index.cjs +79 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +84 -519
- package/dist/index.d.ts +84 -519
- package/dist/index.js +76 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -9,35 +9,35 @@ import { ViteDevServer } from 'vite';
|
|
|
9
9
|
* CompoundAction — 组合多个 Action
|
|
10
10
|
*/
|
|
11
11
|
/** Action Kind 常量 */
|
|
12
|
-
declare const ACTION_KINDS
|
|
12
|
+
declare const ACTION_KINDS: {
|
|
13
13
|
FLOW: "flow";
|
|
14
14
|
EXTERNAL_URL: "externalUrl";
|
|
15
15
|
COMPOUND: "compound";
|
|
16
16
|
};
|
|
17
17
|
/** FlowAction — SPA 导航 */
|
|
18
|
-
interface FlowAction
|
|
19
|
-
kind: typeof ACTION_KINDS
|
|
18
|
+
interface FlowAction {
|
|
19
|
+
kind: typeof ACTION_KINDS.FLOW;
|
|
20
20
|
url: string;
|
|
21
21
|
/** 展示方式: 默认 push,modal 弹窗 */
|
|
22
22
|
presentationContext?: "default" | "modal";
|
|
23
23
|
}
|
|
24
24
|
/** ExternalUrlAction — 外部链接 */
|
|
25
|
-
interface ExternalUrlAction
|
|
26
|
-
kind: typeof ACTION_KINDS
|
|
25
|
+
interface ExternalUrlAction {
|
|
26
|
+
kind: typeof ACTION_KINDS.EXTERNAL_URL;
|
|
27
27
|
url: string;
|
|
28
28
|
}
|
|
29
29
|
/** CompoundAction — 组合 Action */
|
|
30
|
-
interface CompoundAction
|
|
31
|
-
kind: typeof ACTION_KINDS
|
|
32
|
-
actions: Action
|
|
30
|
+
interface CompoundAction {
|
|
31
|
+
kind: typeof ACTION_KINDS.COMPOUND;
|
|
32
|
+
actions: Action[];
|
|
33
33
|
}
|
|
34
34
|
/** 所有 Action 的联合类型 */
|
|
35
|
-
type Action
|
|
36
|
-
declare function isFlowAction(action: Action
|
|
37
|
-
declare function isExternalUrlAction(action: Action
|
|
38
|
-
declare function isCompoundAction(action: Action
|
|
39
|
-
declare function makeFlowAction(url: string, presentationContext?: FlowAction
|
|
40
|
-
declare function makeExternalUrlAction(url: string): ExternalUrlAction
|
|
35
|
+
type Action = FlowAction | ExternalUrlAction | CompoundAction;
|
|
36
|
+
declare function isFlowAction(action: Action): action is FlowAction;
|
|
37
|
+
declare function isExternalUrlAction(action: Action): action is ExternalUrlAction;
|
|
38
|
+
declare function isCompoundAction(action: Action): action is CompoundAction;
|
|
39
|
+
declare function makeFlowAction(url: string, presentationContext?: FlowAction["presentationContext"]): FlowAction;
|
|
40
|
+
declare function makeExternalUrlAction(url: string): ExternalUrlAction;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* ActionDispatcher — Action 分发器
|
|
@@ -47,24 +47,24 @@ declare function makeExternalUrlAction(url: string): ExternalUrlAction$2;
|
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
49
|
/** Action 处理器函数类型 */
|
|
50
|
-
type ActionHandler
|
|
51
|
-
declare class ActionDispatcher
|
|
50
|
+
type ActionHandler<A extends Action = Action> = (action: A) => Promise<void> | void;
|
|
51
|
+
declare class ActionDispatcher {
|
|
52
52
|
private handlers;
|
|
53
53
|
private wiredActions;
|
|
54
54
|
/** 注册指定 kind 的 handler(防止重复注册) */
|
|
55
|
-
onAction<A extends Action
|
|
55
|
+
onAction<A extends Action>(kind: string, handler: ActionHandler<A>): void;
|
|
56
56
|
/** 执行一个 Action(CompoundAction 递归展开) */
|
|
57
|
-
perform(action: Action
|
|
57
|
+
perform(action: Action): Promise<void>;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Container — 通用的依赖注入容器
|
|
62
62
|
*/
|
|
63
|
-
type Factory
|
|
64
|
-
declare class Container
|
|
63
|
+
type Factory<T> = () => T;
|
|
64
|
+
declare class Container {
|
|
65
65
|
private registrations;
|
|
66
66
|
/** 注册依赖(默认单例) */
|
|
67
|
-
register<T>(key: string, factory: Factory
|
|
67
|
+
register<T>(key: string, factory: Factory<T>, singleton?: boolean): this;
|
|
68
68
|
/** 解析依赖 */
|
|
69
69
|
resolve<T>(key: string): T;
|
|
70
70
|
/** 检查是否已注册 */
|
|
@@ -78,7 +78,7 @@ declare class Container$2 {
|
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
80
|
/** Intent — 描述一个用户意图 */
|
|
81
|
-
interface Intent
|
|
81
|
+
interface Intent<T = unknown> {
|
|
82
82
|
/** Intent 标识符(用于匹配 Controller) */
|
|
83
83
|
id: string;
|
|
84
84
|
/** 意图参数 */
|
|
@@ -87,11 +87,11 @@ interface Intent$2<T = unknown> {
|
|
|
87
87
|
_returnType?: T;
|
|
88
88
|
}
|
|
89
89
|
/** Intent Controller — 处理特定 intentId 的业务逻辑 */
|
|
90
|
-
interface IntentController
|
|
90
|
+
interface IntentController<T = unknown> {
|
|
91
91
|
/** Controller 对应的 Intent ID */
|
|
92
92
|
intentId: string;
|
|
93
93
|
/** 执行意图,返回页面数据 */
|
|
94
|
-
perform(intent: Intent
|
|
94
|
+
perform(intent: Intent<T>, container: Container): Promise<T> | T;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
@@ -100,12 +100,12 @@ interface IntentController$2<T = unknown> {
|
|
|
100
100
|
* 注册 IntentController,按 intentId 分发。
|
|
101
101
|
*/
|
|
102
102
|
|
|
103
|
-
declare class IntentDispatcher
|
|
103
|
+
declare class IntentDispatcher {
|
|
104
104
|
private controllers;
|
|
105
105
|
/** 注册一个 IntentController */
|
|
106
|
-
register(controller: IntentController
|
|
106
|
+
register(controller: IntentController): void;
|
|
107
107
|
/** 分发 Intent 到对应 Controller */
|
|
108
|
-
dispatch<T>(intent: Intent
|
|
108
|
+
dispatch<T>(intent: Intent<T>, container: Container): Promise<T>;
|
|
109
109
|
/** 检查是否已注册某个 Intent */
|
|
110
110
|
has(intentId: string): boolean;
|
|
111
111
|
}
|
|
@@ -117,14 +117,14 @@ type Level = "debug" | "info" | "warn" | "error";
|
|
|
117
117
|
*
|
|
118
118
|
* 所有方法返回空字符串,允许在模板中内联使用而不渲染文本。
|
|
119
119
|
*/
|
|
120
|
-
interface Logger
|
|
120
|
+
interface Logger {
|
|
121
121
|
debug(...args: unknown[]): string;
|
|
122
122
|
info(...args: unknown[]): string;
|
|
123
123
|
warn(...args: unknown[]): string;
|
|
124
124
|
error(...args: unknown[]): string;
|
|
125
125
|
}
|
|
126
126
|
interface LoggerFactory {
|
|
127
|
-
loggerFor(category: string): Logger
|
|
127
|
+
loggerFor(category: string): Logger;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
@@ -168,29 +168,29 @@ declare const DEP_KEYS: {
|
|
|
168
168
|
readonly METRICS: "metrics";
|
|
169
169
|
readonly FETCH: "fetch";
|
|
170
170
|
};
|
|
171
|
-
interface MakeDependenciesOptions
|
|
171
|
+
interface MakeDependenciesOptions {
|
|
172
172
|
fetch?: typeof globalThis.fetch;
|
|
173
173
|
language?: string;
|
|
174
174
|
storefront?: string;
|
|
175
175
|
featureFlags?: Record<string, boolean | string | number>;
|
|
176
176
|
}
|
|
177
|
-
declare function makeDependencies(container: Container
|
|
177
|
+
declare function makeDependencies(container: Container, options?: MakeDependenciesOptions): void;
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
180
|
* URL 路由器 — URL pattern → Intent + FlowAction
|
|
181
181
|
*/
|
|
182
182
|
|
|
183
183
|
/** 路由匹配结果 */
|
|
184
|
-
interface RouteMatch
|
|
185
|
-
intent: Intent
|
|
186
|
-
action: FlowAction
|
|
184
|
+
interface RouteMatch {
|
|
185
|
+
intent: Intent;
|
|
186
|
+
action: FlowAction;
|
|
187
187
|
}
|
|
188
|
-
declare class Router
|
|
188
|
+
declare class Router {
|
|
189
189
|
private routes;
|
|
190
190
|
/** 添加路由规则 */
|
|
191
191
|
add(pattern: string, intentId: string): this;
|
|
192
192
|
/** 解析 URL → RouteMatch */
|
|
193
|
-
resolve(urlOrPath: string): RouteMatch
|
|
193
|
+
resolve(urlOrPath: string): RouteMatch | null;
|
|
194
194
|
/** 获取所有已注册的路由 */
|
|
195
195
|
getRoutes(): string[];
|
|
196
196
|
private extractPath;
|
|
@@ -201,7 +201,7 @@ declare class Router$2 {
|
|
|
201
201
|
* BaseLogger — 抽象日志基类
|
|
202
202
|
*/
|
|
203
203
|
|
|
204
|
-
declare abstract class BaseLogger implements Logger
|
|
204
|
+
declare abstract class BaseLogger implements Logger {
|
|
205
205
|
protected category: string;
|
|
206
206
|
constructor(category: string);
|
|
207
207
|
abstract debug(...args: unknown[]): string;
|
|
@@ -217,11 +217,11 @@ declare abstract class BaseLogger implements Logger$1 {
|
|
|
217
217
|
declare class CompositeLoggerFactory implements LoggerFactory {
|
|
218
218
|
private readonly factories;
|
|
219
219
|
constructor(factories: LoggerFactory[]);
|
|
220
|
-
loggerFor(name: string): Logger
|
|
220
|
+
loggerFor(name: string): Logger;
|
|
221
221
|
}
|
|
222
|
-
declare class CompositeLogger implements Logger
|
|
222
|
+
declare class CompositeLogger implements Logger {
|
|
223
223
|
private readonly loggers;
|
|
224
|
-
constructor(loggers: Logger
|
|
224
|
+
constructor(loggers: Logger[]);
|
|
225
225
|
debug(...args: unknown[]): string;
|
|
226
226
|
info(...args: unknown[]): string;
|
|
227
227
|
warn(...args: unknown[]): string;
|
|
@@ -240,7 +240,7 @@ declare class ConsoleLogger extends BaseLogger {
|
|
|
240
240
|
error(...args: unknown[]): string;
|
|
241
241
|
}
|
|
242
242
|
declare class ConsoleLoggerFactory implements LoggerFactory {
|
|
243
|
-
loggerFor(category: string): Logger
|
|
243
|
+
loggerFor(category: string): Logger;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
/**
|
|
@@ -260,7 +260,7 @@ declare function resetFilterCache(): void;
|
|
|
260
260
|
*
|
|
261
261
|
* 具体页面类型由应用层定义并扩展此接口。
|
|
262
262
|
*/
|
|
263
|
-
interface BasePage
|
|
263
|
+
interface BasePage {
|
|
264
264
|
id: string;
|
|
265
265
|
pageType: string;
|
|
266
266
|
title: string;
|
|
@@ -277,24 +277,24 @@ interface BasePage$2 {
|
|
|
277
277
|
*/
|
|
278
278
|
|
|
279
279
|
/** 预获取的 Intent-Data 对 */
|
|
280
|
-
interface PrefetchedIntent
|
|
281
|
-
intent: Intent
|
|
280
|
+
interface PrefetchedIntent {
|
|
281
|
+
intent: Intent;
|
|
282
282
|
data: unknown;
|
|
283
283
|
}
|
|
284
|
-
declare class PrefetchedIntents
|
|
284
|
+
declare class PrefetchedIntents {
|
|
285
285
|
private intents;
|
|
286
286
|
private constructor();
|
|
287
287
|
/** 从 PrefetchedIntent 数组创建缓存实例 */
|
|
288
|
-
static fromArray(items: PrefetchedIntent
|
|
288
|
+
static fromArray(items: PrefetchedIntent[]): PrefetchedIntents;
|
|
289
289
|
/** 创建空缓存实例 */
|
|
290
|
-
static empty(): PrefetchedIntents
|
|
290
|
+
static empty(): PrefetchedIntents;
|
|
291
291
|
/**
|
|
292
292
|
* 获取缓存的 Intent 结果(一次性使用)。
|
|
293
293
|
* 命中后从缓存中删除。
|
|
294
294
|
*/
|
|
295
|
-
get<T>(intent: Intent
|
|
295
|
+
get<T>(intent: Intent<T>): T | undefined;
|
|
296
296
|
/** 检查缓存中是否有某个 Intent 的数据 */
|
|
297
|
-
has(intent: Intent
|
|
297
|
+
has(intent: Intent): boolean;
|
|
298
298
|
/** 缓存中的条目数 */
|
|
299
299
|
get size(): number;
|
|
300
300
|
}
|
|
@@ -307,31 +307,31 @@ declare class PrefetchedIntents$2 {
|
|
|
307
307
|
*/
|
|
308
308
|
|
|
309
309
|
/** Framework 初始化配置 */
|
|
310
|
-
interface FrameworkConfig
|
|
311
|
-
setupRoutes?: (router: Router
|
|
312
|
-
prefetchedIntents?: PrefetchedIntents
|
|
310
|
+
interface FrameworkConfig extends MakeDependenciesOptions {
|
|
311
|
+
setupRoutes?: (router: Router) => void;
|
|
312
|
+
prefetchedIntents?: PrefetchedIntents;
|
|
313
313
|
}
|
|
314
|
-
declare class Framework
|
|
315
|
-
readonly container: Container
|
|
316
|
-
readonly intentDispatcher: IntentDispatcher
|
|
317
|
-
readonly actionDispatcher: ActionDispatcher
|
|
318
|
-
readonly router: Router
|
|
319
|
-
readonly prefetchedIntents: PrefetchedIntents
|
|
314
|
+
declare class Framework {
|
|
315
|
+
readonly container: Container;
|
|
316
|
+
readonly intentDispatcher: IntentDispatcher;
|
|
317
|
+
readonly actionDispatcher: ActionDispatcher;
|
|
318
|
+
readonly router: Router;
|
|
319
|
+
readonly prefetchedIntents: PrefetchedIntents;
|
|
320
320
|
private constructor();
|
|
321
321
|
/** 创建并初始化 Framework 实例 */
|
|
322
|
-
static create(config?: FrameworkConfig
|
|
322
|
+
static create(config?: FrameworkConfig): Framework;
|
|
323
323
|
/** 分发 Intent — 获取页面数据 */
|
|
324
|
-
dispatch<T>(intent: Intent
|
|
324
|
+
dispatch<T>(intent: Intent<T>): Promise<T>;
|
|
325
325
|
/** 执行 Action — 处理用户交互 */
|
|
326
|
-
perform(action: Action
|
|
326
|
+
perform(action: Action): Promise<void>;
|
|
327
327
|
/** 路由 URL — 将 URL 解析为 Intent + Action */
|
|
328
|
-
routeUrl(url: string): RouteMatch
|
|
328
|
+
routeUrl(url: string): RouteMatch | null;
|
|
329
329
|
/** 记录页面访问事件 */
|
|
330
|
-
didEnterPage(page: BasePage
|
|
330
|
+
didEnterPage(page: BasePage): void;
|
|
331
331
|
/** 注册 Action 处理器 */
|
|
332
|
-
onAction<A extends Action
|
|
332
|
+
onAction<A extends Action>(kind: string, handler: ActionHandler<A>): void;
|
|
333
333
|
/** 注册 Intent Controller */
|
|
334
|
-
registerIntent(controller: IntentController
|
|
334
|
+
registerIntent(controller: IntentController): void;
|
|
335
335
|
/** 销毁 Framework 实例 */
|
|
336
336
|
dispose(): void;
|
|
337
337
|
}
|
|
@@ -347,13 +347,13 @@ interface BaseShelf {
|
|
|
347
347
|
shelfType: string;
|
|
348
348
|
title?: string;
|
|
349
349
|
subtitle?: string;
|
|
350
|
-
seeAllAction?: Action
|
|
350
|
+
seeAllAction?: Action;
|
|
351
351
|
isHorizontal?: boolean;
|
|
352
352
|
}
|
|
353
353
|
interface BaseItem {
|
|
354
354
|
id: string;
|
|
355
355
|
itemType: string;
|
|
356
|
-
clickAction?: Action
|
|
356
|
+
clickAction?: Action;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
/**
|
|
@@ -462,7 +462,7 @@ declare abstract class HttpClient {
|
|
|
462
462
|
* }
|
|
463
463
|
* ```
|
|
464
464
|
*/
|
|
465
|
-
declare abstract class BaseController<TParams extends Record<string, string | undefined> = Record<string, string>, TResult = unknown> implements IntentController
|
|
465
|
+
declare abstract class BaseController<TParams extends Record<string, string | undefined> = Record<string, string>, TResult = unknown> implements IntentController<TResult> {
|
|
466
466
|
/** Controller 对应的 Intent ID */
|
|
467
467
|
abstract readonly intentId: string;
|
|
468
468
|
/**
|
|
@@ -472,7 +472,7 @@ declare abstract class BaseController<TParams extends Record<string, string | un
|
|
|
472
472
|
* @param container - DI 容器
|
|
473
473
|
* @returns 页面数据
|
|
474
474
|
*/
|
|
475
|
-
abstract execute(params: TParams, container: Container
|
|
475
|
+
abstract execute(params: TParams, container: Container): Promise<TResult> | TResult;
|
|
476
476
|
/**
|
|
477
477
|
* 错误回退 — 子类可选覆写
|
|
478
478
|
*
|
|
@@ -489,7 +489,7 @@ declare abstract class BaseController<TParams extends Record<string, string | un
|
|
|
489
489
|
*
|
|
490
490
|
* 自动 try/catch → fallback 模式。
|
|
491
491
|
*/
|
|
492
|
-
perform(intent: Intent
|
|
492
|
+
perform(intent: Intent<TResult>, container: Container): Promise<TResult>;
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
/**
|
|
@@ -547,7 +547,7 @@ interface RouteDefinition {
|
|
|
547
547
|
* Controller 实例(可选)。
|
|
548
548
|
* 同一个 intentId 的多条路由只需在第一条提供 controller。
|
|
549
549
|
*/
|
|
550
|
-
controller?: IntentController
|
|
550
|
+
controller?: IntentController;
|
|
551
551
|
}
|
|
552
552
|
/**
|
|
553
553
|
* 声明式注册路由和 Controller
|
|
@@ -566,7 +566,7 @@ interface RouteDefinition {
|
|
|
566
566
|
* ]);
|
|
567
567
|
* ```
|
|
568
568
|
*/
|
|
569
|
-
declare function defineRoutes(framework: Framework
|
|
569
|
+
declare function defineRoutes(framework: Framework, definitions: RouteDefinition[]): void;
|
|
570
570
|
|
|
571
571
|
/**
|
|
572
572
|
* LruMap — 固定容量的 LRU 缓存
|
|
@@ -610,235 +610,12 @@ declare function buildUrl(path: string, params?: Record<string, string | undefin
|
|
|
610
610
|
*/
|
|
611
611
|
declare function generateUuid(): string;
|
|
612
612
|
|
|
613
|
-
/**
|
|
614
|
-
* Action 类型定义
|
|
615
|
-
*
|
|
616
|
-
* FlowAction — SPA 内部导航
|
|
617
|
-
* ExternalUrlAction — 打开外部链接
|
|
618
|
-
* CompoundAction — 组合多个 Action
|
|
619
|
-
*/
|
|
620
|
-
/** Action Kind 常量 */
|
|
621
|
-
declare const ACTION_KINDS$1: {
|
|
622
|
-
FLOW: "flow";
|
|
623
|
-
EXTERNAL_URL: "externalUrl";
|
|
624
|
-
COMPOUND: "compound";
|
|
625
|
-
};
|
|
626
|
-
/** FlowAction — SPA 导航 */
|
|
627
|
-
interface FlowAction$1 {
|
|
628
|
-
kind: typeof ACTION_KINDS$1.FLOW;
|
|
629
|
-
url: string;
|
|
630
|
-
/** 展示方式: 默认 push,modal 弹窗 */
|
|
631
|
-
presentationContext?: "default" | "modal";
|
|
632
|
-
}
|
|
633
|
-
/** ExternalUrlAction — 外部链接 */
|
|
634
|
-
interface ExternalUrlAction$1 {
|
|
635
|
-
kind: typeof ACTION_KINDS$1.EXTERNAL_URL;
|
|
636
|
-
url: string;
|
|
637
|
-
}
|
|
638
|
-
/** CompoundAction — 组合 Action */
|
|
639
|
-
interface CompoundAction$1 {
|
|
640
|
-
kind: typeof ACTION_KINDS$1.COMPOUND;
|
|
641
|
-
actions: Action$1[];
|
|
642
|
-
}
|
|
643
|
-
/** 所有 Action 的联合类型 */
|
|
644
|
-
type Action$1 = FlowAction$1 | ExternalUrlAction$1 | CompoundAction$1;
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* ActionDispatcher — Action 分发器
|
|
648
|
-
*
|
|
649
|
-
* 注册不同 kind 的 handler,按类型分发。
|
|
650
|
-
* CompoundAction 自动展开递归执行。
|
|
651
|
-
*/
|
|
652
|
-
|
|
653
|
-
/** Action 处理器函数类型 */
|
|
654
|
-
type ActionHandler$1<A extends Action$1 = Action$1> = (action: A) => Promise<void> | void;
|
|
655
|
-
declare class ActionDispatcher$1 {
|
|
656
|
-
private handlers;
|
|
657
|
-
private wiredActions;
|
|
658
|
-
/** 注册指定 kind 的 handler(防止重复注册) */
|
|
659
|
-
onAction<A extends Action$1>(kind: string, handler: ActionHandler$1<A>): void;
|
|
660
|
-
/** 执行一个 Action(CompoundAction 递归展开) */
|
|
661
|
-
perform(action: Action$1): Promise<void>;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Container — 通用的依赖注入容器
|
|
666
|
-
*/
|
|
667
|
-
type Factory$1<T> = () => T;
|
|
668
|
-
declare class Container$1 {
|
|
669
|
-
private registrations;
|
|
670
|
-
/** 注册依赖(默认单例) */
|
|
671
|
-
register<T>(key: string, factory: Factory$1<T>, singleton?: boolean): this;
|
|
672
|
-
/** 解析依赖 */
|
|
673
|
-
resolve<T>(key: string): T;
|
|
674
|
-
/** 检查是否已注册 */
|
|
675
|
-
has(key: string): boolean;
|
|
676
|
-
/** 销毁容器,清除所有缓存 */
|
|
677
|
-
dispose(): void;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Intent 类型定义
|
|
682
|
-
*/
|
|
683
|
-
|
|
684
|
-
/** Intent — 描述一个用户意图 */
|
|
685
|
-
interface Intent$1<T = unknown> {
|
|
686
|
-
/** Intent 标识符(用于匹配 Controller) */
|
|
687
|
-
id: string;
|
|
688
|
-
/** 意图参数 */
|
|
689
|
-
params?: Record<string, string>;
|
|
690
|
-
/** 预期返回的数据(仅用于类型推断) */
|
|
691
|
-
_returnType?: T;
|
|
692
|
-
}
|
|
693
|
-
/** Intent Controller — 处理特定 intentId 的业务逻辑 */
|
|
694
|
-
interface IntentController$1<T = unknown> {
|
|
695
|
-
/** Controller 对应的 Intent ID */
|
|
696
|
-
intentId: string;
|
|
697
|
-
/** 执行意图,返回页面数据 */
|
|
698
|
-
perform(intent: Intent$1<T>, container: Container$1): Promise<T> | T;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* IntentDispatcher — Intent 分发器
|
|
703
|
-
*
|
|
704
|
-
* 注册 IntentController,按 intentId 分发。
|
|
705
|
-
*/
|
|
706
|
-
|
|
707
|
-
declare class IntentDispatcher$1 {
|
|
708
|
-
private controllers;
|
|
709
|
-
/** 注册一个 IntentController */
|
|
710
|
-
register(controller: IntentController$1): void;
|
|
711
|
-
/** 分发 Intent 到对应 Controller */
|
|
712
|
-
dispatch<T>(intent: Intent$1<T>, container: Container$1): Promise<T>;
|
|
713
|
-
/** 检查是否已注册某个 Intent */
|
|
714
|
-
has(intentId: string): boolean;
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* Logger 接口
|
|
718
|
-
*
|
|
719
|
-
* 所有方法返回空字符串,允许在模板中内联使用而不渲染文本。
|
|
720
|
-
*/
|
|
721
|
-
interface Logger {
|
|
722
|
-
debug(...args: unknown[]): string;
|
|
723
|
-
info(...args: unknown[]): string;
|
|
724
|
-
warn(...args: unknown[]): string;
|
|
725
|
-
error(...args: unknown[]): string;
|
|
726
|
-
}
|
|
727
|
-
interface MakeDependenciesOptions$1 {
|
|
728
|
-
fetch?: typeof globalThis.fetch;
|
|
729
|
-
language?: string;
|
|
730
|
-
storefront?: string;
|
|
731
|
-
featureFlags?: Record<string, boolean | string | number>;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
/**
|
|
735
|
-
* URL 路由器 — URL pattern → Intent + FlowAction
|
|
736
|
-
*/
|
|
737
|
-
|
|
738
|
-
/** 路由匹配结果 */
|
|
739
|
-
interface RouteMatch$1 {
|
|
740
|
-
intent: Intent$1;
|
|
741
|
-
action: FlowAction$1;
|
|
742
|
-
}
|
|
743
|
-
declare class Router$1 {
|
|
744
|
-
private routes;
|
|
745
|
-
/** 添加路由规则 */
|
|
746
|
-
add(pattern: string, intentId: string): this;
|
|
747
|
-
/** 解析 URL → RouteMatch */
|
|
748
|
-
resolve(urlOrPath: string): RouteMatch$1 | null;
|
|
749
|
-
/** 获取所有已注册的路由 */
|
|
750
|
-
getRoutes(): string[];
|
|
751
|
-
private extractPath;
|
|
752
|
-
private extractQueryParams;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
/**
|
|
756
|
-
* BasePage — 所有页面共享的基础属性
|
|
757
|
-
*
|
|
758
|
-
* 具体页面类型由应用层定义并扩展此接口。
|
|
759
|
-
*/
|
|
760
|
-
interface BasePage$1 {
|
|
761
|
-
id: string;
|
|
762
|
-
pageType: string;
|
|
763
|
-
title: string;
|
|
764
|
-
description?: string;
|
|
765
|
-
url?: string;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* PrefetchedIntents — SSR 数据缓存
|
|
770
|
-
*
|
|
771
|
-
* 服务端渲染时将 Intent→Data 映射序列化嵌入 HTML,
|
|
772
|
-
* 客户端 hydrate 时提取缓存。Framework.dispatch() 优先查缓存,
|
|
773
|
-
* 命中则直接返回,未命中则走 Controller 调度。
|
|
774
|
-
*/
|
|
775
|
-
|
|
776
|
-
/** 预获取的 Intent-Data 对 */
|
|
777
|
-
interface PrefetchedIntent$1 {
|
|
778
|
-
intent: Intent$1;
|
|
779
|
-
data: unknown;
|
|
780
|
-
}
|
|
781
|
-
declare class PrefetchedIntents$1 {
|
|
782
|
-
private intents;
|
|
783
|
-
private constructor();
|
|
784
|
-
/** 从 PrefetchedIntent 数组创建缓存实例 */
|
|
785
|
-
static fromArray(items: PrefetchedIntent$1[]): PrefetchedIntents$1;
|
|
786
|
-
/** 创建空缓存实例 */
|
|
787
|
-
static empty(): PrefetchedIntents$1;
|
|
788
|
-
/**
|
|
789
|
-
* 获取缓存的 Intent 结果(一次性使用)。
|
|
790
|
-
* 命中后从缓存中删除。
|
|
791
|
-
*/
|
|
792
|
-
get<T>(intent: Intent$1<T>): T | undefined;
|
|
793
|
-
/** 检查缓存中是否有某个 Intent 的数据 */
|
|
794
|
-
has(intent: Intent$1): boolean;
|
|
795
|
-
/** 缓存中的条目数 */
|
|
796
|
-
get size(): number;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
/**
|
|
800
|
-
* Framework — 框架核心类
|
|
801
|
-
*
|
|
802
|
-
* 对应原版 Jet 类,统一管理: DI 容器、Intent 分发、Action 分发、路由、Metrics。
|
|
803
|
-
* 纯 TypeScript,不依赖任何 UI 框架。
|
|
804
|
-
*/
|
|
805
|
-
|
|
806
|
-
/** Framework 初始化配置 */
|
|
807
|
-
interface FrameworkConfig$1 extends MakeDependenciesOptions$1 {
|
|
808
|
-
setupRoutes?: (router: Router$1) => void;
|
|
809
|
-
prefetchedIntents?: PrefetchedIntents$1;
|
|
810
|
-
}
|
|
811
|
-
declare class Framework$1 {
|
|
812
|
-
readonly container: Container$1;
|
|
813
|
-
readonly intentDispatcher: IntentDispatcher$1;
|
|
814
|
-
readonly actionDispatcher: ActionDispatcher$1;
|
|
815
|
-
readonly router: Router$1;
|
|
816
|
-
readonly prefetchedIntents: PrefetchedIntents$1;
|
|
817
|
-
private constructor();
|
|
818
|
-
/** 创建并初始化 Framework 实例 */
|
|
819
|
-
static create(config?: FrameworkConfig$1): Framework$1;
|
|
820
|
-
/** 分发 Intent — 获取页面数据 */
|
|
821
|
-
dispatch<T>(intent: Intent$1<T>): Promise<T>;
|
|
822
|
-
/** 执行 Action — 处理用户交互 */
|
|
823
|
-
perform(action: Action$1): Promise<void>;
|
|
824
|
-
/** 路由 URL — 将 URL 解析为 Intent + Action */
|
|
825
|
-
routeUrl(url: string): RouteMatch$1 | null;
|
|
826
|
-
/** 记录页面访问事件 */
|
|
827
|
-
didEnterPage(page: BasePage$1): void;
|
|
828
|
-
/** 注册 Action 处理器 */
|
|
829
|
-
onAction<A extends Action$1>(kind: string, handler: ActionHandler$1<A>): void;
|
|
830
|
-
/** 注册 Intent Controller */
|
|
831
|
-
registerIntent(controller: IntentController$1): void;
|
|
832
|
-
/** 销毁 Framework 实例 */
|
|
833
|
-
dispose(): void;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
613
|
/**
|
|
837
614
|
* ExternalUrl Action Handler — 外部链接处理器
|
|
838
615
|
*/
|
|
839
616
|
|
|
840
617
|
interface ExternalUrlDependencies {
|
|
841
|
-
framework: Framework
|
|
618
|
+
framework: Framework;
|
|
842
619
|
log: Logger;
|
|
843
620
|
}
|
|
844
621
|
declare function registerExternalUrlHandler(deps: ExternalUrlDependencies): void;
|
|
@@ -855,16 +632,16 @@ interface FlowActionCallbacks {
|
|
|
855
632
|
/** 导航后更新当前路径(替代 currentPath.set()) */
|
|
856
633
|
onNavigate(pathname: string): void;
|
|
857
634
|
/** 模态页面展示(替代 openModal()) */
|
|
858
|
-
onModal(page: BasePage
|
|
635
|
+
onModal(page: BasePage): void;
|
|
859
636
|
}
|
|
860
637
|
/** 注册 FlowAction handler 所需的依赖 */
|
|
861
638
|
interface FlowActionDependencies {
|
|
862
|
-
framework: Framework
|
|
639
|
+
framework: Framework;
|
|
863
640
|
log: Logger;
|
|
864
641
|
callbacks: FlowActionCallbacks;
|
|
865
642
|
/** 更新应用 UI 的回调,page 可以是 Promise */
|
|
866
643
|
updateApp: (props: {
|
|
867
|
-
page: Promise<BasePage
|
|
644
|
+
page: Promise<BasePage> | BasePage;
|
|
868
645
|
isFirstPage?: boolean;
|
|
869
646
|
}) => void;
|
|
870
647
|
}
|
|
@@ -875,11 +652,11 @@ declare function registerFlowActionHandler(deps: FlowActionDependencies): void;
|
|
|
875
652
|
*/
|
|
876
653
|
|
|
877
654
|
interface ActionHandlerDependencies {
|
|
878
|
-
framework: Framework
|
|
655
|
+
framework: Framework;
|
|
879
656
|
log: Logger;
|
|
880
657
|
callbacks: FlowActionCallbacks;
|
|
881
658
|
updateApp: (props: {
|
|
882
|
-
page: Promise<BasePage
|
|
659
|
+
page: Promise<BasePage> | BasePage;
|
|
883
660
|
isFirstPage?: boolean;
|
|
884
661
|
}) => void;
|
|
885
662
|
}
|
|
@@ -898,7 +675,7 @@ declare function registerActionHandlers(deps: ActionHandlerDependencies): void;
|
|
|
898
675
|
|
|
899
676
|
interface BrowserAppConfig {
|
|
900
677
|
/** 注册 controllers 和路由的引导函数 */
|
|
901
|
-
bootstrap: (framework: Framework
|
|
678
|
+
bootstrap: (framework: Framework) => void;
|
|
902
679
|
/** 默认语言(回退值) */
|
|
903
680
|
defaultLocale?: string;
|
|
904
681
|
/**
|
|
@@ -911,10 +688,10 @@ interface BrowserAppConfig {
|
|
|
911
688
|
* @returns 更新函数,用于后续页面切换
|
|
912
689
|
*/
|
|
913
690
|
mount: (target: HTMLElement, context: {
|
|
914
|
-
framework: Framework
|
|
691
|
+
framework: Framework;
|
|
915
692
|
locale: string;
|
|
916
693
|
}) => (props: {
|
|
917
|
-
page: Promise<BasePage
|
|
694
|
+
page: Promise<BasePage> | BasePage;
|
|
918
695
|
isFirstPage?: boolean;
|
|
919
696
|
}) => void;
|
|
920
697
|
/** FlowAction / ExternalUrl 回调 */
|
|
@@ -965,224 +742,12 @@ declare function tryScroll(log: Logger, getScrollableElement: () => HTMLElement
|
|
|
965
742
|
* 从 DOM 反序列化服务端嵌入的数据。
|
|
966
743
|
* 读取 `<script id="serialized-server-data">` 的内容并移除标签。
|
|
967
744
|
*/
|
|
968
|
-
declare function deserializeServerData(): PrefetchedIntent
|
|
745
|
+
declare function deserializeServerData(): PrefetchedIntent[] | undefined;
|
|
969
746
|
/**
|
|
970
747
|
* 从 DOM 提取 SSR 数据并构建 PrefetchedIntents 实例。
|
|
971
748
|
* 替代原来的 PrefetchedIntents.fromDom()。
|
|
972
749
|
*/
|
|
973
|
-
declare function createPrefetchedIntentsFromDom(): PrefetchedIntents
|
|
974
|
-
|
|
975
|
-
/**
|
|
976
|
-
* Action 类型定义
|
|
977
|
-
*
|
|
978
|
-
* FlowAction — SPA 内部导航
|
|
979
|
-
* ExternalUrlAction — 打开外部链接
|
|
980
|
-
* CompoundAction — 组合多个 Action
|
|
981
|
-
*/
|
|
982
|
-
/** Action Kind 常量 */
|
|
983
|
-
declare const ACTION_KINDS: {
|
|
984
|
-
FLOW: "flow";
|
|
985
|
-
EXTERNAL_URL: "externalUrl";
|
|
986
|
-
COMPOUND: "compound";
|
|
987
|
-
};
|
|
988
|
-
/** FlowAction — SPA 导航 */
|
|
989
|
-
interface FlowAction {
|
|
990
|
-
kind: typeof ACTION_KINDS.FLOW;
|
|
991
|
-
url: string;
|
|
992
|
-
/** 展示方式: 默认 push,modal 弹窗 */
|
|
993
|
-
presentationContext?: "default" | "modal";
|
|
994
|
-
}
|
|
995
|
-
/** ExternalUrlAction — 外部链接 */
|
|
996
|
-
interface ExternalUrlAction {
|
|
997
|
-
kind: typeof ACTION_KINDS.EXTERNAL_URL;
|
|
998
|
-
url: string;
|
|
999
|
-
}
|
|
1000
|
-
/** CompoundAction — 组合 Action */
|
|
1001
|
-
interface CompoundAction {
|
|
1002
|
-
kind: typeof ACTION_KINDS.COMPOUND;
|
|
1003
|
-
actions: Action[];
|
|
1004
|
-
}
|
|
1005
|
-
/** 所有 Action 的联合类型 */
|
|
1006
|
-
type Action = FlowAction | ExternalUrlAction | CompoundAction;
|
|
1007
|
-
|
|
1008
|
-
/**
|
|
1009
|
-
* ActionDispatcher — Action 分发器
|
|
1010
|
-
*
|
|
1011
|
-
* 注册不同 kind 的 handler,按类型分发。
|
|
1012
|
-
* CompoundAction 自动展开递归执行。
|
|
1013
|
-
*/
|
|
1014
|
-
|
|
1015
|
-
/** Action 处理器函数类型 */
|
|
1016
|
-
type ActionHandler<A extends Action = Action> = (action: A) => Promise<void> | void;
|
|
1017
|
-
declare class ActionDispatcher {
|
|
1018
|
-
private handlers;
|
|
1019
|
-
private wiredActions;
|
|
1020
|
-
/** 注册指定 kind 的 handler(防止重复注册) */
|
|
1021
|
-
onAction<A extends Action>(kind: string, handler: ActionHandler<A>): void;
|
|
1022
|
-
/** 执行一个 Action(CompoundAction 递归展开) */
|
|
1023
|
-
perform(action: Action): Promise<void>;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
/**
|
|
1027
|
-
* Container — 通用的依赖注入容器
|
|
1028
|
-
*/
|
|
1029
|
-
type Factory<T> = () => T;
|
|
1030
|
-
declare class Container {
|
|
1031
|
-
private registrations;
|
|
1032
|
-
/** 注册依赖(默认单例) */
|
|
1033
|
-
register<T>(key: string, factory: Factory<T>, singleton?: boolean): this;
|
|
1034
|
-
/** 解析依赖 */
|
|
1035
|
-
resolve<T>(key: string): T;
|
|
1036
|
-
/** 检查是否已注册 */
|
|
1037
|
-
has(key: string): boolean;
|
|
1038
|
-
/** 销毁容器,清除所有缓存 */
|
|
1039
|
-
dispose(): void;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
/**
|
|
1043
|
-
* Intent 类型定义
|
|
1044
|
-
*/
|
|
1045
|
-
|
|
1046
|
-
/** Intent — 描述一个用户意图 */
|
|
1047
|
-
interface Intent<T = unknown> {
|
|
1048
|
-
/** Intent 标识符(用于匹配 Controller) */
|
|
1049
|
-
id: string;
|
|
1050
|
-
/** 意图参数 */
|
|
1051
|
-
params?: Record<string, string>;
|
|
1052
|
-
/** 预期返回的数据(仅用于类型推断) */
|
|
1053
|
-
_returnType?: T;
|
|
1054
|
-
}
|
|
1055
|
-
/** Intent Controller — 处理特定 intentId 的业务逻辑 */
|
|
1056
|
-
interface IntentController<T = unknown> {
|
|
1057
|
-
/** Controller 对应的 Intent ID */
|
|
1058
|
-
intentId: string;
|
|
1059
|
-
/** 执行意图,返回页面数据 */
|
|
1060
|
-
perform(intent: Intent<T>, container: Container): Promise<T> | T;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
/**
|
|
1064
|
-
* IntentDispatcher — Intent 分发器
|
|
1065
|
-
*
|
|
1066
|
-
* 注册 IntentController,按 intentId 分发。
|
|
1067
|
-
*/
|
|
1068
|
-
|
|
1069
|
-
declare class IntentDispatcher {
|
|
1070
|
-
private controllers;
|
|
1071
|
-
/** 注册一个 IntentController */
|
|
1072
|
-
register(controller: IntentController): void;
|
|
1073
|
-
/** 分发 Intent 到对应 Controller */
|
|
1074
|
-
dispatch<T>(intent: Intent<T>, container: Container): Promise<T>;
|
|
1075
|
-
/** 检查是否已注册某个 Intent */
|
|
1076
|
-
has(intentId: string): boolean;
|
|
1077
|
-
}
|
|
1078
|
-
interface MakeDependenciesOptions {
|
|
1079
|
-
fetch?: typeof globalThis.fetch;
|
|
1080
|
-
language?: string;
|
|
1081
|
-
storefront?: string;
|
|
1082
|
-
featureFlags?: Record<string, boolean | string | number>;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
/**
|
|
1086
|
-
* URL 路由器 — URL pattern → Intent + FlowAction
|
|
1087
|
-
*/
|
|
1088
|
-
|
|
1089
|
-
/** 路由匹配结果 */
|
|
1090
|
-
interface RouteMatch {
|
|
1091
|
-
intent: Intent;
|
|
1092
|
-
action: FlowAction;
|
|
1093
|
-
}
|
|
1094
|
-
declare class Router {
|
|
1095
|
-
private routes;
|
|
1096
|
-
/** 添加路由规则 */
|
|
1097
|
-
add(pattern: string, intentId: string): this;
|
|
1098
|
-
/** 解析 URL → RouteMatch */
|
|
1099
|
-
resolve(urlOrPath: string): RouteMatch | null;
|
|
1100
|
-
/** 获取所有已注册的路由 */
|
|
1101
|
-
getRoutes(): string[];
|
|
1102
|
-
private extractPath;
|
|
1103
|
-
private extractQueryParams;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
/**
|
|
1107
|
-
* BasePage — 所有页面共享的基础属性
|
|
1108
|
-
*
|
|
1109
|
-
* 具体页面类型由应用层定义并扩展此接口。
|
|
1110
|
-
*/
|
|
1111
|
-
interface BasePage {
|
|
1112
|
-
id: string;
|
|
1113
|
-
pageType: string;
|
|
1114
|
-
title: string;
|
|
1115
|
-
description?: string;
|
|
1116
|
-
url?: string;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* PrefetchedIntents — SSR 数据缓存
|
|
1121
|
-
*
|
|
1122
|
-
* 服务端渲染时将 Intent→Data 映射序列化嵌入 HTML,
|
|
1123
|
-
* 客户端 hydrate 时提取缓存。Framework.dispatch() 优先查缓存,
|
|
1124
|
-
* 命中则直接返回,未命中则走 Controller 调度。
|
|
1125
|
-
*/
|
|
1126
|
-
|
|
1127
|
-
/** 预获取的 Intent-Data 对 */
|
|
1128
|
-
interface PrefetchedIntent {
|
|
1129
|
-
intent: Intent;
|
|
1130
|
-
data: unknown;
|
|
1131
|
-
}
|
|
1132
|
-
declare class PrefetchedIntents {
|
|
1133
|
-
private intents;
|
|
1134
|
-
private constructor();
|
|
1135
|
-
/** 从 PrefetchedIntent 数组创建缓存实例 */
|
|
1136
|
-
static fromArray(items: PrefetchedIntent[]): PrefetchedIntents;
|
|
1137
|
-
/** 创建空缓存实例 */
|
|
1138
|
-
static empty(): PrefetchedIntents;
|
|
1139
|
-
/**
|
|
1140
|
-
* 获取缓存的 Intent 结果(一次性使用)。
|
|
1141
|
-
* 命中后从缓存中删除。
|
|
1142
|
-
*/
|
|
1143
|
-
get<T>(intent: Intent<T>): T | undefined;
|
|
1144
|
-
/** 检查缓存中是否有某个 Intent 的数据 */
|
|
1145
|
-
has(intent: Intent): boolean;
|
|
1146
|
-
/** 缓存中的条目数 */
|
|
1147
|
-
get size(): number;
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
/**
|
|
1151
|
-
* Framework — 框架核心类
|
|
1152
|
-
*
|
|
1153
|
-
* 对应原版 Jet 类,统一管理: DI 容器、Intent 分发、Action 分发、路由、Metrics。
|
|
1154
|
-
* 纯 TypeScript,不依赖任何 UI 框架。
|
|
1155
|
-
*/
|
|
1156
|
-
|
|
1157
|
-
/** Framework 初始化配置 */
|
|
1158
|
-
interface FrameworkConfig extends MakeDependenciesOptions {
|
|
1159
|
-
setupRoutes?: (router: Router) => void;
|
|
1160
|
-
prefetchedIntents?: PrefetchedIntents;
|
|
1161
|
-
}
|
|
1162
|
-
declare class Framework {
|
|
1163
|
-
readonly container: Container;
|
|
1164
|
-
readonly intentDispatcher: IntentDispatcher;
|
|
1165
|
-
readonly actionDispatcher: ActionDispatcher;
|
|
1166
|
-
readonly router: Router;
|
|
1167
|
-
readonly prefetchedIntents: PrefetchedIntents;
|
|
1168
|
-
private constructor();
|
|
1169
|
-
/** 创建并初始化 Framework 实例 */
|
|
1170
|
-
static create(config?: FrameworkConfig): Framework;
|
|
1171
|
-
/** 分发 Intent — 获取页面数据 */
|
|
1172
|
-
dispatch<T>(intent: Intent<T>): Promise<T>;
|
|
1173
|
-
/** 执行 Action — 处理用户交互 */
|
|
1174
|
-
perform(action: Action): Promise<void>;
|
|
1175
|
-
/** 路由 URL — 将 URL 解析为 Intent + Action */
|
|
1176
|
-
routeUrl(url: string): RouteMatch | null;
|
|
1177
|
-
/** 记录页面访问事件 */
|
|
1178
|
-
didEnterPage(page: BasePage): void;
|
|
1179
|
-
/** 注册 Action 处理器 */
|
|
1180
|
-
onAction<A extends Action>(kind: string, handler: ActionHandler<A>): void;
|
|
1181
|
-
/** 注册 Intent Controller */
|
|
1182
|
-
registerIntent(controller: IntentController): void;
|
|
1183
|
-
/** 销毁 Framework 实例 */
|
|
1184
|
-
dispose(): void;
|
|
1185
|
-
}
|
|
750
|
+
declare function createPrefetchedIntentsFromDom(): PrefetchedIntents;
|
|
1186
751
|
|
|
1187
752
|
/**
|
|
1188
753
|
* ssrRender — 通用 SSR 渲染管线
|
|
@@ -1392,4 +957,4 @@ declare function startServer(options: StartServerOptions): Promise<{
|
|
|
1392
957
|
vite?: ViteDevServer;
|
|
1393
958
|
}>;
|
|
1394
959
|
|
|
1395
|
-
export { ACTION_KINDS
|
|
960
|
+
export { ACTION_KINDS, type Action, ActionDispatcher, type ActionHandler, type ActionHandlerDependencies, type AsyncMapper, BaseController, type BaseItem, BaseLogger, type BasePage, type BaseShelf, type BrowserAppConfig, CompositeLogger, CompositeLoggerFactory, type CompoundAction, ConsoleLogger, ConsoleLoggerFactory, Container, DEP_KEYS, type ExternalUrlAction, type ExternalUrlDependencies, type FeatureFlags, type FlowAction, type FlowActionCallbacks, type FlowActionDependencies, Framework, type FrameworkConfig, History, HttpClient, type HttpClientConfig, HttpError, type InjectSSROptions, type Intent, type IntentController, IntentDispatcher, type Locale, type Logger, type LoggerFactory, type Logger as LoggerInterface, LruMap, type Mapper, type MetricsRecorder, type Net, type None, type Optional, type PrefetchedIntent, PrefetchedIntents, type RouteDefinition, type RouteMatch, Router, type RuntimeInfo, type SSRAppOptions, type SSRModule, type SSRRenderConfig, type SSRRenderOptions, type SSRRenderResult, type ServerConfig, type ServerInstance, type StartServerOptions, type Storage, buildUrl, createPrefetchedIntentsFromDom, createSSRApp, createSSRRender, createServer, defineRoutes, deserializeServerData, detectRuntime, generateUuid, getBaseUrl, injectSSRContent, isCompoundAction, isExternalUrlAction, isFlowAction, isNone, isSome, makeDependencies, makeExternalUrlAction, makeFlowAction, mapEach, parseAcceptLanguage, pipe, pipeAsync, registerActionHandlers, registerExternalUrlHandler, registerFlowActionHandler, removeHost, removeQueryParams, removeScheme, resetFilterCache, resolveRoot, serializeServerData, shouldLog, ssrRender, stableStringify, startBrowserApp, startServer, tryScroll };
|