@delta-comic/db 3.0.0-next.11 → 3.0.0-next.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,29 @@
1
1
  import { isTauri } from "@tauri-apps/api/core";
2
- import { InsertObject, JSONColumnType, Kysely, Kysely as Kysely$1, SelectQueryBuilder, Selectable } from "kysely";
2
+ import { InsertObject, JSONColumnType, Kysely, Kysely as Kysely$1, KyselyPlugin, PluginTransformQueryArgs, PluginTransformResultArgs, QueryResult, RootOperationNode, SelectQueryBuilder, Selectable, UnknownRow } from "kysely";
3
3
  import { EntryKey } from "@pinia/colada";
4
- import { FormResult, FormSingleConfigure, PluginManifest, SourcedKeyType, SourcedValue, UniEpRaw, UniItem, UniItemAuthor, UniItemRaw } from "@delta-comic/model";
5
4
  import { MaybeRefOrGetter, Ref } from "vue";
5
+ import { FormResult, FormSingleConfigure, PluginManifest, SourcedKeyType, SourcedValue, UniEpRaw, UniItem, UniItemAuthor, UniItemRaw } from "@delta-comic/model";
6
+ import { TSchema } from "typebox";
7
+ //#region lib/generated/favourite_card.table.d.ts
8
+ interface FavouriteCardTable {
9
+ createAt: number;
10
+ title: string;
11
+ private: boolean;
12
+ description: string;
13
+ }
14
+ //#endregion
15
+ //#region lib/generated/favourite_item.table.d.ts
16
+ interface FavouriteItemTable {
17
+ addTime: number;
18
+ belongTo: number;
19
+ itemKey: string;
20
+ }
21
+ //#endregion
22
+ //#region lib/generated/item_store.table.d.ts
23
+ interface ItemStoreTable {
24
+ key: string;
25
+ item: JSONColumnType<UniItemRaw>;
26
+ }
6
27
  declare namespace utils_d_exports {
7
28
  export { CommonQueryKey, countDb, withTransition };
8
29
  }
@@ -14,11 +35,7 @@ declare enum CommonQueryKey {
14
35
  declare namespace itemStore_d_exports {
15
36
  export { QueryKey$5 as QueryKey, StorableItem, StoredItem, Table$6 as Table, itemKey, useUpsert$4 as useUpsert };
16
37
  }
17
- interface Table$6 {
18
- /** @description primary key */
19
- key: string;
20
- item: JSONColumnType<UniItemRaw>;
21
- }
38
+ type Table$6 = ItemStoreTable;
22
39
  type StorableItem = UniItem | UniItemRaw;
23
40
  type StoredItem = Selectable<Table$6>;
24
41
  declare const itemKey: SourcedValue<[string, string]>;
@@ -50,20 +67,9 @@ declare const useUpsert$4: () => {
50
67
  declare namespace favourite_d_exports {
51
68
  export { Card, CardTable, Item$3 as Item, ItemTable, QueryKey$4 as QueryKey, useCreateCard, useMoveItem, useQueryCard, useQueryItem, useUpsertItem };
52
69
  }
53
- interface CardTable {
54
- title: string;
55
- private: boolean;
56
- description: string;
57
- /** @description primary key */
58
- createAt: number;
59
- }
70
+ type CardTable = FavouriteCardTable;
60
71
  type Card = Selectable<CardTable>;
61
- interface ItemTable {
62
- itemKey: string;
63
- /** @description foreign key */
64
- belongTo: CardTable['createAt'];
65
- addTime: number;
66
- }
72
+ type ItemTable = FavouriteItemTable;
67
73
  type Item$3 = Selectable<ItemTable>;
68
74
  declare enum QueryKey$4 {
69
75
  item = "db:favouriteItem:",
@@ -75,7 +81,7 @@ declare const useUpsertItem: () => {
75
81
  belongTos: Item$3["belongTo"][];
76
82
  trx?: Kysely$1<DB>;
77
83
  }) => Promise<void>;
78
- key: (CommonQueryKey | QueryKey$4 | QueryKey$5)[];
84
+ key: (CommonQueryKey | QueryKey$5 | QueryKey$4)[];
79
85
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
80
86
  status: import("vue").ShallowRef<import("@pinia/colada").DataStateStatus>;
81
87
  asyncStatus: import("vue").ShallowRef<import("@pinia/colada").AsyncStatus>;
@@ -144,23 +150,27 @@ declare const useCreateCard: () => {
144
150
  }) => void;
145
151
  reset: () => void;
146
152
  };
