@yongdall/web 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.
package/index.d.mts ADDED
@@ -0,0 +1,2154 @@
1
+ import * as dot_request1 from "dot-request";
2
+ import DotRequest, { default as DotRequest$1 } from "dot-request";
3
+ import { ArrayStore, AsyncValidator, AsyncValidator as AsyncValidator$1, ObjectStore, Schema, Schema as Schema$1, Store, Store as Store$1, StoreLayout, StoreLayout as StoreLayout$1, Validator, Validator as Validator$1, renderStore } from "@neeloong/form";
4
+ import { BootConfiguration, Hook, Indicator, Plugin, Search } from "@yongdall/common";
5
+ import { Field, MaybePromise, Permission } from "@yongdall/types";
6
+ import { Signal as Signal$1 } from "signal-polyfill";
7
+ export * from "@yongdall/common";
8
+
9
+ //#region \0rolldown/runtime.js
10
+ //#endregion
11
+ //#region packages/web/signal.d.mts
12
+ /**
13
+ * @template T
14
+ * @typedef {object} State
15
+ * @property {() => T} get
16
+ * @property {(newValue: T) => void} set
17
+ */
18
+ /**
19
+ * 相应式执行
20
+ * @param {() => void} fn 执行函数
21
+ * @param {AbortSignal} [signal]
22
+ * @returns {void}
23
+ */
24
+ declare function effect(fn: () => void, signal?: AbortSignal): void;
25
+ /**
26
+ * 创建可赋值计算值
27
+ * @template T
28
+ * @overload
29
+ * @param {(() => T)[]} getter 取值方法
30
+ * @param {(value: T[]) => void} callback 取值方法
31
+ * @param {object} [options]
32
+ * @param {boolean} [options.immediate] 是否立即执行一次
33
+ * @param {AbortSignal} [options.signal]
34
+ * @returns {void}
35
+ */
36
+ declare function watch<T>(getter: (() => T)[], callback: (value: T[]) => void, options?: {
37
+ immediate?: boolean | undefined;
38
+ signal?: AbortSignal | undefined;
39
+ } | undefined): void;
40
+ /**
41
+ * 创建可赋值计算值
42
+ * @template T
43
+ * @overload
44
+ * @param {() => T} getter 取值方法
45
+ * @param {(value: T) => void} callback 取值方法
46
+ * @param {object} [options]
47
+ * @param {boolean} [options.immediate] 是否立即执行一次
48
+ * @param {AbortSignal} [options.signal]
49
+ * @returns {void}
50
+ */
51
+ declare function watch<T>(getter: () => T, callback: (value: T) => void, options?: {
52
+ immediate?: boolean | undefined;
53
+ signal?: AbortSignal | undefined;
54
+ } | undefined): void;
55
+ /**
56
+ * @template T
57
+ * @overload
58
+ * @param {T} initValue
59
+ * @returns {State<T>}
60
+ */
61
+ declare function createState<T>(initValue: T): State<T>;
62
+ /**
63
+ * @template T
64
+ * @overload
65
+ * @param {T} [initValue]
66
+ * @returns {State<T | undefined>}
67
+ */
68
+ declare function createState<T>(initValue?: T | undefined): State<T | undefined>;
69
+ /**
70
+ *
71
+ * @template T
72
+ * @param {() => T} get
73
+ * @param {(newValue: T) => void} [set]
74
+ * @returns {State<T>}
75
+ */
76
+ declare function createComputed<T>(get: () => T, set?: (newValue: T) => void): State<T>;
77
+ type State<T> = {
78
+ get: () => T;
79
+ set: (newValue: T) => void;
80
+ };
81
+ //#endregion
82
+ //#region packages/web/route/home.d.mts
83
+ declare class HomeContext {
84
+ get container(): HTMLDivElement;
85
+ get current(): boolean;
86
+ get home(): boolean;
87
+ get search(): string;
88
+ get hash(): string;
89
+ /**
90
+ *
91
+ * @param {string} url
92
+ * @param {boolean} replace
93
+ */
94
+ open(url: string, replace: boolean): void;
95
+ /**
96
+ *
97
+ * @param {'update' | 'destroy'} event
98
+ * @param {() => void} listen
99
+ * @returns {() => void}
100
+ */
101
+ listen(event: "update" | "destroy", listen: () => void): () => void;
102
+ }
103
+ type Trigger = (show: boolean) => void;
104
+ type PageInfo = {
105
+ toggle: Trigger;
106
+ hide: () => void;
107
+ };
108
+ //#endregion
109
+ //#region packages/web/GeneralContext.d.mts
110
+ declare class GeneralContext {
111
+ /**
112
+ *
113
+ * @param {AbortSignal} [signal]
114
+ */
115
+ constructor(signal?: AbortSignal);
116
+ get destroyed(): boolean;
117
+ get signal(): AbortSignal;
118
+ #private;
119
+ }
120
+ //#endregion
121
+ //#region packages/web/Menu.d.mts
122
+ /**
123
+ * 菜单显示
124
+ */
125
+ type Menu = {
126
+ /**
127
+ * 外观:标签
128
+ */
129
+ label?: string | undefined;
130
+ /**
131
+ * 外观:图标
132
+ */
133
+ icon?: string | undefined;
134
+ /**
135
+ * 外观:图片
136
+ */
137
+ image?: string | undefined;
138
+ /**
139
+ * 外观:颜色
140
+ */
141
+ color?: string | undefined;
142
+ /**
143
+ * 外观:标题
144
+ */
145
+ title?: string | undefined;
146
+ /**
147
+ * 外观:描述
148
+ */
149
+ description?: string | undefined;
150
+ /**
151
+ * 引用类型:分组(group)、模块(module)、内置(builtin)
152
+ */
153
+ refType?: string | undefined;
154
+ /**
155
+ * 引用ID
156
+ */
157
+ refId?: string | undefined;
158
+ /**
159
+ * 引用模式:展开/子菜单
160
+ *
161
+ * 菜单操作
162
+ */
163
+ refMode?: string | undefined;
164
+ /**
165
+ * 页面
166
+ */
167
+ page?: string | undefined;
168
+ /**
169
+ * 页面路径
170
+ */
171
+ path?: string | undefined;
172
+ /**
173
+ * URI
174
+ */
175
+ uri?: string | undefined;
176
+ /**
177
+ * URI打开目标窗口
178
+ */
179
+ target?: string | undefined;
180
+ /**
181
+ * 指令
182
+ */
183
+ command?: string | undefined;
184
+ /**
185
+ * 脚本
186
+ */
187
+ script?: string | undefined;
188
+ /**
189
+ * 点击事件
190
+ */
191
+ click?: (() => void) | undefined;
192
+ /**
193
+ * 点击事件
194
+ */
195
+ disabled?: boolean | (() => boolean) | undefined;
196
+ /**
197
+ * 三方扩展
198
+ */
199
+ logged?: boolean | undefined;
200
+ /**
201
+ * 自动登录
202
+ */
203
+ autoLogin?: boolean | undefined;
204
+ /**
205
+ * 关联应用
206
+ */
207
+ appId?: string | undefined;
208
+ children: (Menu | null)[];
209
+ buttons: Menu.Button[];
210
+ /**
211
+ * 权限
212
+ */
213
+ permission?: string | undefined;
214
+ /**
215
+ * 折叠
216
+ */
217
+ collapsed?: boolean | undefined;
218
+ };
219
+ declare namespace Menu {
220
+ type Button = {
221
+ /**
222
+ * 外观:标签
223
+ */
224
+ label?: string | undefined;
225
+ /**
226
+ * 外观:图标
227
+ */
228
+ icon?: string | undefined;
229
+ /**
230
+ * 外观:图片
231
+ */
232
+ image?: string | undefined;
233
+ /**
234
+ * 外观:颜色
235
+ */
236
+ color?: string | undefined;
237
+ /**
238
+ * 外观:标题
239
+ */
240
+ title?: string | undefined;
241
+ /**
242
+ * 外观:描述
243
+ */
244
+ description?: string | undefined;
245
+ /**
246
+ * 引用类型:分组(group)、模块(module)、内置(builtin)
247
+ */
248
+ refType?: string | undefined;
249
+ /**
250
+ * 引用ID
251
+ */
252
+ refId?: string | undefined;
253
+ /**
254
+ * 引用模式:展开/子菜单
255
+ *
256
+ * 菜单操作
257
+ */
258
+ refMode?: string | undefined;
259
+ /**
260
+ * 页面
261
+ */
262
+ page?: string | undefined;
263
+ /**
264
+ * 页面路径
265
+ */
266
+ path?: string | undefined;
267
+ /**
268
+ * URI
269
+ */
270
+ uri?: string | undefined;
271
+ /**
272
+ * URI打开目标窗口
273
+ */
274
+ target?: string | undefined;
275
+ /**
276
+ * 指令
277
+ */
278
+ command?: string | undefined;
279
+ /**
280
+ * 脚本
281
+ */
282
+ script?: string | undefined;
283
+ /**
284
+ * 点击事件
285
+ */
286
+ click?: (() => void) | undefined;
287
+ /**
288
+ * 点击事件
289
+ *
290
+ * 三方扩展
291
+ */
292
+ disabled?: boolean | (() => boolean) | undefined;
293
+ /**
294
+ * 自动登录
295
+ */
296
+ autoLogin?: boolean | undefined;
297
+ /**
298
+ * 关联应用
299
+ */
300
+ appId?: string | undefined;
301
+ /**
302
+ * 权限
303
+ */
304
+ permission?: string | undefined;
305
+ };
306
+ type Define = {
307
+ groupType?: string | undefined;
308
+ group?: string | undefined;
309
+ no?: number | undefined;
310
+ type: "" | "button" | "divider";
311
+ /**
312
+ * 菜单显示
313
+ */
314
+ level: number;
315
+ /**
316
+ * 外观:标签
317
+ */
318
+ label?: string | undefined;
319
+ /**
320
+ * 外观:图标
321
+ */
322
+ icon?: string | undefined;
323
+ /**
324
+ * 外观:图片
325
+ */
326
+ image?: string | undefined;
327
+ /**
328
+ * 外观:颜色
329
+ */
330
+ color?: string | undefined;
331
+ /**
332
+ * 外观:标题
333
+ */
334
+ title?: string | undefined;
335
+ /**
336
+ * 外观:描述
337
+ */
338
+ description?: string | undefined;
339
+ /**
340
+ * 连接:引用类型:分组(group)、模块(module)、内置(builtin)
341
+ */
342
+ refType?: string | undefined;
343
+ /**
344
+ * 连接:引用ID
345
+ */
346
+ refId?: string | undefined;
347
+ /**
348
+ * 连接:引用模式:展开/子菜单
349
+ *
350
+ * 菜单操
351
+ */
352
+ refMode?: string | undefined;
353
+ /**
354
+ * 连接:页面
355
+ */
356
+ page?: string | undefined;
357
+ /**
358
+ * 连接:页面路径
359
+ */
360
+ path?: string | undefined;
361
+ /**
362
+ * 连接:URI
363
+ */
364
+ uri?: string | undefined;
365
+ /**
366
+ * 连接:URI打开目标窗口
367
+ */
368
+ target?: string | undefined;
369
+ command?: string | undefined;
370
+ script?: string | undefined;
371
+ /**
372
+ * 点击事件
373
+ */
374
+ click?: (() => void) | undefined;
375
+ /**
376
+ * 点击事件
377
+ */
378
+ disabled?: boolean | (() => boolean) | undefined;
379
+ /**
380
+ * 三方扩展:自动登录
381
+ */
382
+ autoLogin?: boolean | undefined;
383
+ /**
384
+ * 三方扩展:关联应用
385
+ */
386
+ appId?: string | undefined;
387
+ /**
388
+ * 权限
389
+ */
390
+ permission?: string | undefined;
391
+ /**
392
+ * 折叠
393
+ */
394
+ collapsed?: boolean | undefined;
395
+ };
396
+ type Renderer = (menu: Menu, signal: AbortSignal) => HTMLElement | null;
397
+ }
398
+ //#endregion
399
+ //#region packages/web/route/PageSider.d.mts
400
+ declare class PageSider extends GeneralContext {
401
+ /**
402
+ *
403
+ * @param {ParentNode} parent
404
+ * @param {Node?} next
405
+ * @param {boolean} inserted
406
+ * @param {AbortSignal} signal
407
+ * @returns
408
+ */
409
+ constructor(parent: ParentNode, next: Node | null, inserted: boolean, signal: AbortSignal);
410
+ get container(): HTMLDivElement;
411
+ set panel(panel: boolean);
412
+ get panel(): boolean;
413
+ set title(t: string);
414
+ get title(): string;
415
+ /**
416
+ *
417
+ * @param {(Menu | null)[]} menus
418
+ * @param {Menu?} button
419
+ * @param {Menu.Renderer} [create]
420
+ * @returns
421
+ */
422
+ setMenu(menus: (Menu | null)[], button: Menu | null, create?: Menu.Renderer): void;
423
+ get inserted(): boolean;
424
+ insert(): void;
425
+ remove(): void;
426
+ #private;
427
+ }
428
+ //#endregion
429
+ //#region packages/web/route/PageHeader.d.mts
430
+ declare class PageHeader extends GeneralContext {
431
+ /**
432
+ *
433
+ * @param {HTMLElement} root
434
+ * @param {AbortSignal} [signal]
435
+ * @returns
436
+ */
437
+ constructor(root: HTMLElement, signal?: AbortSignal);
438
+ get container(): HTMLDivElement;
439
+ /**
440
+ *
441
+ * @param {*} menus
442
+ * @param {Menu.Renderer} [create]
443
+ * @returns
444
+ */
445
+ setMenu(menus: any, create?: Menu.Renderer): void;
446
+ #private;
447
+ }
448
+ //#endregion
449
+ //#region packages/web/route/PageFooter.d.mts
450
+ declare class PageFooter extends GeneralContext {
451
+ /**
452
+ *
453
+ * @param {HTMLElement} root
454
+ * @param {AbortSignal} [signal]
455
+ * @returns
456
+ */
457
+ constructor(root: HTMLElement, signal?: AbortSignal);
458
+ get container(): HTMLDivElement;
459
+ #private;
460
+ }
461
+ //#endregion
462
+ //#region packages/web/route/PageSection.d.mts
463
+ declare class PageSection extends GeneralContext {
464
+ /**
465
+ *
466
+ * @param {ParentNode} parent
467
+ * @param {Node?} next
468
+ * @param {boolean} inserted
469
+ * @param {AbortSignal} signal
470
+ * @returns
471
+ */
472
+ constructor(parent: ParentNode, next: Node | null, inserted: boolean, signal: AbortSignal);
473
+ get container(): HTMLDivElement;
474
+ set panel(panel: boolean);
475
+ get panel(): boolean;
476
+ get inserted(): boolean;
477
+ insert(): void;
478
+ remove(): void;
479
+ #private;
480
+ }
481
+ //#endregion
482
+ //#region packages/web/route/Page.d.mts
483
+ declare class Page {
484
+ /**
485
+ *
486
+ * @param {boolean} show
487
+ */
488
+ constructor(show: boolean);
489
+ get destroyed(): boolean;
490
+ get container(): HTMLDivElement;
491
+ set mode(mode: "scroll" | "flex");
492
+ get mode(): "scroll" | "flex";
493
+ set panel(panel: boolean);
494
+ get panel(): boolean;
495
+ get show(): boolean;
496
+ /**
497
+ *
498
+ * @param {boolean} show
499
+ */
500
+ toggle(show: boolean): void;
501
+ destroy(): boolean;
502
+ /**
503
+ *
504
+ * @param {AbortSignal} [signal]
505
+ * @returns
506
+ */
507
+ createHeader(signal?: AbortSignal): PageHeader | null;
508
+ /**
509
+ *
510
+ * @param {AbortSignal} [signal]
511
+ * @returns
512
+ */
513
+ createFooter(signal?: AbortSignal): PageFooter | null;
514
+ /**
515
+ *
516
+ * @param {'start' | 'end' | 'before' | 'after'} position
517
+ * @param {boolean} [inserted]
518
+ * @param {AbortSignal} [signal]
519
+ * @returns {PageSection?}
520
+ */
521
+ createSection(position: "start" | "end" | "before" | "after", inserted?: boolean, signal?: AbortSignal): PageSection | null;
522
+ get signal(): AbortSignal;
523
+ set siderOpen(open: boolean);
524
+ get siderOpen(): boolean;
525
+ /**
526
+ *
527
+ * @param {boolean} [inserted]
528
+ * @param {AbortSignal} [signal]
529
+ * @returns {PageSider?}
530
+ */
531
+ createSider(inserted?: boolean, signal?: AbortSignal): PageSider | null;
532
+ #private;
533
+ }
534
+ //#endregion
535
+ //#region packages/web/services/page.d.mts
536
+ type PageConfiguration = {
537
+ id?: string | undefined;
538
+ model?: string | undefined;
539
+ user?: string | undefined;
540
+ organization?: string | undefined;
541
+ workspace?: string | undefined;
542
+ page?: string | undefined;
543
+ widget: string;
544
+ title: string;
545
+ titlePattern: string;
546
+ config: Record<string, any>;
547
+ fields: {
548
+ field?: string;
549
+ label?: string;
550
+ width?: number;
551
+ pattern?: string;
552
+ }[];
553
+ sides: {
554
+ widget: string;
555
+ options: string;
556
+ }[];
557
+ menuButtons: Menu.Button[];
558
+ menus: (Menu | null)[];
559
+ forms: Record<string, {
560
+ layoutId?: string;
561
+ } | null>;
562
+ where?: Search.AndList | undefined;
563
+ orWhere?: Search.OrList | undefined;
564
+ defaultQuery?: string | undefined;
565
+ /**
566
+ * // TODO: 是否分页
567
+ */
568
+ filters?: {
569
+ field: string;
570
+ label?: string;
571
+ operator: string;
572
+ }[] | undefined;
573
+ };
574
+ //#endregion
575
+ //#region packages/web/route/route.d.mts
576
+ type PageIdent = PageIdent.Model | PageIdent.Organization | PageIdent.User | PageIdent.Workspace | PageIdent.Page | PageIdent.Configuration;
577
+ declare namespace PageIdent {
578
+ type Router = {
579
+ stringify: PageIdent.Stringify;
580
+ parse: PageIdent.Parser;
581
+ };
582
+ type Model = {
583
+ type: "model";
584
+ model: string;
585
+ organization?: null | undefined;
586
+ user?: null | undefined;
587
+ error?: null | undefined;
588
+ page?: null | undefined;
589
+ workspace?: string | null | undefined;
590
+ continuation?: string | undefined;
591
+ setting?: boolean | undefined;
592
+ edit?: boolean | undefined;
593
+ id?: string | undefined;
594
+ input?: string | undefined;
595
+ };
596
+ type Organization = {
597
+ type: "organization";
598
+ model?: null | undefined;
599
+ organization: string;
600
+ user?: null | undefined;
601
+ error?: null | undefined;
602
+ page?: null | undefined;
603
+ workspace?: string | null | undefined;
604
+ continuation?: string | undefined;
605
+ setting?: boolean | undefined;
606
+ edit?: boolean | undefined;
607
+ id?: string | undefined;
608
+ input?: string | undefined;
609
+ };
610
+ type User = {
611
+ type: "user";
612
+ model?: null | undefined;
613
+ organization?: null | undefined;
614
+ user: string;
615
+ error?: null | undefined;
616
+ page?: null | undefined;
617
+ workspace?: string | null | undefined;
618
+ continuation?: string | undefined;
619
+ setting?: boolean | undefined;
620
+ edit?: boolean | undefined;
621
+ id?: string | undefined;
622
+ input?: string | undefined;
623
+ };
624
+ type Workspace = {
625
+ type: "workspace";
626
+ model?: null | undefined;
627
+ organization?: null | undefined;
628
+ user?: null | undefined;
629
+ error?: null | undefined;
630
+ page?: null | undefined;
631
+ workspace: string;
632
+ continuation?: string | undefined;
633
+ setting?: boolean | undefined;
634
+ edit?: boolean | undefined;
635
+ id?: string | undefined;
636
+ input?: string | undefined;
637
+ };
638
+ type Configuration = {
639
+ type: "configuration";
640
+ model?: null | undefined;
641
+ organization?: null | undefined;
642
+ user?: null | undefined;
643
+ error?: null | undefined;
644
+ page?: null | undefined;
645
+ workspace?: null | undefined;
646
+ continuation: string;
647
+ setting?: boolean | undefined;
648
+ edit?: boolean | undefined;
649
+ id?: string | undefined;
650
+ input?: string | undefined;
651
+ };
652
+ type Page = {
653
+ type: "todo" | "settings" | "search" | "status" | "devtools" | "home";
654
+ continuation?: null | undefined;
655
+ };
656
+ type Route = {
657
+ page: PageIdent;
658
+ pageRoot: string;
659
+ path: string;
660
+ redirect: boolean;
661
+ };
662
+ type Stringify = (pageIdent: PageIdent) => string;
663
+ type Parser = (path: string) => PageIdent.Route;
664
+ }
665
+ //#endregion
666
+ //#region packages/web/services/model.d.mts
667
+ /**
668
+ *
669
+ * @param {string} model
670
+ * @returns
671
+ */
672
+ declare function modelService(model: string): {
673
+ then<TResult1 = ModelConfiguration, TResult2 = never>(onfulfilled?: ((value: ModelConfiguration) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
674
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<ModelConfiguration | TResult2>;
675
+ finally(onfinally?: (() => void) | null | undefined): Promise<ModelConfiguration>;
676
+ /**
677
+ * @param {Search.Param} [options]
678
+ * @returns {Promise<{documents: any[]; total: number}>}
679
+ */
680
+ query({
681
+ values,
682
+ where,
683
+ orWhere,
684
+ sort,
685
+ limit,
686
+ page,
687
+ offset,
688
+ select
689
+ }?: Search.Param): Promise<{
690
+ documents: any[];
691
+ total: number;
692
+ }>;
693
+ getOptions(): Record<string, any>[] | never[];
694
+ /**
695
+ * @overload
696
+ * @param {boolean} [options]
697
+ * @returns {Promise<Record<string, any>[]>}
698
+ */
699
+ options(options?: boolean | undefined): Promise<Record<string, any>[]>;
700
+ /**
701
+ * @overload
702
+ * @param {object} options
703
+ * @param {any[]} [options.matches]
704
+ * @param {string} [options.query]
705
+ * @param {number} [options.page]
706
+ * @param {number} [options.limit]
707
+ * @param {number} [options.offset]
708
+ * @param {string[]} [options.select]
709
+ * @returns {Promise<Record<string, any>[]>}
710
+ */
711
+ options(options: {
712
+ matches?: any[] | undefined;
713
+ query?: string | undefined;
714
+ page?: number | undefined;
715
+ limit?: number | undefined;
716
+ offset?: number | undefined;
717
+ select?: string[] | undefined;
718
+ }): Promise<Record<string, any>[]>;
719
+ /**
720
+ *
721
+ * @param {string | number} id
722
+ */
723
+ option(id: string | number): Promise<any>;
724
+ /**
725
+ *
726
+ * @param {Record<string, any>} data
727
+ * @returns
728
+ */
729
+ create(data: Record<string, any>): Promise<any>;
730
+ /**
731
+ *
732
+ * @param {string | number} id
733
+ */
734
+ document(id: string | number): {
735
+ then<TResult1 = Record<string, any>, TResult2 = never>(onfulfilled?: ((value: Record<string, any>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
736
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any> | TResult2>;
737
+ finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>>;
738
+ get: () => Promise<Record<string, any>>;
739
+ /**
740
+ * @param {Record<string, any>} data
741
+ * @returns
742
+ */
743
+ update(data: Record<string, any>): Promise<any>;
744
+ delete(): Promise<any>; /** @param {string} field */
745
+ field(field: string): {
746
+ then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
747
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<any>;
748
+ finally(onfinally?: (() => void) | null | undefined): Promise<any>;
749
+ get: () => Promise<any>;
750
+ };
751
+ };
752
+ loadModel: (force?: boolean) => Promise<ModelConfiguration>;
753
+ loadScript: (force?: boolean) => Promise<ModelScriptConfiguration>;
754
+ getModel: () => ModelConfiguration | null;
755
+ getScript: () => ModelScriptConfiguration | null;
756
+ page: (page: string, workspace?: string | null) => {
757
+ load: (force?: boolean) => Promise<PageConfiguration>;
758
+ /**
759
+ * @template [TResult1=PageConfiguration]
760
+ * @template [TResult2=never]
761
+ * @param {((value: PageConfiguration) => TResult1 | PromiseLike<TResult1>)?} [onfulfilled]
762
+ * @param {((reason: any) => TResult2 | PromiseLike<TResult2>)?} [onrejected]
763
+ * @returns {Promise<TResult1 | TResult2>};
764
+ */
765
+ then<TResult1 = PageConfiguration, TResult2 = never>(onfulfilled?: ((value: PageConfiguration) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
766
+ configuration(): Promise<false | Record<string, any>>;
767
+ };
768
+ };
769
+ type ModelConfiguration = {
770
+ id?: string | undefined;
771
+ label?: string | undefined;
772
+ /**
773
+ * 字段配置
774
+ */
775
+ fields: Record<string, Field>;
776
+ /**
777
+ * 图标字段
778
+ */
779
+ iconField?: string | null | undefined;
780
+ /**
781
+ * 图像字段
782
+ */
783
+ imageField?: string | null | undefined;
784
+ /**
785
+ * 标签字段
786
+ */
787
+ labelField?: string | null | undefined;
788
+ /**
789
+ * 标签命名规则
790
+ */
791
+ labelPattern?: string | null | undefined;
792
+ /**
793
+ * 权限配置
794
+ */
795
+ permissions?: Permission[] | undefined;
796
+ /**
797
+ * 模型选项,关联前端脚本可读取
798
+ */
799
+ options?: Record<string, unknown> | null | undefined;
800
+ /**
801
+ * 关联前端脚本
802
+ * // TODO: 查询配置
803
+ * // TODO: 前端按钮配置
804
+ * // TODO: 是否可销毁、可创建、更新、保存、upsert
805
+ * // TODO: 列表内操作按钮
806
+ * // TODO: 编辑内按钮
807
+ * // TODO: 操作事件
808
+ * // TODO: 是否分页
809
+ */
810
+ scripts?: (string | [string, object])[] | null | undefined;
811
+ };
812
+ type FieldScriptConfiguration = Omit<Field, "scripts" | "type"> & {
813
+ script?: Omit<FieldScript, "subFields">;
814
+ type: string | Record<string, FieldScriptConfiguration>;
815
+ };
816
+ type ModelScriptConfiguration = Omit<ModelConfiguration, "scripts" | "fields"> & {
817
+ script?: Omit<ModelScript, "fields">;
818
+ fields: Record<string, FieldScriptConfiguration>;
819
+ };
820
+ type ListScriptParameter = {
821
+ model: ModelScriptConfiguration;
822
+ checkedDocuments?: Record<string, any>[] | undefined;
823
+ documents?: Record<string, any>[] | undefined;
824
+ };
825
+ type DocumentScriptParameter = {
826
+ model: ModelScriptConfiguration;
827
+ document?: Record<string, any> | undefined;
828
+ store?: Store$1<any, any> | undefined;
829
+ };
830
+ type ModelScript = {
831
+ /**
832
+ * 字段配置
833
+ */
834
+ fields?: Record<string, FieldScript> | undefined;
835
+ input?: ((document: any, ...fields: (string | number)[]) => void) | null | undefined;
836
+ change?: ((document: any, ...fields: (string | number)[]) => void) | null | undefined;
837
+ beforeCreate?: ((document: any) => void) | null | undefined;
838
+ beforeUpdate?: ((document: any) => void) | null | undefined;
839
+ beforeSave?: ((document: any) => void) | null | undefined;
840
+ beforeDestroy?: ((document: any) => void) | null | undefined;
841
+ beforeUpsert?: ((document: any) => void) | null | undefined;
842
+ listScripts?: Record<string, (params: ListScriptParameter) => void> | undefined;
843
+ documentScripts?: Record<string, (params: DocumentScriptParameter) => void> | undefined;
844
+ };
845
+ type FieldScript = {
846
+ /**
847
+ * 子字段配置
848
+ */
849
+ subFields?: Record<string, FieldScript> | undefined;
850
+ component?: FieldComponent<Record<string, any>> | undefined;
851
+ input?: ((value: InputEvent, store: Store$1) => void | boolean | null) | null | undefined;
852
+ change?: ((value: InputEvent, store: Store$1) => void | boolean | null) | null | undefined;
853
+ click?: ((value: Event, store: Store$1) => void | boolean | null) | null | undefined;
854
+ focus?: ((value: Event, store: Store$1) => void | boolean | null) | null | undefined;
855
+ blur?: ((value: Event, store: Store$1) => void | boolean | null) | null | undefined;
856
+ add?: ((document: any, field: string, ...fields: (string | number)[]) => void | object) | null | undefined;
857
+ remove?: ((value: any[], document: any, field: string, ...fields: (string | number)[]) => void) | null | undefined;
858
+ move?: ((from: number[], to: number, document: any, field: string, ...fields: (string | number)[]) => void) | null | undefined;
859
+ readonly?: ((store: Store$1) => boolean) | null | undefined;
860
+ hidden?: ((store: Store$1) => boolean) | null | undefined;
861
+ required?: ((store: Store$1) => boolean) | null | undefined;
862
+ clearable?: ((store: Store$1) => boolean) | null | undefined;
863
+ disabled?: ((store: Store$1) => boolean) | null | undefined;
864
+ default?: ((store: Store$1) => any) | null | undefined;
865
+ label?: ((store: Store$1) => string) | null | undefined;
866
+ description?: ((store: Store$1) => string) | null | undefined;
867
+ placeholder?: ((store: Store$1) => string) | null | undefined;
868
+ step?: ((store: Store$1) => string) | null | undefined;
869
+ max?: ((store: Store$1) => string) | null | undefined;
870
+ min?: ((store: Store$1) => string) | null | undefined;
871
+ validator?: Validator$1 | Validator$1[] | null | undefined;
872
+ validators?: {
873
+ input?: AsyncValidator$1 | AsyncValidator$1[] | null | undefined;
874
+ change?: AsyncValidator$1 | AsyncValidator$1[] | null | undefined;
875
+ click?: AsyncValidator$1 | AsyncValidator$1[] | null | undefined;
876
+ focus?: AsyncValidator$1 | AsyncValidator$1[] | null | undefined;
877
+ blur?: AsyncValidator$1 | AsyncValidator$1[] | null | undefined;
878
+ } | undefined;
879
+ };
880
+ //#endregion
881
+ //#region packages/web/route/PageHandle.d.mts
882
+ /**
883
+ * @typedef {object} RootPageExt
884
+ * @property {(path: string,search: string, hash: string) => void} update
885
+ */
886
+ declare class PageHandle extends GeneralContext {
887
+ /**
888
+ *
889
+ * @param {Object} options
890
+ * @param {string} options.pageId
891
+ * @param {PageConfiguration?} options.define
892
+ * @param {PageIdent} options.ident
893
+ * @param {string} options.root
894
+ * @param {string} options.path
895
+ * @param {string} options.search
896
+ * @param {string} options.hash
897
+ * @param {PageInfo & RootPageExt} options.pageHandler
898
+ * @param {(url: string, replace?: boolean) => void} options.open
899
+ * @param {(p: string, replace?: boolean) => void} options.setRootPath
900
+ */
901
+ constructor({
902
+ pageId,
903
+ define,
904
+ ident,
905
+ root,
906
+ path,
907
+ search,
908
+ hash,
909
+ pageHandler,
910
+ open,
911
+ setRootPath
912
+ }: {
913
+ pageId: string;
914
+ define: PageConfiguration | null;
915
+ ident: PageIdent;
916
+ root: string;
917
+ path: string;
918
+ search: string;
919
+ hash: string;
920
+ pageHandler: PageInfo & RootPageExt;
921
+ open: (url: string, replace?: boolean) => void;
922
+ setRootPath: (p: string, replace?: boolean) => void;
923
+ });
924
+ set title(title: string);
925
+ get title(): string;
926
+ /**
927
+ *
928
+ * @param {(show: boolean) => void} fn
929
+ * @param {AbortSignal} signal
930
+ */
931
+ onToggle(fn: (show: boolean) => void, signal: AbortSignal): void;
932
+ get bootLoading(): boolean;
933
+ get define(): PageConfiguration | null;
934
+ get ident(): PageIdent;
935
+ get root(): string;
936
+ get path(): string;
937
+ get search(): string;
938
+ get hash(): string;
939
+ get href(): string;
940
+ get current(): boolean;
941
+ get shown(): boolean;
942
+ set unsaved(unsaved: boolean);
943
+ get unsaved(): boolean;
944
+ set loading(loading: boolean);
945
+ get loading(): boolean;
946
+ /**
947
+ * @param {string} url
948
+ * @param {string | PageIdent} [page]
949
+ * @returns {string}
950
+ */
951
+ toUrl(url: string, page?: string | PageIdent): string;
952
+ /**
953
+ * @overload
954
+ * @param {string} url
955
+ * @param {boolean} [replace]
956
+ * @returns {void}
957
+ */
958
+ open(url: string, replace?: boolean | undefined): void;
959
+ /**
960
+ * @overload
961
+ * @param {string} url
962
+ * @param {string | PageIdent} [page]
963
+ * @param {boolean} [replace]
964
+ * @returns {void}
965
+ */
966
+ open(url: string, page?: string | PageIdent | undefined, replace?: boolean | undefined): void;
967
+ /**
968
+ * @overload
969
+ * @param {string} url
970
+ * @param {boolean | string | PageIdent} [page]
971
+ * @param {boolean} [replace]
972
+ * @returns {void}
973
+ */
974
+ open(url: string, page?: string | boolean | PageIdent | undefined, replace?: boolean | undefined): void;
975
+ /**
976
+ *
977
+ * @param {string} p
978
+ * @param {boolean} [replace]
979
+ * @returns {void}
980
+ */
981
+ setPath(p: string, replace?: boolean): void;
982
+ /**
983
+ *
984
+ * @param {boolean} [replace]
985
+ * @returns {void}
986
+ */
987
+ show(replace?: boolean): void;
988
+ get destroyDeferred(): boolean;
989
+ /**
990
+ * @param {boolean} [defer]
991
+ * @returns {boolean}
992
+ */
993
+ destroy(defer?: boolean): boolean;
994
+ #private;
995
+ }
996
+ type RootPageExt = {
997
+ update: (path: string, search: string, hash: string) => void;
998
+ };
999
+ //#endregion
1000
+ //#region packages/web/route/pageManager.d.mts
1001
+ /**
1002
+ *
1003
+ * @param {PageManager} manager
1004
+ * @returns
1005
+ */
1006
+ declare function addManager(manager: PageManager): () => void;
1007
+ declare function getPages(): PageHandle[];
1008
+ /**
1009
+ * 页面管理器
1010
+ */
1011
+ type PageManager = (page: PageHandle) => void;
1012
+ //#endregion
1013
+ //#region packages/web/user.d.mts
1014
+ /**
1015
+ * 用户类型定义
1016
+ */
1017
+ type User = {
1018
+ /**
1019
+ * - 用户ID
1020
+ */
1021
+ id: string;
1022
+ /**
1023
+ * - 显示名称
1024
+ */
1025
+ name: string;
1026
+ /**
1027
+ * - 用户头像
1028
+ */
1029
+ avatar?: string | undefined;
1030
+ permissions?: string[] | undefined;
1031
+ organizationPermissions?: Record<string, string[]> | undefined;
1032
+ organizationRoles?: Record<string, string[]> | undefined;
1033
+ organizationRolePermissions?: Record<string, string[]> | undefined;
1034
+ plugins?: Record<string, Record<string, any>> | undefined;
1035
+ };
1036
+ declare namespace User {
1037
+ const session: User | null;
1038
+ const target: User | null;
1039
+ const current: User | null;
1040
+ const permissions: Set<string> | null;
1041
+ const organizationPermissions: Record<string, Set<string>> | null;
1042
+ const allOrganizationPermissions: Set<string> | null;
1043
+ const waitLogin: boolean;
1044
+ /**
1045
+ * @template {Record<string, any>} T
1046
+ * @param {string} pluginId
1047
+ * @returns {{ readonly session: T?; readonly target: T?; readonly current: T?}}
1048
+ */
1049
+ function plugin<T extends Record<string, any>>(pluginId: string): {
1050
+ readonly session: T | null;
1051
+ readonly target: T | null;
1052
+ readonly current: T | null;
1053
+ };
1054
+ function load(): Promise<boolean>;
1055
+ function exit(): void;
1056
+ function login(login?: boolean): void;
1057
+ }
1058
+ //#endregion
1059
+ //#region packages/web/Command.d.mts
1060
+ /**
1061
+ * 命令接口
1062
+ */
1063
+ type Command = {
1064
+ disabled: (options: Command.Options, menu: Menu, command: string) => boolean;
1065
+ toHref: (options: Command.Options, menu: Menu, command: string) => string;
1066
+ exec: (options: Command.Options, menu: Menu, command: string) => void;
1067
+ };
1068
+ declare const Command: {
1069
+ /**
1070
+ *
1071
+ * @param {Command.Options} options
1072
+ * @param {Menu} menu
1073
+ * @returns {boolean}
1074
+ */
1075
+ disabled(options: Command.Options, menu: Menu): boolean;
1076
+ /**
1077
+ *
1078
+ * @param {Command.Options} options
1079
+ * @param {Menu} menu
1080
+ * @returns {string}
1081
+ */
1082
+ toHref(options: Command.Options, menu: Menu): string;
1083
+ /**
1084
+ *
1085
+ * @param {Command.Options} options
1086
+ * @param {Menu} menu
1087
+ * @returns {void}
1088
+ */
1089
+ exec(options: Command.Options, menu: Menu): void;
1090
+ };
1091
+ declare namespace Command {
1092
+ /**
1093
+ * 命令选项
1094
+ */
1095
+ type Options = {
1096
+ type: "documents" | "document" | "createDocument" | "editDocument";
1097
+ model?: ModelScriptConfiguration | undefined;
1098
+ pageIdent?: PageIdent | undefined;
1099
+ document?: Record<string, any> | undefined;
1100
+ documents?: Record<string, any>[] | undefined;
1101
+ checkedDocuments?: Record<string, any>[] | undefined;
1102
+ store?: Store$1<any, any> | undefined;
1103
+ };
1104
+ }
1105
+ //#endregion
1106
+ //#region packages/web/typesDefine.d.mts
1107
+ interface VerifyError {
1108
+ focus(): void;
1109
+ stop: boolean;
1110
+ title: string;
1111
+ }
1112
+ interface VerifyContext {
1113
+ waitUntil(promise: PromiseLike<void>): void;
1114
+ error(p: VerifyError): void;
1115
+ }
1116
+ interface FieldComponentEvent {
1117
+ focus(): void;
1118
+ scrollIntoView(): void;
1119
+ }
1120
+ interface FieldContext {
1121
+ readonly store?: Store$1;
1122
+ readonly style: FieldStyle;
1123
+ readonly field?: FieldScriptConfiguration;
1124
+ readonly name: string | number;
1125
+ value: any;
1126
+ readonly current: any;
1127
+ readonly destroyed: boolean;
1128
+ readonly readonly: boolean;
1129
+ readonly editable: boolean;
1130
+ readonly required: boolean;
1131
+ readonly nullable: boolean;
1132
+ readonly disabled: boolean;
1133
+ readonly clearable: boolean;
1134
+ readonly hidden: boolean;
1135
+ readonly label: string;
1136
+ readonly placeholder: string;
1137
+ readonly description: string;
1138
+ readonly signal: AbortSignal;
1139
+ listen<K extends keyof FieldComponentEvent>(event: K, listen: FieldComponentEvent[K]): () => void;
1140
+ emit(event: string, e: any): void;
1141
+ }
1142
+ interface FieldComponent<T extends Record<string, any> = Record<string, any>> {
1143
+ (ctx: FieldContext, options?: T): HTMLElement;
1144
+ }
1145
+ interface SubmodelsLayoutEvent {
1146
+ reset(list: object[]): void;
1147
+ update(list: object[]): void;
1148
+ hidden(hidden: boolean): void;
1149
+ readonly(readonly: boolean): void;
1150
+ destroy(): void;
1151
+ }
1152
+ interface FieldStyle {
1153
+ /** 是否启用链接 */
1154
+ enableLink?: boolean;
1155
+ /** 是否为设计模式 */
1156
+ design?: boolean;
1157
+ }
1158
+ interface RendererFieldStyle extends FieldStyle {
1159
+ /** 是否为编辑模式 */
1160
+ editable?: boolean;
1161
+ }
1162
+ interface FieldShowHandle {
1163
+ readonly root: HTMLElement;
1164
+ destroy(): void;
1165
+ value: any;
1166
+ }
1167
+ type FieldComponents = {
1168
+ [field: string]: FieldComponent | FieldComponents;
1169
+ };
1170
+ interface PageSectionParam {
1171
+ type: 'documents' | 'document' | 'createDocument' | 'editDocument';
1172
+ model?: ModelScriptConfiguration;
1173
+ pageIdent?: PageIdent;
1174
+ document?: Record<string, any>;
1175
+ documents?: Array<Record<string, any>>;
1176
+ checkedDocuments?: Array<Record<string, any>>;
1177
+ store?: Store$1;
1178
+ where?: Search.AndItem[];
1179
+ orWhere?: Search.OrItem[];
1180
+ }
1181
+ interface FieldFilterStyle {
1182
+ /** 行内渲染 */
1183
+ inline?: boolean;
1184
+ /** 显示标签 */
1185
+ showLabel?: boolean;
1186
+ /** 是否为快速模式 */
1187
+ quick?: boolean;
1188
+ /** 是否为设计模式 */
1189
+ design?: boolean;
1190
+ }
1191
+ interface FieldFilterContext {
1192
+ readonly style: FieldFilterStyle;
1193
+ readonly field?: FieldScriptConfiguration;
1194
+ readonly operator: string;
1195
+ value: any;
1196
+ signal: AbortSignal;
1197
+ destroyed: boolean;
1198
+ }
1199
+ interface FieldFilterComponent<T extends Record<string, any> = Record<string, any>> {
1200
+ (ctx: FieldFilterContext, options?: T): HTMLElement;
1201
+ }
1202
+ interface FieldDefine {
1203
+ quickFilter: string;
1204
+ }
1205
+ interface FormFieldHook {
1206
+ type?: string;
1207
+ array?: boolean;
1208
+ renderer?: string;
1209
+ input: FieldComponent;
1210
+ filter: FieldFilterComponent;
1211
+ notFilter: FieldFilterComponent;
1212
+ filters: Record<string, FieldFilterComponent | [FieldFilterComponent, string?]>;
1213
+ }
1214
+ declare namespace FromRenderer {
1215
+ interface Options extends StoreLayout$1 {}
1216
+ }
1217
+ interface FromRenderer {
1218
+ render(model: ModelScriptConfiguration, store: Store$1<any, any>, root: HTMLElement, style: RendererFieldStyle, options?: FromRenderer.Options | null): () => void;
1219
+ }
1220
+ interface UserHook {
1221
+ permissions(userPlugin: Record<string, any>, user: User): Set<string> | null;
1222
+ organizationPermissions(userPlugin: Record<string, any>, user: User): Record<string, Set<string>> | null;
1223
+ }
1224
+ type IconDefine = string | [path: string, viewBox?: string] | ((ctx: {
1225
+ root: SVGSVGElement;
1226
+ }, signal?: AbortSignal) => MaybePromise<void>);
1227
+ interface Hooks {
1228
+ /** 自动加载的样式文件 */
1229
+ styles: string;
1230
+ /** 添加到 <body> 中的元素 */
1231
+ elements: Element | Element[];
1232
+ /** 添加到 <body> 上的类名 */
1233
+ className: string;
1234
+ /** 字段配置 */
1235
+ formFields: FormFieldHook;
1236
+ /** 表单渲染器 */
1237
+ formRenderers: Record<string, FromRenderer>;
1238
+ /** 页面管理器 */
1239
+ pageManager: PageManager;
1240
+ /** 用户构造 */
1241
+ user: UserHook;
1242
+ commands: Record<string, Command>;
1243
+ configurationPages: Record<string, PageRenderer | string>;
1244
+ /** 图标库 */
1245
+ icons: Record<string, IconDefine>;
1246
+ enumerations: Record<string, Record<string, any> | Record<string, any>[] | (() => Record<string, any>[])>;
1247
+ }
1248
+ declare namespace Hooks {
1249
+ type Define = Hook.Define<Hooks>;
1250
+ }
1251
+ interface Authenticator {
1252
+ /** 自动加载的样式文件 */
1253
+ styleFiles: string[];
1254
+ /** 添加到 <body> 上的类名 */
1255
+ classNames: string[];
1256
+ /** 添加到 <body> 上的类名 */
1257
+ elements: Element | Element[];
1258
+ /** 添加到根节点上的类名 */
1259
+ rootClassName: string;
1260
+ login(signal: AbortSignal): PromiseLike<void> | void;
1261
+ }
1262
+ interface Theme {
1263
+ home: (ctx: HomeContext) => void;
1264
+ /** 自动加载的样式文件 */
1265
+ styleFiles: string[];
1266
+ /** 添加到 <body> 上的类名 */
1267
+ classNames: string[];
1268
+ /** 页面管理器 */
1269
+ pageManager: PageManager;
1270
+ /** 添加到 <body> 上的类名 */
1271
+ elements: Element[];
1272
+ /** 添加到根节点上的类名 */
1273
+ rootClassName: string;
1274
+ createPage(show: boolean): Page;
1275
+ renderError(ctx: PageContext, error: unknown): void;
1276
+ components: Record<string, any>;
1277
+ setup(signal: AbortSignal): void;
1278
+ }
1279
+ interface ModelIndicator {
1280
+ fields?: string[];
1281
+ get: (doc: object) => Indicator;
1282
+ }
1283
+ //#endregion
1284
+ //#region packages/web/route/PageContext.d.mts
1285
+ declare class PageContext extends GeneralContext {
1286
+ /**
1287
+ *
1288
+ * @param {PageHandle} state
1289
+ */
1290
+ constructor(state: PageHandle);
1291
+ /**
1292
+ *
1293
+ * @param {unknown} [err]
1294
+ * @returns
1295
+ */
1296
+ setError(err?: unknown): void;
1297
+ get bootLoading(): boolean;
1298
+ get define(): PageConfiguration | null;
1299
+ get ident(): PageIdent;
1300
+ get root(): string;
1301
+ get path(): string;
1302
+ get search(): string;
1303
+ get hash(): string;
1304
+ get href(): string;
1305
+ get current(): boolean;
1306
+ get shown(): boolean;
1307
+ set title(title: string);
1308
+ get title(): string;
1309
+ set unsaved(unsaved: boolean);
1310
+ get unsaved(): boolean;
1311
+ set loading(loading: boolean);
1312
+ get loading(): boolean;
1313
+ get container(): HTMLElement;
1314
+ set panel(panel: boolean);
1315
+ get panel(): boolean;
1316
+ set mode(mode: "scroll" | "flex");
1317
+ get mode(): "scroll" | "flex";
1318
+ /**
1319
+ *
1320
+ * @param {AbortSignal} [signal]
1321
+ * @returns {PageHeader?}
1322
+ */
1323
+ createHeader(signal?: AbortSignal): PageHeader | null;
1324
+ /**
1325
+ *
1326
+ * @param {AbortSignal} [signal]
1327
+ * @returns {PageFooter?}
1328
+ */
1329
+ createFooter(signal?: AbortSignal): PageFooter | null;
1330
+ /**
1331
+ *
1332
+ * @param {boolean} [inserted]
1333
+ * @param {AbortSignal} [signal]
1334
+ * @returns
1335
+ */
1336
+ createSider(inserted?: boolean, signal?: AbortSignal): PageSider | null;
1337
+ /**
1338
+ *
1339
+ * @param {'start' | 'end' | 'before' | 'after'} position
1340
+ * @param {boolean} [inserted]
1341
+ * @param {AbortSignal} [signal]
1342
+ * @returns {PageSection?}
1343
+ */
1344
+ createSection(position: "start" | "end" | "before" | "after", inserted?: boolean, signal?: AbortSignal): PageSection | null;
1345
+ /**
1346
+ *
1347
+ * @param {PageConfiguration['sides']} sides
1348
+ * @param {PageSectionParam} param
1349
+ */
1350
+ renderSides(sides: PageConfiguration["sides"], param: PageSectionParam): void;
1351
+ /**
1352
+ * @param {string} url
1353
+ * @param {string | PageIdent} [page]
1354
+ * @returns {string}
1355
+ */
1356
+ toUrl(url: string, page?: string | PageIdent): string;
1357
+ /**
1358
+ * @overload
1359
+ * @param {string} url
1360
+ * @param {boolean} [replace]
1361
+ * @returns {void}
1362
+ */
1363
+ open(url: string, replace?: boolean | undefined): void;
1364
+ /**
1365
+ * @overload
1366
+ * @param {string} url
1367
+ * @param {string | PageIdent} [page]
1368
+ * @param {boolean} [replace]
1369
+ * @returns {void}
1370
+ */
1371
+ open(url: string, page?: string | PageIdent | undefined, replace?: boolean | undefined): void;
1372
+ /**
1373
+ * @overload
1374
+ * @param {string} url
1375
+ * @param {boolean | string | PageIdent} [page]
1376
+ * @param {boolean} [replace]
1377
+ * @returns {void}
1378
+ */
1379
+ open(url: string, page?: string | boolean | PageIdent | undefined, replace?: boolean | undefined): void;
1380
+ /**
1381
+ *
1382
+ * @param {string} p
1383
+ * @param {boolean} [replace]
1384
+ * @returns {void}
1385
+ */
1386
+ setPath(p: string, replace?: boolean): void;
1387
+ /**
1388
+ *
1389
+ * @param {boolean} [replace]
1390
+ * @returns {void}
1391
+ */
1392
+ show(replace?: boolean): void;
1393
+ get destroyDeferred(): boolean;
1394
+ /**
1395
+ * @param {boolean} [defer]
1396
+ * @returns {boolean}
1397
+ */
1398
+ destroy(defer?: boolean): boolean;
1399
+ #private;
1400
+ }
1401
+ //#endregion
1402
+ //#region packages/web/route/renderError.d.mts
1403
+ type PageError = {
1404
+ title: string;
1405
+ description?: string | undefined;
1406
+ };
1407
+ //#endregion
1408
+ //#region packages/web/route/index.d.mts
1409
+ type PageRenderer = (ctx: PageContext) => MaybePromise<void>;
1410
+ //#endregion
1411
+ //#region packages/web/route/pages.d.mts
1412
+ type ContinuationDefine = any;
1413
+ type WorkspaceDefine = ContinuationDefine & {
1414
+ continuations: Record<string, ContinuationDefine | string | PageRenderer>;
1415
+ };
1416
+ //#endregion
1417
+ //#region packages/web/form/createQuickFilters.d.mts
1418
+ /**
1419
+ * @typedef {object} Match
1420
+ * @property {string} field
1421
+ * @property {string} [operator]
1422
+ * @property {any} value
1423
+ */
1424
+ /**
1425
+ *
1426
+ * @param {{get(): Search.AndList, set(v: Search.AndList): void}} andList
1427
+ * @param {HTMLElement} root
1428
+ * @param {{field: string; label?: string; operator: string}[]} filters
1429
+ * @param {object} options
1430
+ * @param {Record<string, FieldScriptConfiguration>} options.fields
1431
+ * @param {boolean} [options.inline]
1432
+ * @param {boolean} [options.showLabel]
1433
+ * @param {AbortSignal} [options.signal]
1434
+ */
1435
+ declare function createQuickFilters(andList: {
1436
+ get(): Search.AndList;
1437
+ set(v: Search.AndList): void;
1438
+ }, root: HTMLElement, filters: {
1439
+ field: string;
1440
+ label?: string;
1441
+ operator: string;
1442
+ }[], {
1443
+ fields,
1444
+ showLabel,
1445
+ inline,
1446
+ signal
1447
+ }: {
1448
+ fields: Record<string, FieldScriptConfiguration>;
1449
+ inline?: boolean | undefined;
1450
+ showLabel?: boolean | undefined;
1451
+ signal?: AbortSignal | undefined;
1452
+ }): void;
1453
+ type Match = {
1454
+ field: string;
1455
+ operator?: string | undefined;
1456
+ value: any;
1457
+ };
1458
+ //#endregion
1459
+ //#region packages/web/form/field.d.mts
1460
+ /**
1461
+ * @overload
1462
+ * @param {FieldScriptConfiguration} field
1463
+ * @param {false} [skip]
1464
+ * @returns {FieldComponent}
1465
+ */
1466
+ declare function getField(field: FieldScriptConfiguration, skip?: false | undefined): FieldComponent;
1467
+ /**
1468
+ *
1469
+ * @overload
1470
+ * @param {FieldScriptConfiguration} field
1471
+ * @param {true} skip
1472
+ * @returns {FieldComponent?}
1473
+ */
1474
+ declare function getField(field: FieldScriptConfiguration, skip: true): FieldComponent | null;
1475
+ /**
1476
+ *
1477
+ * @overload
1478
+ * @param {FieldScriptConfiguration} field
1479
+ * @param {boolean} [skip]
1480
+ * @returns {FieldComponent?}
1481
+ */
1482
+ declare function getField(field: FieldScriptConfiguration, skip?: boolean | undefined): FieldComponent | null;
1483
+ /**
1484
+ *
1485
+ * @param {FieldScriptConfiguration} field
1486
+ * @returns {boolean}
1487
+ */
1488
+ declare function hasField(field: FieldScriptConfiguration): boolean;
1489
+ /**
1490
+ *
1491
+ * @param {FieldScriptConfiguration} field
1492
+ * @param {string} operator
1493
+ * @returns {FieldFilterComponent}
1494
+ */
1495
+ declare function getFieldFilter(field: FieldScriptConfiguration, operator: string): FieldFilterComponent;
1496
+ /**
1497
+ *
1498
+ * @param {FieldScriptConfiguration} field
1499
+ * @returns {Record<string, string>}
1500
+ */
1501
+ declare function getFieldFilterOperators(field: FieldScriptConfiguration): Record<string, string>;
1502
+ /**
1503
+ *
1504
+ * @param {FieldScriptConfiguration} field
1505
+ * @param {string} operator
1506
+ * @returns {boolean}
1507
+ */
1508
+ declare function hasFieldFilter(field: FieldScriptConfiguration, operator: string): boolean;
1509
+ //#endregion
1510
+ //#region packages/web/form/toSchema.d.mts
1511
+ /**
1512
+ *
1513
+ * @param {Record<string, FieldScriptConfiguration>} fields
1514
+ * @param {FieldComponents} components
1515
+ * @param {Permission[]?} [permissions]
1516
+ */
1517
+ declare function toSchema(fields: Record<string, FieldScriptConfiguration>, components: FieldComponents, permissions?: Permission[] | null): Schema$1;
1518
+ //#endregion
1519
+ //#region packages/web/form/renderForm.d.mts
1520
+ /**
1521
+ *
1522
+ * @param {ModelConfiguration} model
1523
+ * @param {Store} store
1524
+ * @param {HTMLElement} root
1525
+ * @param {RendererFieldStyle} style
1526
+ * @param {FromRenderer.Options?} [options]
1527
+ * @param {string?} [type]
1528
+ */
1529
+ declare function _default$1(model: ModelConfiguration, store: Store$1, root: HTMLElement, style: RendererFieldStyle, options?: FromRenderer.Options | null, type?: string | null): () => void;
1530
+ //#endregion
1531
+ //#region packages/web/form/renderGridForm.d.mts
1532
+ /**
1533
+ *
1534
+ * @param {ModelConfiguration} model
1535
+ * @param {Store} store
1536
+ * @param {HTMLElement} root
1537
+ * @param {RendererFieldStyle} style
1538
+ * @param {StoreLayout?} [options]
1539
+ */
1540
+ declare function _default$2(model: ModelConfiguration, store: Store$1, root: HTMLElement, style: RendererFieldStyle, options?: StoreLayout$1 | null): () => void;
1541
+ //#endregion
1542
+ //#region packages/web/form/createStore.d.mts
1543
+ /**
1544
+ *
1545
+ * @param {ModelScriptConfiguration} define
1546
+ * @param {FieldComponents?} [fieldComponents]
1547
+ */
1548
+ declare function createStore(define: ModelScriptConfiguration, fieldComponents?: FieldComponents | null): Store$1<any, any>;
1549
+ //#endregion
1550
+ //#region packages/web/form/createShowField.d.mts
1551
+ /**
1552
+ *
1553
+ * @param {string} name
1554
+ * @param {FieldScriptConfiguration} field
1555
+ * @param {FieldStyle} style
1556
+ * @param {any} data
1557
+ * @returns {FieldShowHandle}
1558
+ */
1559
+ declare function createShowField(name: string, field: FieldScriptConfiguration, style: FieldStyle, data: any): FieldShowHandle;
1560
+ //#endregion
1561
+ //#region packages/web/form/createFilters.d.mts
1562
+ /**
1563
+ * @typedef {object} Filters
1564
+ * @property {HTMLElement} root
1565
+ * @property {() => void} add
1566
+ * @property {() => (Search.AndItem | null)[]} destroy
1567
+ */
1568
+ /**
1569
+ *
1570
+ * @param {HTMLElement} root
1571
+ * @param {Record<string, FieldScriptConfiguration>} fields
1572
+ * @param {(Search.AndItem | null)[]?} [value]
1573
+ * @returns {Filters}
1574
+ */
1575
+ declare function createFilters(root: HTMLElement, fields: Record<string, FieldScriptConfiguration>, value?: (Search.AndItem | null)[] | null): Filters;
1576
+ type Filters = {
1577
+ root: HTMLElement;
1578
+ add: () => void;
1579
+ destroy: () => (Search.AndItem | null)[];
1580
+ };
1581
+ //#endregion
1582
+ //#region packages/web/form/showFilterDialog.d.mts
1583
+ /**
1584
+ *
1585
+ * @param {ModelScriptConfiguration} modelDefine
1586
+ * @param {Search.AndItem[]?} [value]
1587
+ * @param {HTMLElement} [root]
1588
+ * @param {AbortSignal} [signal]
1589
+ * @returns {Promise<Search.AndItem[]>}
1590
+ */
1591
+ declare function showFilterDialog(modelDefine: ModelScriptConfiguration, value?: Search.AndItem[] | null, root?: HTMLElement, signal?: AbortSignal): Promise<Search.AndItem[]>;
1592
+ //#endregion
1593
+ //#region packages/web/form/createStoreField.d.mts
1594
+ /**
1595
+ *
1596
+ * @param {Store} store
1597
+ * @param {FieldStyle} style
1598
+ * @param {StoreLayout.Options?} [options]
1599
+ * @returns {[HTMLElement, () => void]?}
1600
+ */
1601
+ declare function createStoreField(store: Store$1, style: FieldStyle, options?: StoreLayout$1.Options | null): [HTMLElement, () => void] | null;
1602
+ //#endregion
1603
+ //#region packages/web/utils/toUrl.d.mts
1604
+ /**
1605
+ *
1606
+ * @param {...string} paths
1607
+ * @returns
1608
+ */
1609
+ declare function toUrl(...paths: string[]): string;
1610
+ //#endregion
1611
+ //#region packages/web/utils/isPluginId.d.mts
1612
+ /**
1613
+ *
1614
+ * @param {string} n
1615
+ * @returns {boolean}
1616
+ */
1617
+ declare function isPluginId(n: string): boolean;
1618
+ //#endregion
1619
+ //#region packages/web/utils/waitAbortSignal.d.mts
1620
+ /**
1621
+ *
1622
+ * @param {AbortSignal?} [signal]
1623
+ */
1624
+ declare function waitAbortSignal(signal?: AbortSignal | null): Promise<void>;
1625
+ //#endregion
1626
+ //#region packages/web/script/index.d.mts
1627
+ /**
1628
+ *
1629
+ * @param {string?} script
1630
+ * @param {Record<string, unknown>} scope
1631
+ * @returns {unknown}
1632
+ */
1633
+ declare function execScript(script: string | null, scope: Record<string, unknown>): unknown;
1634
+ //#endregion
1635
+ //#region packages/web/services/enumeration.d.mts
1636
+ /**
1637
+ *
1638
+ * @param {string} enumeration
1639
+ * @returns
1640
+ */
1641
+ declare function enumerationsService(enumeration: string): {
1642
+ then<TResult1 = Record<string, any>[], TResult2 = never>(onfulfilled?: ((value: Record<string, any>[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1643
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Record<string, any>[] | TResult2>;
1644
+ finally(onfinally?: (() => void) | null | undefined): Promise<Record<string, any>[]>;
1645
+ load: (force?: boolean) => Promise<Record<string, any>[]>;
1646
+ get: () => Record<string, any>[] | never[];
1647
+ };
1648
+ //#endregion
1649
+ //#region packages/web/services/formLayout.d.mts
1650
+ /**
1651
+ *
1652
+ * @param {string} layout
1653
+ * @returns
1654
+ */
1655
+ declare function formLayoutsService(layout: string): {
1656
+ then<TResult1 = {
1657
+ layout: any;
1658
+ type?: string;
1659
+ }, TResult2 = never>(onfulfilled?: ((value: {
1660
+ layout: any;
1661
+ type?: string;
1662
+ }) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1663
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<{
1664
+ layout: any;
1665
+ type?: string;
1666
+ } | TResult2>;
1667
+ finally(onfinally?: (() => void) | null | undefined): Promise<{
1668
+ layout: any;
1669
+ type?: string;
1670
+ }>;
1671
+ load: (force?: boolean) => Promise<{
1672
+ layout: any;
1673
+ type?: string;
1674
+ }>;
1675
+ get: () => {
1676
+ layout: any;
1677
+ type?: string;
1678
+ } | null;
1679
+ };
1680
+ //#endregion
1681
+ //#region packages/web/services/permissions.d.mts
1682
+ declare const _default: {
1683
+ then<TResult1 = Permission$1[], TResult2 = never>(onfulfilled?: ((value: Permission$1[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
1684
+ catch<TResult2 = never>(onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<Permission$1[] | TResult2>;
1685
+ finally(onfinally?: (() => void) | null | undefined): Promise<Permission$1[]>;
1686
+ load: typeof load;
1687
+ get: typeof get;
1688
+ };
1689
+ type Permission$1 = ({
1690
+ children: {
1691
+ value: string;
1692
+ label: string;
1693
+ }[];
1694
+ label: string;
1695
+ });
1696
+ /**
1697
+ *
1698
+ * @param {boolean} [force]
1699
+ */
1700
+ declare function load(force?: boolean): Promise<Permission$1[]>;
1701
+ declare function get(): Permission$1[];
1702
+ //#endregion
1703
+ //#region packages/web/services/menu.d.mts
1704
+ /**
1705
+ * @overload
1706
+ * @param {string} type
1707
+ * @param {boolean} [force]
1708
+ * @returns {Promise<Menu.Define[]>}
1709
+ */
1710
+ declare function loadMenu(type: string, force?: boolean | undefined): Promise<Menu.Define[]>;
1711
+ /**
1712
+ * @overload
1713
+ * @param {string} type
1714
+ * @param {string} [group]
1715
+ * @param {boolean} [force]
1716
+ * @returns {Promise<Menu.Define[]>}
1717
+ */
1718
+ declare function loadMenu(type: string, group?: string | undefined, force?: boolean | undefined): Promise<Menu.Define[]>;
1719
+ /**
1720
+ * @overload
1721
+ * @param {string} type
1722
+ * @param {string | boolean} [group]
1723
+ * @param {boolean} [force]
1724
+ * @returns {Promise<Menu.Define[]>}
1725
+ */
1726
+ declare function loadMenu(type: string, group?: string | boolean | undefined, force?: boolean | undefined): Promise<Menu.Define[]>;
1727
+ //#endregion
1728
+ //#region packages/web/import.d.mts
1729
+ /**
1730
+ * @template T
1731
+ * @overload
1732
+ * @param {string} [id]
1733
+ * @param {(f: string) => Promise<object>} [importFile]
1734
+ * @returns {Promise<T | undefined>}
1735
+ */
1736
+ declare function importWidget<T>(id?: string | undefined, importFile?: ((f: string) => Promise<object>) | undefined): Promise<T | undefined>;
1737
+ /**
1738
+ * @template T
1739
+ * @overload
1740
+ * @param {string} [id]
1741
+ * @param {string} [pluginId]
1742
+ * @param {(f: string) => Promise<object>} [importFile]
1743
+ * @returns {Promise<T | undefined>}
1744
+ */
1745
+ declare function importWidget<T>(id?: string | undefined, pluginId?: string | undefined, importFile?: ((f: string) => Promise<object>) | undefined): Promise<T | undefined>;
1746
+ /**
1747
+ * 加载样式
1748
+ * @param {string} url
1749
+ * @param {string} [plugin]
1750
+ * @param {boolean} [pluginOnly]
1751
+ * @returns {Promise<HTMLLinkElement>}
1752
+ */
1753
+ declare function importStyle(url: string, plugin?: string, pluginOnly?: boolean): Promise<HTMLLinkElement>;
1754
+ //#endregion
1755
+ //#region packages/web/paths.d.mts
1756
+ declare namespace pathRoots {
1757
+ let api: string;
1758
+ let file: string;
1759
+ }
1760
+ //#endregion
1761
+ //#region packages/web/loadOptions.d.mts
1762
+ /**
1763
+ *
1764
+ * @param {object} options
1765
+ * @param {string?} [options.type]
1766
+ * @param {string?} [options.name]
1767
+ * @param {string?} [options.filter]
1768
+ * @param {*} [options.values]
1769
+ * @param {string?} [options.id]
1770
+ * @param {string?} [options.label]
1771
+ * @param {string?} [options.value]
1772
+ * @param {string?} [options.parent]
1773
+ * @param {string?} [options.children]
1774
+ * @param {string?} [options.sequence]
1775
+ * @param {string?} [options.disabled]
1776
+ * @param {*} [options.values]
1777
+ * @param {((placeholder: string) => string | (() => string) | null) | false} [getPlaceholder]
1778
+ * @param {(value: Search.ExecParam) => boolean?} [exec]
1779
+ * @returns
1780
+ */
1781
+ declare function loadOptions({
1782
+ type,
1783
+ name,
1784
+ values,
1785
+ ...options
1786
+ }: {
1787
+ type?: string | null | undefined;
1788
+ name?: string | null | undefined;
1789
+ filter?: string | null | undefined;
1790
+ values?: any;
1791
+ id?: string | null | undefined;
1792
+ label?: string | null | undefined;
1793
+ value?: string | null | undefined;
1794
+ parent?: string | null | undefined;
1795
+ children?: string | null | undefined;
1796
+ sequence?: string | null | undefined;
1797
+ disabled?: string | null | undefined;
1798
+ values?: any;
1799
+ }, getPlaceholder?: ((placeholder: string) => string | (() => string) | null) | false, exec?: (value: Search.ExecParam) => boolean | null): State<Option[]>;
1800
+ type Option = {
1801
+ id: string | number;
1802
+ value: string | number;
1803
+ label: string;
1804
+ data: any;
1805
+ parentId?: string | number | undefined;
1806
+ disabled?: boolean | undefined;
1807
+ children: Option[];
1808
+ };
1809
+ //#endregion
1810
+ //#region packages/web/model.d.mts
1811
+ /**
1812
+ *
1813
+ * @param {ModelConfiguration | ModelScriptConfiguration} model
1814
+ * @returns
1815
+ */
1816
+ declare function getPrimaryFields(model: ModelConfiguration | ModelScriptConfiguration): string[];
1817
+ /**
1818
+ *
1819
+ * @param {ModelConfiguration | ModelScriptConfiguration} model
1820
+ * @param {Record<string, any>} document
1821
+ * @returns
1822
+ */
1823
+ declare function toId(model: ModelConfiguration | ModelScriptConfiguration, document: Record<string, any>): string;
1824
+ //#endregion
1825
+ //#region packages/web/icons/index.d.mts
1826
+ /**
1827
+ *
1828
+ * @param {string} key
1829
+ * @param {AbortSignal | boolean} [signal]
1830
+ */
1831
+ declare function createIcon(key: string, signal?: AbortSignal | boolean): SVGSVGElement;
1832
+ //#endregion
1833
+ //#region packages/web/file.d.mts
1834
+ /**
1835
+ * @param {object} [options]
1836
+ * @param {FileSystemHandleQueryOptions['types']} [options.types]
1837
+ * @param {boolean} [options.excludeAcceptAllOption]
1838
+ * @returns {Promise<File?>}
1839
+ */
1840
+ declare function selectFile({
1841
+ types,
1842
+ excludeAcceptAllOption
1843
+ }?: {
1844
+ types?: any;
1845
+ excludeAcceptAllOption?: boolean | undefined;
1846
+ }): Promise<File | null>;
1847
+ /**
1848
+ *
1849
+ * @param {object} file
1850
+ * @param {string} file.domain
1851
+ * @param {string} file.path
1852
+ * @param {string} [name]
1853
+ */
1854
+ declare function toFileURL(file: {
1855
+ domain: string;
1856
+ path: string;
1857
+ }, name?: string): string;
1858
+ /**
1859
+ *
1860
+ * @param {string} [uri]
1861
+ * @returns
1862
+ */
1863
+ declare function toFileLink(uri?: string): {
1864
+ name: string;
1865
+ href: string;
1866
+ } | null;
1867
+ //#endregion
1868
+ //#region packages/web/constants.d.mts
1869
+ declare const neverAbortedSignal: AbortSignal;
1870
+ //#endregion
1871
+ //#region packages/web/permission.d.mts
1872
+ /**
1873
+ *
1874
+ * @param {string | string[] | null | void} permission
1875
+ * @param {{has(permission: string): boolean}} permissions
1876
+ * @param {{has(authorization: string): boolean}?} [authorizations]
1877
+ */
1878
+ declare function filterPermission(permission: string | string[] | null | void, permissions: {
1879
+ has(permission: string): boolean;
1880
+ }, authorizations?: {
1881
+ has(authorization: string): boolean;
1882
+ } | null): boolean;
1883
+ /**
1884
+ *
1885
+ * @param {Permission['constraints']} constraints
1886
+ * @param {Record<string, any>?} [data]
1887
+ */
1888
+ declare function testPermissionConstraints(constraints: Permission["constraints"], data?: Record<string, any> | null): boolean;
1889
+ /**
1890
+ *
1891
+ * @param {Permission} permission
1892
+ * @param {{has(permission: string): boolean}} permissions
1893
+ * @param {Record<string, any>?} [data]
1894
+ * @param {boolean} [isNew]
1895
+ */
1896
+ declare function testPermission({
1897
+ permission,
1898
+ organizationField,
1899
+ constraints
1900
+ }: Permission, permissions: {
1901
+ has(permission: string): boolean;
1902
+ }, data?: Record<string, any> | null, isNew?: boolean): boolean;
1903
+ /**
1904
+ *
1905
+ * @param {Permission[]} permissionList
1906
+ * @param {{has(permission: string): boolean}} permissions
1907
+ * @param {Record<string, any>?} [data]
1908
+ * @param {boolean} [isNew]
1909
+ */
1910
+ declare function getAuthorizations(permissionList: Permission[], permissions: {
1911
+ has(permission: string): boolean;
1912
+ }, data?: Record<string, any> | null, isNew?: boolean): Set<string>;
1913
+ declare namespace Ident_d_exports {
1914
+ export { decode, encode, parse, stringify };
1915
+ }
1916
+ /** @import { PageIdent } from './route/route.mjs' */
1917
+ /**
1918
+ * @param {string} t
1919
+ * @returns {string}
1920
+ */
1921
+ declare function decode(t: string): string;
1922
+ /**
1923
+ * @param {string | PageIdent} t
1924
+ * @returns {string}
1925
+ */
1926
+ declare function encode(t: string | PageIdent): string;
1927
+ /**
1928
+ * @param {string} ident
1929
+ * @returns {PageIdent}
1930
+ */
1931
+ declare function parse(ident: string): PageIdent;
1932
+ /**
1933
+ *
1934
+ * @param {PageIdent} a
1935
+ * @returns {string}
1936
+ */
1937
+ declare function stringify(a: PageIdent): string;
1938
+ //#endregion
1939
+ //#region packages/web/request.d.mts
1940
+ declare const request: ARequest;
1941
+ declare class ARequest extends DotRequest$1 {
1942
+ /**
1943
+ *
1944
+ * @param {string} method
1945
+ * @param {string} [path]
1946
+ * @returns
1947
+ */
1948
+ method(method: string, path?: string): this;
1949
+ }
1950
+ //#endregion
1951
+ //#region packages/web/ResponseError.d.mts
1952
+ declare class ResponseError extends Error {
1953
+ /**
1954
+ *
1955
+ * @param {number} status
1956
+ */
1957
+ constructor(status: number);
1958
+ status: number;
1959
+ }
1960
+ //#endregion
1961
+ //#region packages/web/buildPlugin.d.mts
1962
+ /**
1963
+ *
1964
+ * @param {string} pluginId
1965
+ */
1966
+ declare function buildPlugin(pluginId: string): {
1967
+ /**
1968
+ *
1969
+ * @param {string} url
1970
+ * @returns
1971
+ */
1972
+ importStyle(url: string): Promise<HTMLLinkElement>;
1973
+ /**
1974
+ *
1975
+ * @param {string} url
1976
+ * @returns
1977
+ */
1978
+ import(url: string): Promise<any>;
1979
+ request: {
1980
+ build(): /*elided*/any;
1981
+ method(method: string, path?: string): /*elided*/any;
1982
+ get version(): string;
1983
+ buildResult(response: Promise<Response>): Result;
1984
+ clone<T extends dot_request1.default>(target: T): T;
1985
+ clone(): /*elided*/any;
1986
+ get(path?: string | undefined): /*elided*/any;
1987
+ get(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
1988
+ post(path?: string | undefined): /*elided*/any;
1989
+ post(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
1990
+ put(path?: string | undefined): /*elided*/any;
1991
+ put(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
1992
+ delete(path?: string | undefined): /*elided*/any;
1993
+ delete(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
1994
+ head(path?: string | undefined): /*elided*/any;
1995
+ head(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
1996
+ path(path: string): /*elided*/any;
1997
+ path(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
1998
+ prefix(prefix?: string | undefined): /*elided*/any;
1999
+ prefix(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
2000
+ suffix(suffix?: string | undefined): /*elided*/any;
2001
+ suffix(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
2002
+ append(...path: string[]): /*elided*/any;
2003
+ append(template: TemplateStringsArray, ...substitutions: any[]): /*elided*/any;
2004
+ header(headers: () => Record<string, HeaderValue> | null): HeaderValue | (() => HeaderValue);
2005
+ header(name: string): HeaderValue | (() => HeaderValue);
2006
+ header(name: string, value: HeaderValue | (() => HeaderValue)): /*elided*/any;
2007
+ header(headers: Record<string, HeaderValue | (() => HeaderValue)>): /*elided*/any;
2008
+ redirect(redirect: boolean | "error"): /*elided*/any;
2009
+ redirect(): boolean | "error";
2010
+ timeout(ms: number): /*elided*/any;
2011
+ timeout(): number;
2012
+ credentials(credentials: RequestCredentials | null): /*elided*/any;
2013
+ credentials(): RequestCredentials | null;
2014
+ mode(mode: RequestMode | "" | null): /*elided*/any;
2015
+ mode(): RequestMode | "";
2016
+ cache(cache: RequestCache | null): /*elided*/any;
2017
+ cache(): RequestCache | null;
2018
+ referrer(referrer: string): /*elided*/any;
2019
+ referrer(): string;
2020
+ referrerPolicy(rp: ReferrerPolicy | null): /*elided*/any;
2021
+ referrerPolicy(): ReferrerPolicy | null;
2022
+ integrity(integrity: string): /*elided*/any;
2023
+ integrity(): string;
2024
+ keepalive(keep: boolean): /*elided*/any;
2025
+ keepalive(): boolean;
2026
+ context<V>(name: string | symbol): V;
2027
+ context(name: string | symbol, value: any): /*elided*/any;
2028
+ context(context: Record<string, any>): /*elided*/any;
2029
+ params(params?: Record<string, string | number> | undefined): /*elided*/any;
2030
+ query(query?: Record<string, any> | undefined): /*elided*/any;
2031
+ search(search?: string | undefined): /*elided*/any;
2032
+ data(data?: Record<string, any> | undefined): /*elided*/any;
2033
+ body(body?: BodyData, type?: string | undefined): /*elided*/any;
2034
+ body(body?: object | Record<string, any>): /*elided*/any;
2035
+ form(form?: FormData | object | Record<string, any>): /*elided*/any;
2036
+ signal(signal?: Signal): /*elided*/any;
2037
+ signalHandler(handler?: boolean | SignalHandler | undefined): /*elided*/any;
2038
+ uploadProgress(up: ProgressListener): /*elided*/any;
2039
+ stringifyJSON(fn?: ((value: any) => string) | null | undefined): /*elided*/any;
2040
+ downloadProgress(dp: ProgressListener | null): /*elided*/any;
2041
+ errorHandler(eh: ErrorHandler | null): /*elided*/any;
2042
+ parseJSON(fn: ((value: string) => any) | null): /*elided*/any;
2043
+ create(): Request;
2044
+ fetch(fetch: Fetch): /*elided*/any;
2045
+ fetch(): Result;
2046
+ ok(error?: ErrorHandler | null | undefined): Result;
2047
+ text(): Promise<string>;
2048
+ blob(): Promise<Blob>;
2049
+ arrayBuffer(): Promise<ArrayBuffer>;
2050
+ formData(): Promise<FormData>;
2051
+ json<T>(reviver?: ((this: any, key: string, value: any) => any) | undefined): Promise<T>;
2052
+ searchParams(): Promise<URLSearchParams>;
2053
+ stream(): Promise<ReadableStream<Uint8Array> | null>;
2054
+ result<T>(): Promise<T | null>;
2055
+ done<T = void>(value: T): Promise<T>;
2056
+ done(): Promise<void>;
2057
+ then<TResult1 = Response, TResult2 = never>(fulfilled?: ((value: Response) => TResult1 | PromiseLike<TResult1>) | null | undefined, rejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
2058
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<Response | TResult>;
2059
+ finally(onfinally: (() => void) | null): Promise<Response>;
2060
+ "__#private@#private": any;
2061
+ };
2062
+ user: {
2063
+ readonly session: Record<string, any> | null;
2064
+ readonly target: Record<string, any> | null;
2065
+ readonly current: Record<string, any> | null;
2066
+ };
2067
+ };
2068
+ //#endregion
2069
+ //#region packages/web/start.d.mts
2070
+ /**
2071
+ *
2072
+ * @param {typeof loadAuthenticator} _loadAuthenticator
2073
+ * @param {typeof loadTheme} _loadTheme
2074
+ * @param {() => MaybePromise<PageIdent.Router?>} _loadRoute
2075
+ * @returns
2076
+ */
2077
+ declare function start(_loadAuthenticator: typeof loadAuthenticator, _loadTheme: typeof loadTheme, _loadRoute: () => MaybePromise<PageIdent.Router | null>): Promise<void>;
2078
+ type uiStyle = [file: string, plugin: string];
2079
+ /** @type {() => MaybePromise<Partial<Omit<Authenticator, "styleFiles"> & Record<"styleFiles", uiStyle[]>>>} */
2080
+ declare let loadAuthenticator: () => MaybePromise<Partial<Omit<Authenticator, "styleFiles"> & Record<"styleFiles", uiStyle[]>>>;
2081
+ /** @type {() => MaybePromise<Partial<Omit<Theme, "styleFiles"> & Record<"styleFiles", uiStyle[]>>>} */
2082
+ declare let loadTheme: () => MaybePromise<Partial<Omit<Theme, "styleFiles"> & Record<"styleFiles", uiStyle[]>>>;
2083
+ //#endregion
2084
+ //#region packages/web/configuration.d.mts
2085
+ /** @type {Record<string, Plugin>} */
2086
+ declare const plugins: Record<string, Plugin>;
2087
+ declare const single: boolean | undefined;
2088
+ declare const userMenus: any[];
2089
+ declare const webRoot: URL;
2090
+ /** @import { Plugin, BootConfiguration } from '@yongdall/common' */
2091
+ /** @type {BootConfiguration} */
2092
+ declare const configuration: BootConfiguration;
2093
+ //#endregion
2094
+ //#region packages/web/dom.d.mts
2095
+ /**
2096
+ *
2097
+ * @param {string?} icon
2098
+ */
2099
+ declare function setIcon(icon: string | null): void;
2100
+ declare const root$1: HTMLDivElement;
2101
+ //#endregion
2102
+ //#region packages/web/form/List.d.mts
2103
+ declare class List$1 {
2104
+ /**
2105
+ *
2106
+ * @param {(id: string) => string} createUrl
2107
+ * @param {ModelScriptConfiguration} model
2108
+ */
2109
+ constructor(createUrl: (id: string) => string, model: ModelScriptConfiguration);
2110
+ get root(): HTMLTableElement;
2111
+ set createUrl(fn: ((id: string) => string) | null);
2112
+ get createUrl(): ((id: string) => string) | null;
2113
+ /**
2114
+ *
2115
+ * @param {readonly any[]} list
2116
+ */
2117
+ setData(list: readonly any[]): void;
2118
+ destroy(): void;
2119
+ #private;
2120
+ }
2121
+ //#endregion
2122
+ //#region packages/web/components.d.mts
2123
+ declare let List: typeof List$1;
2124
+ declare let Pagination: {
2125
+ new (): {
2126
+ "__#private@#pagination": HTMLDivElement;
2127
+ get root(): HTMLDivElement;
2128
+ get size(): number;
2129
+ set size(v: number);
2130
+ get page(): number;
2131
+ set page(v: number);
2132
+ get total(): number;
2133
+ set total(v: number);
2134
+ /**
2135
+ *
2136
+ * @param {(p: Pagination) => void} listen
2137
+ * @returns {() => void}
2138
+ */
2139
+ listen(listen: (p: /*elided*/any) => void): () => void;
2140
+ destroy(): void;
2141
+ };
2142
+ };
2143
+ //#endregion
2144
+ //#region packages/web/allHooks.d.mts
2145
+ /** @typedef {Object.<'main' | 'details' | 'setting' | 'input' | 'edit', string | PageRenderer>} ContinuationDefine */
2146
+ /**
2147
+ *
2148
+ * @param {Record<string, Hook.Define<Hooks>>} hooks
2149
+ */
2150
+ declare function updateHooks(hooks: Record<string, Hook.Define<Hooks>>): void;
2151
+ /** @type {Hook<Hooks>} */
2152
+ declare const allHooks: Hook<Hooks>;
2153
+ //#endregion
2154
+ export { ArrayStore, type AsyncValidator, Authenticator, Command, type ContinuationDefine, DotRequest, FieldComponent, FieldComponentEvent, FieldComponents, FieldContext, FieldDefine, FieldFilterComponent, FieldFilterContext, FieldFilterStyle, type FieldScript, type FieldScriptConfiguration, FieldShowHandle, FieldStyle, FormFieldHook, FromRenderer, GeneralContext, type HomeContext, Hooks, IconDefine, Ident_d_exports as Ident, List, type Match, Menu, type ModelConfiguration, ModelIndicator, type ModelScript, type ModelScriptConfiguration, ObjectStore, Option, Page, type PageContext, type PageError, PageFooter, type PageHandle, PageHeader, type PageIdent, type PageManager, type PageRenderer, PageSection, PageSectionParam, PageSider, Pagination, RendererFieldStyle, ResponseError, type Schema, Signal$1 as Signal, State, Store, type StoreLayout, SubmodelsLayoutEvent, Theme, User, UserHook, type Validator, VerifyContext, VerifyError, type WorkspaceDefine, addManager, allHooks, buildPlugin, configuration, createComputed, createFilters, createIcon, createQuickFilters, createShowField, createState, createStore, createStoreField, effect, enumerationsService, execScript, filterPermission, formLayoutsService, getAuthorizations, getField, getFieldFilter, getFieldFilterOperators, getPages, getPrimaryFields, hasField, hasFieldFilter, importStyle, importWidget, isPluginId, loadMenu, loadOptions, modelService, neverAbortedSignal, pathRoots, _default as permissionsService, plugins, _default$1 as renderForm, _default$2 as renderGridForm, renderStore, request, root$1 as root, selectFile, setIcon, showFilterDialog, single, start, testPermission, testPermissionConstraints, toFileLink, toFileURL, toId, toSchema, toUrl, updateHooks, userMenus, waitAbortSignal, watch, webRoot };