@fine-kit/core 0.1.0

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.
@@ -0,0 +1,610 @@
1
+ /**
2
+ * Action 类型定义
3
+ *
4
+ * FlowAction — SPA 内部导航
5
+ * ExternalUrlAction — 打开外部链接
6
+ * CompoundAction — 组合多个 Action
7
+ */
8
+ /** Action Kind 常量 */
9
+ declare const ACTION_KINDS: {
10
+ FLOW: "flow";
11
+ EXTERNAL_URL: "externalUrl";
12
+ COMPOUND: "compound";
13
+ };
14
+ /** FlowAction — SPA 导航 */
15
+ interface FlowAction {
16
+ kind: typeof ACTION_KINDS.FLOW;
17
+ url: string;
18
+ /** 展示方式: 默认 push,modal 弹窗 */
19
+ presentationContext?: "default" | "modal";
20
+ }
21
+ /** ExternalUrlAction — 外部链接 */
22
+ interface ExternalUrlAction {
23
+ kind: typeof ACTION_KINDS.EXTERNAL_URL;
24
+ url: string;
25
+ }
26
+ /** CompoundAction — 组合 Action */
27
+ interface CompoundAction {
28
+ kind: typeof ACTION_KINDS.COMPOUND;
29
+ actions: Action[];
30
+ }
31
+ /** 所有 Action 的联合类型 */
32
+ type Action = FlowAction | ExternalUrlAction | CompoundAction;
33
+ declare function isFlowAction(action: Action): action is FlowAction;
34
+ declare function isExternalUrlAction(action: Action): action is ExternalUrlAction;
35
+ declare function isCompoundAction(action: Action): action is CompoundAction;
36
+ declare function makeFlowAction(url: string, presentationContext?: FlowAction["presentationContext"]): FlowAction;
37
+ declare function makeExternalUrlAction(url: string): ExternalUrlAction;
38
+
39
+ /**
40
+ * ActionDispatcher — Action 分发器
41
+ *
42
+ * 注册不同 kind 的 handler,按类型分发。
43
+ * CompoundAction 自动展开递归执行。
44
+ */
45
+
46
+ /** Action 处理器函数类型 */
47
+ type ActionHandler<A extends Action = Action> = (action: A) => Promise<void> | void;
48
+ declare class ActionDispatcher {
49
+ private handlers;
50
+ private wiredActions;
51
+ /** 注册指定 kind 的 handler(防止重复注册) */
52
+ onAction<A extends Action>(kind: string, handler: ActionHandler<A>): void;
53
+ /** 执行一个 Action(CompoundAction 递归展开) */
54
+ perform(action: Action): Promise<void>;
55
+ }
56
+
57
+ /**
58
+ * Container — 通用的依赖注入容器
59
+ */
60
+ type Factory<T> = () => T;
61
+ declare class Container {
62
+ private registrations;
63
+ /** 注册依赖(默认单例) */
64
+ register<T>(key: string, factory: Factory<T>, singleton?: boolean): this;
65
+ /** 解析依赖 */
66
+ resolve<T>(key: string): T;
67
+ /** 检查是否已注册 */
68
+ has(key: string): boolean;
69
+ /** 销毁容器,清除所有缓存 */
70
+ dispose(): void;
71
+ }
72
+
73
+ /**
74
+ * Intent 类型定义
75
+ */
76
+
77
+ /** Intent — 描述一个用户意图 */
78
+ interface Intent<T = unknown> {
79
+ /** Intent 标识符(用于匹配 Controller) */
80
+ id: string;
81
+ /** 意图参数 */
82
+ params?: Record<string, string>;
83
+ /** 预期返回的数据(仅用于类型推断) */
84
+ _returnType?: T;
85
+ }
86
+ /** Intent Controller — 处理特定 intentId 的业务逻辑 */
87
+ interface IntentController<T = unknown> {
88
+ /** Controller 对应的 Intent ID */
89
+ intentId: string;
90
+ /** 执行意图,返回页面数据 */
91
+ perform(intent: Intent<T>, container: Container): Promise<T> | T;
92
+ }
93
+
94
+ /**
95
+ * IntentDispatcher — Intent 分发器
96
+ *
97
+ * 注册 IntentController,按 intentId 分发。
98
+ */
99
+
100
+ declare class IntentDispatcher {
101
+ private controllers;
102
+ /** 注册一个 IntentController */
103
+ register(controller: IntentController): void;
104
+ /** 分发 Intent 到对应 Controller */
105
+ dispatch<T>(intent: Intent<T>, container: Container): Promise<T>;
106
+ /** 检查是否已注册某个 Intent */
107
+ has(intentId: string): boolean;
108
+ }
109
+
110
+ /** 日志级别 */
111
+ type Level = "debug" | "info" | "warn" | "error";
112
+ /**
113
+ * Logger 接口
114
+ *
115
+ * 所有方法返回空字符串,允许在模板中内联使用而不渲染文本。
116
+ */
117
+ interface Logger {
118
+ debug(...args: unknown[]): string;
119
+ info(...args: unknown[]): string;
120
+ warn(...args: unknown[]): string;
121
+ error(...args: unknown[]): string;
122
+ }
123
+ interface LoggerFactory {
124
+ loggerFor(category: string): Logger;
125
+ }
126
+
127
+ /**
128
+ * 依赖工厂 — 创建所有基础依赖
129
+ */
130
+
131
+ /** 网络请求层 */
132
+ interface Net {
133
+ fetch(url: string, options?: RequestInit): Promise<Response>;
134
+ }
135
+ /** 多语言状态 */
136
+ interface Locale {
137
+ language: string;
138
+ storefront: string;
139
+ setActiveLocale(language: string, storefront: string): void;
140
+ }
141
+ /** 存储接口 */
142
+ interface Storage {
143
+ get(key: string): string | undefined;
144
+ set(key: string, value: string): void;
145
+ delete(key: string): void;
146
+ }
147
+ /** Feature Flags */
148
+ interface FeatureFlags {
149
+ isEnabled(key: string): boolean;
150
+ getString(key: string): string | undefined;
151
+ getNumber(key: string): number | undefined;
152
+ }
153
+ /** Metrics 记录器 */
154
+ interface MetricsRecorder {
155
+ recordPageView(page: string, fields?: Record<string, unknown>): void;
156
+ recordEvent(name: string, fields?: Record<string, unknown>): void;
157
+ }
158
+ declare const DEP_KEYS: {
159
+ readonly LOGGER: "logger";
160
+ readonly LOGGER_FACTORY: "loggerFactory";
161
+ readonly NET: "net";
162
+ readonly LOCALE: "locale";
163
+ readonly STORAGE: "storage";
164
+ readonly FEATURE_FLAGS: "featureFlags";
165
+ readonly METRICS: "metrics";
166
+ readonly FETCH: "fetch";
167
+ };
168
+ interface MakeDependenciesOptions {
169
+ fetch?: typeof globalThis.fetch;
170
+ language?: string;
171
+ storefront?: string;
172
+ featureFlags?: Record<string, boolean | string | number>;
173
+ }
174
+ declare function makeDependencies(container: Container, options?: MakeDependenciesOptions): void;
175
+
176
+ /**
177
+ * URL 路由器 — URL pattern → Intent + FlowAction
178
+ */
179
+
180
+ /** 路由匹配结果 */
181
+ interface RouteMatch {
182
+ intent: Intent;
183
+ action: FlowAction;
184
+ }
185
+ declare class Router {
186
+ private routes;
187
+ /** 添加路由规则 */
188
+ add(pattern: string, intentId: string): this;
189
+ /** 解析 URL → RouteMatch */
190
+ resolve(urlOrPath: string): RouteMatch | null;
191
+ /** 获取所有已注册的路由 */
192
+ getRoutes(): string[];
193
+ private extractPath;
194
+ private extractQueryParams;
195
+ }
196
+
197
+ /**
198
+ * BaseLogger — 抽象日志基类
199
+ */
200
+
201
+ declare abstract class BaseLogger implements Logger {
202
+ protected category: string;
203
+ constructor(category: string);
204
+ abstract debug(...args: unknown[]): string;
205
+ abstract info(...args: unknown[]): string;
206
+ abstract warn(...args: unknown[]): string;
207
+ abstract error(...args: unknown[]): string;
208
+ }
209
+
210
+ /**
211
+ * Composite Logger — 组合日志,广播到多个后端
212
+ */
213
+
214
+ declare class CompositeLoggerFactory implements LoggerFactory {
215
+ private readonly factories;
216
+ constructor(factories: LoggerFactory[]);
217
+ loggerFor(name: string): Logger;
218
+ }
219
+ declare class CompositeLogger implements Logger {
220
+ private readonly loggers;
221
+ constructor(loggers: Logger[]);
222
+ debug(...args: unknown[]): string;
223
+ info(...args: unknown[]): string;
224
+ warn(...args: unknown[]): string;
225
+ error(...args: unknown[]): string;
226
+ private callAll;
227
+ }
228
+
229
+ /**
230
+ * ConsoleLogger — 基于 console 的日志实现
231
+ */
232
+
233
+ declare class ConsoleLogger extends BaseLogger {
234
+ debug(...args: unknown[]): string;
235
+ info(...args: unknown[]): string;
236
+ warn(...args: unknown[]): string;
237
+ error(...args: unknown[]): string;
238
+ }
239
+ declare class ConsoleLoggerFactory implements LoggerFactory {
240
+ loggerFor(category: string): Logger;
241
+ }
242
+
243
+ /**
244
+ * localStorage 日志级别过滤
245
+ *
246
+ * 通过 localStorage.onyxLog 控制日志级别:
247
+ * '*=info' — 全局 info 及以上
248
+ * '*=info,Foo=off' — 全局 info,Foo 静默
249
+ * 'Bar=error,Baz=warn' — Bar 只输出 error,Baz 输出 warn+
250
+ */
251
+
252
+ declare function shouldLog(name: string, level: Level): boolean;
253
+ declare function resetFilterCache(): void;
254
+
255
+ /**
256
+ * BasePage — 所有页面共享的基础属性
257
+ *
258
+ * 具体页面类型由应用层定义并扩展此接口。
259
+ */
260
+ interface BasePage {
261
+ id: string;
262
+ pageType: string;
263
+ title: string;
264
+ description?: string;
265
+ url?: string;
266
+ }
267
+
268
+ /**
269
+ * PrefetchedIntents — SSR 数据缓存
270
+ *
271
+ * 服务端渲染时将 Intent→Data 映射序列化嵌入 HTML,
272
+ * 客户端 hydrate 时提取缓存。Framework.dispatch() 优先查缓存,
273
+ * 命中则直接返回,未命中则走 Controller 调度。
274
+ */
275
+
276
+ /** 预获取的 Intent-Data 对 */
277
+ interface PrefetchedIntent {
278
+ intent: Intent;
279
+ data: unknown;
280
+ }
281
+ declare class PrefetchedIntents {
282
+ private intents;
283
+ private constructor();
284
+ /** 从 PrefetchedIntent 数组创建缓存实例 */
285
+ static fromArray(items: PrefetchedIntent[]): PrefetchedIntents;
286
+ /** 创建空缓存实例 */
287
+ static empty(): PrefetchedIntents;
288
+ /**
289
+ * 获取缓存的 Intent 结果(一次性使用)。
290
+ * 命中后从缓存中删除。
291
+ */
292
+ get<T>(intent: Intent<T>): T | undefined;
293
+ /** 检查缓存中是否有某个 Intent 的数据 */
294
+ has(intent: Intent): boolean;
295
+ /** 缓存中的条目数 */
296
+ get size(): number;
297
+ }
298
+
299
+ /**
300
+ * Framework — 框架核心类
301
+ *
302
+ * 对应原版 Jet 类,统一管理: DI 容器、Intent 分发、Action 分发、路由、Metrics。
303
+ * 纯 TypeScript,不依赖任何 UI 框架。
304
+ */
305
+
306
+ /** Framework 初始化配置 */
307
+ interface FrameworkConfig extends MakeDependenciesOptions {
308
+ setupRoutes?: (router: Router) => void;
309
+ prefetchedIntents?: PrefetchedIntents;
310
+ }
311
+ declare class Framework {
312
+ readonly container: Container;
313
+ readonly intentDispatcher: IntentDispatcher;
314
+ readonly actionDispatcher: ActionDispatcher;
315
+ readonly router: Router;
316
+ readonly prefetchedIntents: PrefetchedIntents;
317
+ private constructor();
318
+ /** 创建并初始化 Framework 实例 */
319
+ static create(config?: FrameworkConfig): Framework;
320
+ /** 分发 Intent — 获取页面数据 */
321
+ dispatch<T>(intent: Intent<T>): Promise<T>;
322
+ /** 执行 Action — 处理用户交互 */
323
+ perform(action: Action): Promise<void>;
324
+ /** 路由 URL — 将 URL 解析为 Intent + Action */
325
+ routeUrl(url: string): RouteMatch | null;
326
+ /** 记录页面访问事件 */
327
+ didEnterPage(page: BasePage): void;
328
+ /** 注册 Action 处理器 */
329
+ onAction<A extends Action>(kind: string, handler: ActionHandler<A>): void;
330
+ /** 注册 Intent Controller */
331
+ registerIntent(controller: IntentController): void;
332
+ /** 销毁 Framework 实例 */
333
+ dispose(): void;
334
+ }
335
+
336
+ /**
337
+ * BaseShelf / BaseItem — 所有 Shelf 和 Item 共享的基础属性
338
+ *
339
+ * 具体 Shelf/Item 类型由应用层定义并扩展此接口。
340
+ */
341
+
342
+ interface BaseShelf {
343
+ id: string;
344
+ shelfType: string;
345
+ title?: string;
346
+ subtitle?: string;
347
+ seeAllAction?: Action;
348
+ isHorizontal?: boolean;
349
+ }
350
+ interface BaseItem {
351
+ id: string;
352
+ itemType: string;
353
+ clickAction?: Action;
354
+ }
355
+
356
+ /**
357
+ * stableStringify — 确定性 JSON 序列化(keys 按字母排序)
358
+ *
359
+ * 用作缓存 key:相同内容的对象始终产生相同字符串。
360
+ */
361
+ declare function stableStringify(obj: unknown): string;
362
+
363
+ /**
364
+ * HttpClient — 通用 HTTP 客户端基类
365
+ *
366
+ * 为 API Client 提供标准化的 HTTP 请求能力。
367
+ * 子类继承后只需关注业务端点定义,不需要重复实现 fetch / JSON 解析 / 错误处理。
368
+ */
369
+ /** HTTP 请求错误 */
370
+ declare class HttpError extends Error {
371
+ readonly status: number;
372
+ readonly statusText: string;
373
+ readonly body?: string | undefined;
374
+ constructor(status: number, statusText: string, body?: string | undefined);
375
+ }
376
+ /** HttpClient 构造配置 */
377
+ interface HttpClientConfig {
378
+ /** API base URL(如 "/api" 或 "https://example.com/api") */
379
+ baseUrl: string;
380
+ /** 默认请求头 */
381
+ defaultHeaders?: Record<string, string>;
382
+ /** 自定义 fetch 实现(便于测试或 SSR) */
383
+ fetch?: typeof globalThis.fetch;
384
+ }
385
+ /**
386
+ * 通用 HTTP 客户端基类
387
+ *
388
+ * 使用方式: 创建子类继承 HttpClient,定义业务方法调用 this.get() / this.post() 等。
389
+ *
390
+ * @example
391
+ * ```ts
392
+ * class MyApiClient extends HttpClient {
393
+ * async getUser(id: string) {
394
+ * return this.get<User>(`/users/${id}`);
395
+ * }
396
+ * }
397
+ * ```
398
+ */
399
+ declare abstract class HttpClient {
400
+ protected readonly baseUrl: string;
401
+ protected readonly defaultHeaders: Record<string, string>;
402
+ protected readonly fetchFn: typeof globalThis.fetch;
403
+ constructor(config: HttpClientConfig);
404
+ /** GET 请求,返回解析后的 JSON */
405
+ protected get<T>(path: string, params?: Record<string, string>): Promise<T>;
406
+ /** POST 请求,自动序列化 body 为 JSON */
407
+ protected post<T>(path: string, body?: unknown, params?: Record<string, string>): Promise<T>;
408
+ /** PUT 请求 */
409
+ protected put<T>(path: string, body?: unknown, params?: Record<string, string>): Promise<T>;
410
+ /** DELETE 请求 */
411
+ protected del<T>(path: string, params?: Record<string, string>): Promise<T>;
412
+ /**
413
+ * 底层请求方法 — 子类可覆写以自定义行为
414
+ *
415
+ * 自动处理:
416
+ * - URL 拼接 (baseUrl + path + params)
417
+ * - 默认 headers 合并
418
+ * - JSON body 序列化
419
+ * - 响应 JSON 解析
420
+ * - 非 2xx 状态码抛出 HttpError
421
+ */
422
+ protected request<T>(method: string, path: string, options?: {
423
+ params?: Record<string, string>;
424
+ body?: unknown;
425
+ headers?: Record<string, string>;
426
+ }): Promise<T>;
427
+ /** 构建完整 URL — 子类可覆写以自定义 URL 拼接逻辑 */
428
+ protected buildUrl(path: string, params?: Record<string, string>): string;
429
+ }
430
+
431
+ /**
432
+ * BaseController — 抽象 Intent Controller 基类
433
+ *
434
+ * 提供标准化的 try/catch → fallback 模式。
435
+ * 子类只需实现 execute() 和可选的 fallback()。
436
+ */
437
+
438
+ /**
439
+ * 抽象 Controller 基类
440
+ *
441
+ * 统一处理:
442
+ * - 类型安全的参数提取 (TParams)
443
+ * - 返回类型约束 (TResult)
444
+ * - try/catch 错误处理 + 可选 fallback
445
+ *
446
+ * @example
447
+ * ```ts
448
+ * class ProductController extends BaseController<{ productId: string }, ProductPage> {
449
+ * readonly intentId = "product-page";
450
+ *
451
+ * async execute(params: { productId: string }, container: Container) {
452
+ * const api = container.resolve<ApiClient>("api");
453
+ * return api.getProduct(params.productId);
454
+ * }
455
+ *
456
+ * fallback(params: { productId: string }, error: Error) {
457
+ * return getMockProduct(params.productId);
458
+ * }
459
+ * }
460
+ * ```
461
+ */
462
+ declare abstract class BaseController<TParams extends Record<string, string | undefined> = Record<string, string>, TResult = unknown> implements IntentController<TResult> {
463
+ /** Controller 对应的 Intent ID */
464
+ abstract readonly intentId: string;
465
+ /**
466
+ * 执行业务逻辑 — 子类必须实现
467
+ *
468
+ * @param params - Intent 参数(已类型化)
469
+ * @param container - DI 容器
470
+ * @returns 页面数据
471
+ */
472
+ abstract execute(params: TParams, container: Container): Promise<TResult> | TResult;
473
+ /**
474
+ * 错误回退 — 子类可选覆写
475
+ *
476
+ * 当 execute() 抛出异常时调用。
477
+ * 默认行为: 重新抛出原始错误。
478
+ *
479
+ * @param params - Intent 参数
480
+ * @param error - execute() 抛出的错误
481
+ * @returns 回退数据
482
+ */
483
+ fallback(params: TParams, error: Error): Promise<TResult> | TResult;
484
+ /**
485
+ * IntentController.perform() 实现
486
+ *
487
+ * 自动 try/catch → fallback 模式。
488
+ */
489
+ perform(intent: Intent<TResult>, container: Container): Promise<TResult>;
490
+ }
491
+
492
+ /**
493
+ * Mapper 类型工具 — 标准化数据转换管线
494
+ *
495
+ * 提供类型约定和组合函数,让 API 响应 → 页面模型 的转换有统一的签名模式。
496
+ */
497
+ /** 同步映射函数 */
498
+ type Mapper<TInput, TOutput> = (input: TInput) => TOutput;
499
+ /** 异步映射函数 */
500
+ type AsyncMapper<TInput, TOutput> = (input: TInput) => TOutput | Promise<TOutput>;
501
+ /**
502
+ * 组合两个同步 Mapper: A → B → C
503
+ */
504
+ declare function pipe<A, B, C>(m1: Mapper<A, B>, m2: Mapper<B, C>): Mapper<A, C>;
505
+ /**
506
+ * 组合三个同步 Mapper: A → B → C → D
507
+ */
508
+ declare function pipe<A, B, C, D>(m1: Mapper<A, B>, m2: Mapper<B, C>, m3: Mapper<C, D>): Mapper<A, D>;
509
+ /**
510
+ * 组合四个同步 Mapper: A → B → C → D → E
511
+ */
512
+ declare function pipe<A, B, C, D, E>(m1: Mapper<A, B>, m2: Mapper<B, C>, m3: Mapper<C, D>, m4: Mapper<D, E>): Mapper<A, E>;
513
+ /**
514
+ * 组合任意数量的同步 Mapper
515
+ */
516
+ declare function pipe(...mappers: Mapper<unknown, unknown>[]): Mapper<unknown, unknown>;
517
+ /**
518
+ * 组合两个可能异步的 Mapper: A → B → C
519
+ */
520
+ declare function pipeAsync<A, B, C>(m1: AsyncMapper<A, B>, m2: AsyncMapper<B, C>): AsyncMapper<A, C>;
521
+ /**
522
+ * 组合三个可能异步的 Mapper
523
+ */
524
+ declare function pipeAsync<A, B, C, D>(m1: AsyncMapper<A, B>, m2: AsyncMapper<B, C>, m3: AsyncMapper<C, D>): AsyncMapper<A, D>;
525
+ /**
526
+ * 将一个 Mapper 应用到数组的每个元素
527
+ */
528
+ declare function mapEach<TInput, TOutput>(mapper: Mapper<TInput, TOutput>): Mapper<TInput[], TOutput[]>;
529
+
530
+ /**
531
+ * defineRoutes — 声明式路由 + Controller 注册
532
+ *
533
+ * 将命令式的路由注册 (20+ 行 framework.router.add / framework.registerIntent)
534
+ * 简化为声明式配置数组。
535
+ */
536
+
537
+ /** 单条路由定义 */
538
+ interface RouteDefinition {
539
+ /** URL pattern (如 "/product/:productId") */
540
+ path: string;
541
+ /** Intent ID (如 "product-page") */
542
+ intentId: string;
543
+ /**
544
+ * Controller 实例(可选)。
545
+ * 同一个 intentId 的多条路由只需在第一条提供 controller。
546
+ */
547
+ controller?: IntentController;
548
+ }
549
+ /**
550
+ * 声明式注册路由和 Controller
551
+ *
552
+ * - 自动去重: 同一 intentId 的 controller 只注册一次
553
+ * - 路由和 controller 在同一个配置数组中,方便检查一致性
554
+ *
555
+ * @example
556
+ * ```ts
557
+ * defineRoutes(framework, [
558
+ * { path: "/", intentId: "home", controller: new HomeController() },
559
+ * { path: "/product/:id", intentId: "product", controller: new ProductController() },
560
+ * { path: "/search", intentId: "search", controller: new SearchController() },
561
+ * { path: "/charts/:type", intentId: "charts", controller: new ChartsController() },
562
+ * { path: "/charts", intentId: "charts" }, // 同 intentId,不需要重复 controller
563
+ * ]);
564
+ * ```
565
+ */
566
+ declare function defineRoutes(framework: Framework, definitions: RouteDefinition[]): void;
567
+
568
+ /**
569
+ * LruMap — 固定容量的 LRU 缓存
570
+ */
571
+ declare class LruMap<K, V> {
572
+ private map;
573
+ private readonly capacity;
574
+ constructor(capacity: number);
575
+ get(key: K): V | undefined;
576
+ set(key: K, value: V): void;
577
+ has(key: K): boolean;
578
+ delete(key: K): boolean;
579
+ get size(): number;
580
+ clear(): void;
581
+ }
582
+
583
+ /**
584
+ * Optional 类型工具
585
+ */
586
+ type None = null | undefined;
587
+ type Optional<T> = T | None;
588
+ declare function isSome<T>(value: Optional<T>): value is T;
589
+ declare function isNone<T>(value: Optional<T>): value is None;
590
+
591
+ /**
592
+ * URL 工具函数
593
+ */
594
+ /** 移除 URL scheme (https://, http://) */
595
+ declare function removeScheme(url: string): string;
596
+ /** 移除 URL host 部分,保留路径 */
597
+ declare function removeHost(url: string): string;
598
+ /** 移除 query 参数 */
599
+ declare function removeQueryParams(url: string): string;
600
+ /** 获取 URL 的基础路径(无 query、hash) */
601
+ declare function getBaseUrl(url: string): string;
602
+ /** 构建 URL(路径 + query 参数) */
603
+ declare function buildUrl(path: string, params?: Record<string, string | undefined>): string;
604
+
605
+ /**
606
+ * UUID v4 生成器
607
+ */
608
+ declare function generateUuid(): string;
609
+
610
+ export { ACTION_KINDS, type Action, ActionDispatcher, type ActionHandler, type AsyncMapper, BaseController, type BaseItem, BaseLogger, type BasePage, type BaseShelf, CompositeLogger, CompositeLoggerFactory, type CompoundAction, ConsoleLogger, ConsoleLoggerFactory, Container, DEP_KEYS, type ExternalUrlAction, type FeatureFlags, type FlowAction, Framework, type FrameworkConfig, HttpClient, type HttpClientConfig, HttpError, 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 Storage, buildUrl, defineRoutes, generateUuid, getBaseUrl, isCompoundAction, isExternalUrlAction, isFlowAction, isNone, isSome, makeDependencies, makeExternalUrlAction, makeFlowAction, mapEach, pipe, pipeAsync, removeHost, removeQueryParams, removeScheme, resetFilterCache, shouldLog, stableStringify };