147
- declare const useQueryItem: <T>(query: (db: SelectQueryBuilder<DB, "favouriteItem", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
148
- declare const useQueryCard: <T>(query: (db: SelectQueryBuilder<DB, "favouriteCard", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
149
- declare namespace plugin_d_exports {
150
- export { Archive, Meta, QueryKey$3 as QueryKey, Table$5 as Table, removeByNames, useQuery$4 as useQuery, useRemove$3 as useRemove, useToggleEnable, useUpsert$3 as useUpsert };
151
- }
152
- type Meta = PluginManifest;
153
- interface Table$5 {
153
+ declare const useQueryItem: <T>(query: (db: SelectQueryBuilder<DB, "favouriteItem", {}>) => Promise<T>, otherKeys?: MaybeRefOrGetter<EntryKey>, initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
154
+ declare const useQueryCard: <T>(query: (db: SelectQueryBuilder<DB, "favouriteCard", {}>) => Promise<T>, otherKeys?: MaybeRefOrGetter<EntryKey>, initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
155
+ //#endregion
156
+ //#region lib/generated/plugin.table.d.ts
157
+ interface PluginTable {
154
158
  installerName: string;
155
159
  loaderName: string;
156
- /** @description primary key */
157
160
  pluginName: string;
158
- meta: JSONColumnType<Meta>;
161
+ meta: JSONColumnType<PluginManifest>;
159
162
  enable: boolean;
160
163
  installInput: string;
161
- displayName: string;
164
+ displayName: string | null;
162
165
  }
163
- /** @description Not Blue */
166
+ declare namespace plugin_d_exports {
167
+ export { Archive, Meta, QueryKey$3 as QueryKey, Table$5 as Table, removeByNames, useQuery$4 as useQuery, useRemove$3 as useRemove, useToggleEnable, useUpsert$3 as useUpsert };
168
+ }
169
+ type Meta = PluginManifest;
170
+ type Table$5 = Omit<PluginTable, 'meta' | 'enable'> & {
171
+ meta: Selectable<PluginTable>['meta'];
172
+ enable: boolean;
173
+ };
164
174
  type Archive = Selectable<Table$5>;
165
175
  declare enum QueryKey$3 {
166
176
  item = "db:plugin:"
@@ -233,15 +243,17 @@ declare const useToggleEnable: () => {
233
243
  reset: () => void;
234
244
  };
235
245
  declare const useQuery$4: <T>(query: (db: SelectQueryBuilder<DB, "plugin", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
236
- declare namespace history_d_exports {
237
- export { Item$2 as Item, QueryKey$2 as QueryKey, Table$4 as Table, useQuery$3 as useQuery, useRemove$2 as useRemove, useUpsert$2 as useUpsert };
238
- }
239
- interface Table$4 {
240
- /** @description primary key */
246
+ //#endregion
247
+ //#region lib/generated/history.table.d.ts
248
+ interface HistoryTable {
249
+ ep: JSONColumnType<UniEpRaw>;
241
250
  timestamp: number;
242
251
  itemKey: string;
243
- ep: JSONColumnType<UniEpRaw>;
244
252
  }
253
+ declare namespace history_d_exports {
254
+ export { Item$2 as Item, QueryKey$2 as QueryKey, Table$4 as Table, useQuery$3 as useQuery, useRemove$2 as useRemove, useUpsert$2 as useUpsert };
255
+ }
256
+ type Table$4 = HistoryTable;
245
257
  type Item$2 = Selectable<Table$4>;
246
258
  declare enum QueryKey$2 {
247
259
  item = "db:history:"
@@ -251,7 +263,7 @@ declare const useUpsert$2: () => {
251
263
  item: StorableItem;
252
264
  trx?: Kysely$1<DB>;
253
265
  }) => Promise<void>;
254
- key: (CommonQueryKey | QueryKey$5 | QueryKey$2)[];
266
+ key: (CommonQueryKey | QueryKey$2 | QueryKey$5)[];
255
267
  state: import("vue").ComputedRef<import("@pinia/colada").DataState<void, Error, undefined>>;
256
268
  status: import("vue").ShallowRef<import("@pinia/colada").DataStateStatus>;
257
269
  asyncStatus: import("vue").ShallowRef<import("@pinia/colada").AsyncStatus>;
@@ -291,39 +303,44 @@ declare const useRemove$2: () => {
291
303
  reset: () => void;
292
304
  };
293
305
  declare const useQuery$3: <T>(query: (db: SelectQueryBuilder<DB, "history", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
294
- declare namespace config_d_exports {
295
- export { ConfigDescription, ConfigRef, Table$3 as Table, useConfig };
296
- }
297
- interface Table$3 {
298
- /** @description config owner, usually plugin name */
306
+ //#endregion
307
+ //#region lib/generated/config.table.d.ts
308
+ interface ConfigTable {
299
309
  belongTo: string;
300
- /** @description serialized form structure */
301
310
  form: string;
302
- /** @description serialized config data */
303
311
  data: string;
304
312
  }
313
+ declare namespace config_d_exports {
314
+ export { ConfigDescription, ConfigRef, Table$3 as Table, useConfig };
315
+ }
316
+ type Table$3 = ConfigTable;
305
317
  type ConfigRef<T> = Ref<T> & {
306
318
  readonly ready: Promise<void>;
307
319
  };
308
320
  type ConfigDescription = Record<string, Required<Pick<FormSingleConfigure, 'defaultValue'>> & FormSingleConfigure>;
309
321
  declare const useConfig: <T extends ConfigDescription>(belongTo: string, form: T) => ConfigRef<FormResult<T>>;
310
322
  //#endregion
311
- //#region lib/nativeStore/index.d.ts
312
- interface Table {
323
+ //#region lib/generated/native_store.table.d.ts
324
+ interface NativeStoreTable {
313
325
  namespace: string;
314
326
  key: string;
315
327
  value: string;
316
328
  }
329
+ //#endregion
330
+ //#region lib/nativeStore/index.d.ts
331
+ type Table = NativeStoreTable;
317
332
  declare const useNativeStore: <T extends object>(namespace: string, key: MaybeRefOrGetter<string>, defaultValue: MaybeRefOrGetter<T>) => Ref<T, T>;
318
- declare namespace recentView_d_exports {
319
- export { Item$1 as Item, QueryKey$1 as QueryKey, Table$2 as Table, useQuery$2 as useQuery, useRemove$1 as useRemove, useUpsert$1 as useUpsert };
320
- }
321
- interface Table$2 {
322
- /** @description primary key */
333
+ //#endregion
334
+ //#region lib/generated/recent_view.table.d.ts
335
+ interface RecentViewTable {
323
336
  timestamp: number;
324
337
  itemKey: string;
325
338
  isViewed: boolean;
326
339
  }
340
+ declare namespace recentView_d_exports {
341
+ export { Item$1 as Item, QueryKey$1 as QueryKey, Table$2 as Table, useQuery$2 as useQuery, useRemove$1 as useRemove, useUpsert$1 as useUpsert };
342
+ }
343
+ type Table$2 = RecentViewTable;
327
344
  type Item$1 = Selectable<Table$2>;
328
345
  declare enum QueryKey$1 {
329
346
  item = "db:recentView:"
@@ -373,31 +390,34 @@ declare const useRemove$1: () => {
373
390
  reset: () => void;
374
391
  };
375
392
  declare const useQuery$2: <T>(query: (db: SelectQueryBuilder<DB, "recentView", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
393
+ //#endregion
394
+ //#region lib/generated/subscribe.table.d.ts
395
+ interface SubscribeTable {
396
+ itemKey: string | null;
397
+ author: JSONColumnType<UniItemAuthor> | null;
398
+ type: string;
399
+ key: string;
400
+ plugin: string;
401
+ }
376
402
  declare namespace subscribe_d_exports {
377
403
  export { AuthorItem, AuthorTable, EpItem, EpTable, Item, Key, Key_, QueryKey, Table$1 as Table, key, useQuery$1 as useQuery, useRemove, useUpsert };
378
404
  }
379
405
  declare const key: SourcedValue<[plugin: string, label: string]>;
380
406
  type Key_ = SourcedKeyType<typeof key>;
381
407
  type Key = Exclude<Key_, string>;
382
- interface AuthorTable {
383
- author: JSONColumnType<UniItemAuthor>;
408
+ type AuthorTable = Omit<SubscribeTable, 'itemKey' | 'author' | 'type'> & {
409
+ author: Selectable<SubscribeTable>['author'];
384
410
  itemKey: null;
385
411
  type: 'author';
386
- /** @description primary key */
387
- key: string;
388
- plugin: string;
389
- }
390
- type AuthorItem = Selectable<AuthorTable>;
391
- interface EpTable {
412
+ };
413
+ type AuthorItem = AuthorTable;
414
+ type EpTable = Omit<SubscribeTable, 'itemKey' | 'author' | 'type'> & {
392
415
  author: null;
393
416
  itemKey: string;
394
417
  type: 'ep';
395
- /** @description primary key */
396
- key: string;
397
- plugin: string;
398
- }
399
- type EpItem = Selectable<EpTable>;
400
- type Table$1 = AuthorTable | EpTable;
418
+ };
419
+ type EpItem = EpTable;
420
+ type Table$1 = SubscribeTable;
401
421
  type Item = AuthorItem | EpItem;
402
422
  declare enum QueryKey {
403
423
  item = "db:subscribe:"
@@ -448,6 +468,447 @@ declare const useRemove: () => {
448
468
  };
449
469
  declare const useQuery$1: <T>(query: (db: SelectQueryBuilder<DB, "subscribe", {}>) => Promise<T>, otherKeys?: readonly EntryKey[], initialData?: () => T) => import("@pinia/colada").UseQueryReturn<T, Error, T>;
450
470
  //#endregion
471
+ //#region lib/writeValidation.d.ts
472
+ /**
473
+ * Centralized write gate: validates every insert/replace/update against the
474
+ * generated camelCase row schema before it reaches the dialect. Registered
475
+ * before CamelCasePlugin, so it observes camelCase identifiers and raw values.
476
+ */
477
+ declare class WriteValidationPlugin implements KyselyPlugin {
478
+ transformQuery({ node }: PluginTransformQueryArgs): RootOperationNode;
479
+ transformResult({ result }: PluginTransformResultArgs): Promise<QueryResult<UnknownRow>>;
480
+ }
481
+ //#endregion
482
+ //#region lib/generated/schemas.d.ts
483
+ declare const clientCamelRowSchemas: {
484
+ itemStore: {
485
+ readonly type: "object";
486
+ readonly properties: {
487
+ readonly key: {
488
+ readonly type: "string";
489
+ };
490
+ readonly item: {
491
+ readonly anyOf: readonly [{
492
+ readonly type: "object";
493
+ }, {
494
+ readonly type: "string";
495
+ }];
496
+ };
497
+ };
498
+ readonly required: readonly ["key", "item"];
499
+ readonly additionalProperties: false;
500
+ };
501
+ favouriteCard: {
502
+ readonly type: "object";
503
+ readonly properties: {
504
+ readonly createAt: {
505
+ readonly type: "integer";
506
+ };
507
+ readonly title: {
508
+ readonly type: "string";
509
+ };
510
+ readonly private: {
511
+ readonly anyOf: readonly [{
512
+ readonly type: "boolean";
513
+ }, {
514
+ readonly const: 0;
515
+ }, {
516
+ readonly const: 1;
517
+ }];
518
+ };
519
+ readonly description: {
520
+ readonly type: "string";
521
+ };
522
+ };
523
+ readonly required: readonly ["createAt", "title", "private", "description"];
524
+ readonly additionalProperties: false;
525
+ };
526
+ favouriteItem: {
527
+ readonly type: "object";
528
+ readonly properties: {
529
+ readonly addTime: {
530
+ readonly type: "integer";
531
+ };
532
+ readonly belongTo: {
533
+ readonly type: "integer";
534
+ };
535
+ readonly itemKey: {
536
+ readonly type: "string";
537
+ };
538
+ };
539
+ readonly required: readonly ["addTime", "belongTo", "itemKey"];
540
+ readonly additionalProperties: false;
541
+ };
542
+ history: {
543
+ readonly type: "object";
544
+ readonly properties: {
545
+ readonly ep: {
546
+ readonly anyOf: readonly [{
547
+ readonly type: "object";
548
+ }, {
549
+ readonly type: "string";
550
+ }];
551
+ };
552
+ readonly timestamp: {
553
+ readonly type: "integer";
554
+ };
555
+ readonly itemKey: {
556
+ readonly type: "string";
557
+ };
558
+ };
559
+ readonly required: readonly ["ep", "timestamp", "itemKey"];
560
+ readonly additionalProperties: false;
561
+ };
562
+ recentView: {
563
+ readonly type: "object";
564
+ readonly properties: {
565
+ readonly timestamp: {
566
+ readonly type: "integer";
567
+ };
568
+ readonly itemKey: {
569
+ readonly type: "string";
570
+ };
571
+ readonly isViewed: {
572
+ readonly anyOf: readonly [{
573
+ readonly type: "boolean";
574
+ }, {
575
+ readonly const: 0;
576
+ }, {
577
+ readonly const: 1;
578
+ }];
579
+ };
580
+ };
581
+ readonly required: readonly ["timestamp", "itemKey", "isViewed"];
582
+ readonly additionalProperties: false;
583
+ };
584
+ subscribe: {
585
+ readonly type: "object";
586
+ readonly properties: {
587
+ readonly itemKey: {
588
+ readonly anyOf: readonly [{
589
+ readonly type: "string";
590
+ }, {
591
+ readonly type: "null";
592
+ }];
593
+ };
594
+ readonly author: {
595
+ readonly anyOf: readonly [{
596
+ readonly type: "object";
597
+ }, {
598
+ readonly type: "string";
599
+ }, {
600
+ readonly type: "null";
601
+ }];
602
+ };
603
+ readonly type: {
604
+ readonly type: "string";
605
+ };
606
+ readonly key: {
607
+ readonly type: "string";
608
+ };
609
+ readonly plugin: {
610
+ readonly type: "string";
611
+ };
612
+ };
613
+ readonly required: readonly ["itemKey", "author", "type", "key", "plugin"];
614
+ readonly additionalProperties: false;
615
+ };
616
+ plugin: {
617
+ readonly type: "object";
618
+ readonly properties: {
619
+ readonly installerName: {
620
+ readonly type: "string";
621
+ };
622
+ readonly loaderName: {
623
+ readonly type: "string";
624
+ };
625
+ readonly pluginName: {
626
+ readonly type: "string";
627
+ };
628
+ readonly meta: {
629
+ readonly anyOf: readonly [{
630
+ readonly type: "object";
631
+ }, {
632
+ readonly type: "string";
633
+ }];
634
+ };
635
+ readonly enable: {
636
+ readonly anyOf: readonly [{
637
+ readonly type: "boolean";
638
+ }, {
639
+ readonly const: 0;
640
+ }, {
641
+ readonly const: 1;
642
+ }];
643
+ };
644
+ readonly installInput: {
645
+ readonly type: "string";
646
+ };
647
+ readonly displayName: {
648
+ readonly anyOf: readonly [{
649
+ readonly type: "string";
650
+ }, {
651
+ readonly type: "null";
652
+ }];
653
+ };
654
+ };
655
+ readonly required: readonly ["installerName", "loaderName", "pluginName", "meta", "enable", "installInput", "displayName"];
656
+ readonly additionalProperties: false;
657
+ };
658
+ nativeStore: {
659
+ readonly type: "object";
660
+ readonly properties: {
661
+ readonly namespace: {
662
+ readonly type: "string";
663
+ };
664
+ readonly key: {
665
+ readonly type: "string";
666
+ };
667
+ readonly value: {
668
+ readonly type: "string";
669
+ };
670
+ };
671
+ readonly required: readonly ["namespace", "key", "value"];
672
+ readonly additionalProperties: false;
673
+ };
674
+ config: {
675
+ readonly type: "object";
676
+ readonly properties: {
677
+ readonly belongTo: {
678
+ readonly type: "string";
679
+ };
680
+ readonly form: {
681
+ readonly type: "string";
682
+ };
683
+ readonly data: {
684
+ readonly type: "string";
685
+ };
686
+ };
687
+ readonly required: readonly ["belongTo", "form", "data"];
688
+ readonly additionalProperties: false;
689
+ };
690
+ };
691
+ //#endregion
692
+ //#region lib/validation.d.ts
693
+ type ClientTableName = keyof typeof clientCamelRowSchemas;
694
+ declare const tableSchema: <K extends ClientTableName>(table: K) => {
695
+ itemStore: {
696
+ readonly type: "object";
697
+ readonly properties: {
698
+ readonly key: {
699
+ readonly type: "string";
700
+ };
701
+ readonly item: {
702
+ readonly anyOf: readonly [{
703
+ readonly type: "object";
704
+ }, {
705
+ readonly type: "string";
706
+ }];
707
+ };
708
+ };
709
+ readonly required: readonly ["key", "item"];
710
+ readonly additionalProperties: false;
711
+ };
712
+ favouriteCard: {
713
+ readonly type: "object";
714
+ readonly properties: {
715
+ readonly createAt: {
716
+ readonly type: "integer";
717
+ };
718
+ readonly title: {
719
+ readonly type: "string";
720
+ };
721
+ readonly private: {
722
+ readonly anyOf: readonly [{
723
+ readonly type: "boolean";
724
+ }, {
725
+ readonly const: 0;
726
+ }, {
727
+ readonly const: 1;
728
+ }];
729
+ };
730
+ readonly description: {
731
+ readonly type: "string";
732
+ };
733
+ };
734
+ readonly required: readonly ["createAt", "title", "private", "description"];
735
+ readonly additionalProperties: false;
736
+ };
737
+ favouriteItem: {
738
+ readonly type: "object";
739
+ readonly properties: {
740
+ readonly addTime: {
741
+ readonly type: "integer";
742
+ };
743
+ readonly belongTo: {
744
+ readonly type: "integer";
745
+ };
746
+ readonly itemKey: {
747
+ readonly type: "string";
748
+ };
749
+ };
750
+ readonly required: readonly ["addTime", "belongTo", "itemKey"];
751
+ readonly additionalProperties: false;
752
+ };
753
+ history: {
754
+ readonly type: "object";
755
+ readonly properties: {
756
+ readonly ep: {
757
+ readonly anyOf: readonly [{
758
+ readonly type: "object";
759
+ }, {
760
+ readonly type: "string";
761
+ }];
762
+ };
763
+ readonly timestamp: {
764
+ readonly type: "integer";
765
+ };
766
+ readonly itemKey: {
767
+ readonly type: "string";
768
+ };
769
+ };
770
+ readonly required: readonly ["ep", "timestamp", "itemKey"];
771
+ readonly additionalProperties: false;
772
+ };
773
+ recentView: {
774
+ readonly type: "object";
775
+ readonly properties: {
776
+ readonly timestamp: {
777
+ readonly type: "integer";
778
+ };
779
+ readonly itemKey: {
780
+ readonly type: "string";
781
+ };
782
+ readonly isViewed: {
783
+ readonly anyOf: readonly [{
784
+ readonly type: "boolean";
785
+ }, {
786
+ readonly const: 0;
787
+ }, {
788
+ readonly const: 1;
789
+ }];
790
+ };
791
+ };
792
+ readonly required: readonly ["timestamp", "itemKey", "isViewed"];
793
+ readonly additionalProperties: false;
794
+ };
795
+ subscribe: {
796
+ readonly type: "object";
797
+ readonly properties: {
798
+ readonly itemKey: {
799
+ readonly anyOf: readonly [{
800
+ readonly type: "string";
801
+ }, {
802
+ readonly type: "null";
803
+ }];
804
+ };
805
+ readonly author: {
806
+ readonly anyOf: readonly [{
807
+ readonly type: "object";
808
+ }, {
809
+ readonly type: "string";
810
+ }, {
811
+ readonly type: "null";
812
+ }];
813
+ };
814
+ readonly type: {
815
+ readonly type: "string";
816
+ };
817
+ readonly key: {
818
+ readonly type: "string";
819
+ };
820
+ readonly plugin: {
821
+ readonly type: "string";
822
+ };
823
+ };
824
+ readonly required: readonly ["itemKey", "author", "type", "key", "plugin"];
825
+ readonly additionalProperties: false;
826
+ };
827
+ plugin: {
828
+ readonly type: "object";
829
+ readonly properties: {
830
+ readonly installerName: {
831
+ readonly type: "string";
832
+ };
833
+ readonly loaderName: {
834
+ readonly type: "string";
835
+ };
836
+ readonly pluginName: {
837
+ readonly type: "string";
838
+ };
839
+ readonly meta: {
840
+ readonly anyOf: readonly [{
841
+ readonly type: "object";
842
+ }, {
843
+ readonly type: "string";
844
+ }];
845
+ };
846
+ readonly enable: {
847
+ readonly anyOf: readonly [{
848
+ readonly type: "boolean";
849
+ }, {
850
+ readonly const: 0;
851
+ }, {
852
+ readonly const: 1;
853
+ }];
854
+ };
855
+ readonly installInput: {
856
+ readonly type: "string";
857
+ };
858
+ readonly displayName: {
859
+ readonly anyOf: readonly [{
860
+ readonly type: "string";
861
+ }, {
862
+ readonly type: "null";
863
+ }];
864
+ };
865
+ };
866
+ readonly required: readonly ["installerName", "loaderName", "pluginName", "meta", "enable", "installInput", "displayName"];
867
+ readonly additionalProperties: false;
868
+ };
869
+ nativeStore: {
870
+ readonly type: "object";
871
+ readonly properties: {
872
+ readonly namespace: {
873
+ readonly type: "string";
874
+ };
875
+ readonly key: {
876
+ readonly type: "string";
877
+ };
878
+ readonly value: {
879
+ readonly type: "string";
880
+ };
881
+ };
882
+ readonly required: readonly ["namespace", "key", "value"];
883
+ readonly additionalProperties: false;
884
+ };
885
+ config: {
886
+ readonly type: "object";
887
+ readonly properties: {
888
+ readonly belongTo: {
889
+ readonly type: "string";
890
+ };
891
+ readonly form: {
892
+ readonly type: "string";
893
+ };
894
+ readonly data: {
895
+ readonly type: "string";
896
+ };
897
+ };
898
+ readonly required: readonly ["belongTo", "form", "data"];
899
+ readonly additionalProperties: false;
900
+ };
901
+ }[K];
902
+ /** Validates a row before writing; throws to block invalid data from persisting. */
903
+ declare const assertWrite: <T>(schema: TSchema, table: string, value: T) => T;
904
+ declare const assertWriteRow: <K extends ClientTableName, T>(table: K, value: T) => T;
905
+ /** Validates a row on read; failures are non-intrusive: logged and the value returned as-is. */
906
+ declare const validateRead: <T>(schema: TSchema, table: string, value: T) => T;
907
+ declare const validateReadRow: <K extends ClientTableName, T>(table: K, value: T) => T;
908
+ /** Filters invalid rows on read; failures are non-intrusive: logged and the row dropped. */
909
+ declare const filterValidRows: <T>(schema: TSchema, table: string, rows: readonly T[]) => T[];
910
+ declare const filterValidRowsFor: <K extends ClientTableName, T>(table: K, rows: readonly T[]) => T[];
911
+ //#endregion
451
912
  //#region lib/index.d.ts
452
913
  interface DB {
453
914
  itemStore: Table$6;
@@ -456,12 +917,12 @@ interface DB {
456
917
  history: Table$4;
457
918
  recentView: Table$2;
458
919
  subscribe: Table$1;
459
- plugin: Table$5;
920
+ plugin: PluginTable;
460
921
  nativeStore: Table;
461
922
  config: Table$3;
462
923
  }
463
924
  declare const isTauriRuntime: typeof isTauri;
464
925
  declare const db: Kysely$1<DB>;
465
926
  //#endregion
466
- export { config_d_exports as ConfigDB, DB, utils_d_exports as DBUtils, favourite_d_exports as FavouriteDB, history_d_exports as HistoryDB, type InsertObject, itemStore_d_exports as ItemStoreDB, type Kysely, plugin_d_exports as PluginArchiveDB, recentView_d_exports as RecentDB, subscribe_d_exports as SubscribeDB, Table, db, isTauriRuntime, useConfig, useNativeStore };
927
+ export { ClientTableName, config_d_exports as ConfigDB, DB, utils_d_exports as DBUtils, favourite_d_exports as FavouriteDB, history_d_exports as HistoryDB, type InsertObject, itemStore_d_exports as ItemStoreDB, type Kysely, plugin_d_exports as PluginArchiveDB, type PluginTable, recentView_d_exports as RecentDB, subscribe_d_exports as SubscribeDB, Table, WriteValidationPlugin, assertWrite, assertWriteRow, db, filterValidRows, filterValidRowsFor, isTauriRuntime, tableSchema, useConfig, useNativeStore, validateRead, validateReadRow };
467
928
  //# sourceMappingURL=index.d.mts.map