@delta-comic/db 0.0.8 → 1.3.1

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.
@@ -1,17 +1,100 @@
1
- import { Selectable } from 'kysely';
1
+ import { Kysely, Selectable, SelectQueryBuilder } from 'kysely';
2
+ import { CommonQueryKey } from './utils';
3
+ import { DB } from '.';
2
4
  import * as ItemStoreDB from './itemStore';
3
5
  export interface CardTable {
4
6
  title: string;
5
7
  private: boolean;
6
8
  description: string;
9
+ /** @description primary key */
7
10
  createAt: number;
8
11
  }
9
12
  export type Card = Selectable<CardTable>;
10
13
  export interface ItemTable {
11
14
  itemKey: string;
15
+ /** @description foreign key */
12
16
  belongTo: CardTable['createAt'];
13
17
  addTime: number;
14
18
  }
15
19
  export type Item = Selectable<ItemTable>;
16
- export declare function upsertItem(item: ItemStoreDB.StorableItem, ...belongTos: Item['belongTo'][]): Promise<void>;
17
- export declare function moveItem(item: ItemStoreDB.StorableItem, from: Item['belongTo'], ...tos: Item['belongTo'][]): Promise<void>;
20
+ export declare enum QueryKey {
21
+ item = "db:favouriteItem:",
22
+ card = "db:favouriteCard:"
23
+ }
24
+ export declare const useUpsertItem: () => {
25
+ upsert: (vars: {
26
+ item: ItemStoreDB.StorableItem;
27
+ belongTos: Item["belongTo"][];
28
+ trx?: Kysely<DB>;
29
+ }) => Promise<void>;
30
+ key: (CommonQueryKey | ItemStoreDB.QueryKey | QueryKey)[];
31
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
32
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
33
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
34
+ data: import('vue').ShallowRef<void | undefined>;
35
+ error: import('vue').ShallowRef<Error | null>;
36
+ isLoading: import('vue').ComputedRef<boolean>;
37
+ variables: import('vue').ShallowRef<{
38
+ item: ItemStoreDB.StorableItem;
39
+ belongTos: Item["belongTo"][];
40
+ trx?: Kysely<DB>;
41
+ } | undefined>;
42
+ mutate: (vars: {
43
+ item: ItemStoreDB.StorableItem;
44
+ belongTos: Item["belongTo"][];
45
+ trx?: Kysely<DB>;
46
+ }) => void;
47
+ reset: () => void;
48
+ };
49
+ export declare const useMoveItem: () => {
50
+ move: (vars: {
51
+ item: ItemStoreDB.StorableItem;
52
+ from: Item["belongTo"];
53
+ aims: Item["belongTo"][];
54
+ trx?: Kysely<DB>;
55
+ }) => Promise<void>;
56
+ key: QueryKey[];
57
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
58
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
59
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
60
+ data: import('vue').ShallowRef<void | undefined>;
61
+ error: import('vue').ShallowRef<Error | null>;
62
+ isLoading: import('vue').ComputedRef<boolean>;
63
+ variables: import('vue').ShallowRef<{
64
+ item: ItemStoreDB.StorableItem;
65
+ from: Item["belongTo"];
66
+ aims: Item["belongTo"][];
67
+ trx?: Kysely<DB>;
68
+ } | undefined>;
69
+ mutate: (vars: {
70
+ item: ItemStoreDB.StorableItem;
71
+ from: Item["belongTo"];
72
+ aims: Item["belongTo"][];
73
+ trx?: Kysely<DB>;
74
+ }) => void;
75
+ reset: () => void;
76
+ };
77
+ export declare const useCreateCard: () => {
78
+ createCard: (vars: {
79
+ card: Card;
80
+ trx?: Kysely<DB>;
81
+ }) => Promise<void>;
82
+ key: QueryKey[];
83
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
84
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
85
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
86
+ data: import('vue').ShallowRef<void | undefined>;
87
+ error: import('vue').ShallowRef<Error | null>;
88
+ isLoading: import('vue').ComputedRef<boolean>;
89
+ variables: import('vue').ShallowRef<{
90
+ card: Card;
91
+ trx?: Kysely<DB>;
92
+ } | undefined>;
93
+ mutate: (vars: {
94
+ card: Card;
95
+ trx?: Kysely<DB>;
96
+ }) => void;
97
+ reset: () => void;
98
+ };
99
+ export declare const useQueryItem: <T>(query: (db: SelectQueryBuilder<DB, "favouriteItem", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import('@pinia/colada').UseQueryReturn<T, Error, T>;
100
+ export declare const useQueryCard: <T>(query: (db: SelectQueryBuilder<DB, "favouriteCard", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import('@pinia/colada').UseQueryReturn<T, Error, T>;
@@ -1,10 +1,60 @@
1
- import { JSONColumnType, Selectable } from 'kysely';
2
1
  import { uni } from '@delta-comic/model';
2
+ import { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely';
3
+ import { CommonQueryKey } from './utils';
4
+ import { DB } from '.';
3
5
  import * as ItemStoreDB from './itemStore';
4
6
  export interface Table {
7
+ /** @description primary key */
5
8
  timestamp: number;
6
9
  itemKey: string;
7
10
  ep: JSONColumnType<uni.ep.RawEp>;
8
11
  }
9
12
  export type Item = Selectable<Table>;
10
- export declare function upsert(item: ItemStoreDB.StorableItem): Promise<void>;
13
+ export declare enum QueryKey {
14
+ item = "db:history:"
15
+ }
16
+ export declare const useUpsert: () => {
17
+ upsert: (vars: {
18
+ item: ItemStoreDB.StorableItem;
19
+ trx?: Kysely<DB>;
20
+ }) => Promise<void>;
21
+ key: (CommonQueryKey | ItemStoreDB.QueryKey | QueryKey)[];
22
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
23
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
24
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
25
+ data: import('vue').ShallowRef<void | undefined>;
26
+ error: import('vue').ShallowRef<Error | null>;
27
+ isLoading: import('vue').ComputedRef<boolean>;
28
+ variables: import('vue').ShallowRef<{
29
+ item: ItemStoreDB.StorableItem;
30
+ trx?: Kysely<DB>;
31
+ } | undefined>;
32
+ mutate: (vars: {
33
+ item: ItemStoreDB.StorableItem;
34
+ trx?: Kysely<DB>;
35
+ }) => void;
36
+ reset: () => void;
37
+ };
38
+ export declare const useRemove: () => {
39
+ remove: (vars: {
40
+ keys: Item["timestamp"][];
41
+ trx?: Kysely<DB>;
42
+ }) => Promise<void>;
43
+ key: (CommonQueryKey | QueryKey)[];
44
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
45
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
46
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
47
+ data: import('vue').ShallowRef<void | undefined>;
48
+ error: import('vue').ShallowRef<Error | null>;
49
+ isLoading: import('vue').ComputedRef<boolean>;
50
+ variables: import('vue').ShallowRef<{
51
+ keys: Item["timestamp"][];
52
+ trx?: Kysely<DB>;
53
+ } | undefined>;
54
+ mutate: (vars: {
55
+ keys: Item["timestamp"][];
56
+ trx?: Kysely<DB>;
57
+ }) => void;
58
+ reset: () => void;
59
+ };
60
+ export declare const useQuery: <T>(query: (db: SelectQueryBuilder<DB, "history", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import('@pinia/colada').UseQueryReturn<T, Error, T>;
@@ -1,15 +1,15 @@
1
- import { Kysely, SelectQueryBuilder } from 'kysely';
2
- import type * as PluginArchiveDB from './plugin';
3
- export * as PluginArchiveDB from './plugin';
1
+ import { Kysely } from 'kysely';
4
2
  import type * as FavouriteDB from './favourite';
5
- export * as FavouriteDB from './favourite';
3
+ export * as PluginArchiveDB from './plugin';
6
4
  import type * as HistoryDB from './history';
7
- export * as HistoryDB from './history';
5
+ export * as FavouriteDB from './favourite';
8
6
  import type * as ItemStoreDB from './itemStore';
7
+ export * as HistoryDB from './history';
8
+ import type * as PluginArchiveDB from './plugin';
9
9
  export * as ItemStoreDB from './itemStore';
10
- import type * as SubscribeDB from './subscribe';
11
- export * as SubscribeDB from './subscribe';
12
10
  import type * as RecentDB from './recentView';
11
+ export * as SubscribeDB from './subscribe';
12
+ import type * as SubscribeDB from './subscribe';
13
13
  export * as RecentDB from './recentView';
14
14
  export interface DB {
15
15
  itemStore: ItemStoreDB.Table;
@@ -20,8 +20,6 @@ export interface DB {
20
20
  subscribe: SubscribeDB.Table;
21
21
  plugin: PluginArchiveDB.Table;
22
22
  }
23
- export declare const db: import('vue').ShallowRef<Kysely<DB>, Kysely<DB>>;
24
- export declare namespace DBUtils {
25
- function countDb(sql: SelectQueryBuilder<DB, any, object>): Promise<number>;
26
- }
23
+ export declare const db: Kysely<DB>;
24
+ export * as DBUtils from './utils';
27
25
  export * from './nativeStore';
@@ -1,10 +1,37 @@
1
- import { JSONColumnType, Selectable } from 'kysely';
2
1
  import { SourcedValue, uni } from '@delta-comic/model';
2
+ import { JSONColumnType, Kysely, Selectable } from 'kysely';
3
+ import { CommonQueryKey } from './utils';
4
+ import { DB } from '.';
3
5
  export interface Table {
6
+ /** @description primary key */
4
7
  key: string;
5
8
  item: JSONColumnType<uni.item.RawItem>;
6
9
  }
7
10
  export type StorableItem = uni.item.Item | uni.item.RawItem;
8
11
  export type StoredItem = Selectable<Table>;
9
- export declare const key: SourcedValue<[string, string]>;
10
- export declare function upsert(item: StorableItem): Promise<string>;
12
+ export declare const itemKey: SourcedValue<[string, string]>;
13
+ export declare enum QueryKey {
14
+ item = "db:itemStore:"
15
+ }
16
+ export declare const useUpsert: () => {
17
+ upsert: (vars: {
18
+ item: StorableItem;
19
+ trx?: Kysely<DB>;
20
+ }) => Promise<string>;
21
+ key: (CommonQueryKey | QueryKey)[];
22
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<string, Error, undefined>>;
23
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
24
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
25
+ data: import('vue').ShallowRef<string | undefined>;
26
+ error: import('vue').ShallowRef<Error | null>;
27
+ isLoading: import('vue').ComputedRef<boolean>;
28
+ variables: import('vue').ShallowRef<{
29
+ item: StorableItem;
30
+ trx?: Kysely<DB>;
31
+ } | undefined>;
32
+ mutate: (vars: {
33
+ item: StorableItem;
34
+ trx?: Kysely<DB>;
35
+ }) => void;
36
+ reset: () => void;
37
+ };
@@ -1,31 +1,109 @@
1
- import { PluginMeta } from '@delta-comic/plugin';
2
- import { JSONColumnType, Selectable } from 'kysely';
1
+ import { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely';
2
+ import { CommonQueryKey } from './utils';
3
+ import { DB } from '.';
4
+ export interface Meta {
5
+ name: {
6
+ display: string;
7
+ id: string;
8
+ };
9
+ version: {
10
+ plugin: string;
11
+ supportCore: string;
12
+ };
13
+ author: string;
14
+ description: string;
15
+ require: {
16
+ id: string;
17
+ download?: string | undefined;
18
+ }[];
19
+ entry?: {
20
+ jsPath: string;
21
+ cssPath?: string;
22
+ };
23
+ beforeBoot?: {
24
+ path: string;
25
+ slot: string;
26
+ }[];
27
+ }
3
28
  export interface Table {
4
29
  installerName: string;
5
30
  loaderName: string;
31
+ /** @description primary key */
6
32
  pluginName: string;
7
- meta: JSONColumnType<PluginMeta>;
33
+ meta: JSONColumnType<Meta>;
8
34
  enable: boolean;
9
35
  installInput: string;
10
36
  displayName: string;
11
37
  }
12
- export type Meta = Selectable<Table>;
13
- export declare function getByEnabled(isEnabled: boolean): Promise<{
14
- installerName: string;
15
- loaderName: string;
16
- pluginName: string;
17
- meta: PluginMeta;
18
- enable: boolean;
19
- installInput: string;
20
- displayName: string;
21
- }[]>;
22
- export declare function get(pluginName: string): Promise<{
23
- installerName: string;
24
- loaderName: string;
25
- pluginName: string;
26
- meta: PluginMeta;
27
- enable: boolean;
28
- installInput: string;
29
- displayName: string;
30
- }>;
31
- export declare function toggleEnable(pluginName: string): Promise<import('kysely').UpdateResult[]>;
38
+ /** @description Not Blue */
39
+ export type Archive = Selectable<Table>;
40
+ export declare enum QueryKey {
41
+ item = "db:plugin:"
42
+ }
43
+ export declare const useUpsert: () => {
44
+ upsert: (vars: {
45
+ archives: Archive[];
46
+ trx?: Kysely<DB>;
47
+ }) => Promise<void>;
48
+ key: (CommonQueryKey | QueryKey)[];
49
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
50
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
51
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
52
+ data: import('vue').ShallowRef<void | undefined>;
53
+ error: import('vue').ShallowRef<Error | null>;
54
+ isLoading: import('vue').ComputedRef<boolean>;
55
+ variables: import('vue').ShallowRef<{
56
+ archives: Archive[];
57
+ trx?: Kysely<DB>;
58
+ } | undefined>;
59
+ mutate: (vars: {
60
+ archives: Archive[];
61
+ trx?: Kysely<DB>;
62
+ }) => void;
63
+ reset: () => void;
64
+ };
65
+ export declare const useRemove: () => {
66
+ remove: (vars: {
67
+ keys: Archive["pluginName"][];
68
+ trx?: Kysely<DB>;
69
+ }) => Promise<void>;
70
+ key: (CommonQueryKey | QueryKey)[];
71
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
72
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
73
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
74
+ data: import('vue').ShallowRef<void | undefined>;
75
+ error: import('vue').ShallowRef<Error | null>;
76
+ isLoading: import('vue').ComputedRef<boolean>;
77
+ variables: import('vue').ShallowRef<{
78
+ keys: Archive["pluginName"][];
79
+ trx?: Kysely<DB>;
80
+ } | undefined>;
81
+ mutate: (vars: {
82
+ keys: Archive["pluginName"][];
83
+ trx?: Kysely<DB>;
84
+ }) => void;
85
+ reset: () => void;
86
+ };
87
+ export declare const useToggleEnable: () => {
88
+ toggle: (vars: {
89
+ keys: Archive["pluginName"][];
90
+ trx?: Kysely<DB>;
91
+ }) => Promise<import('kysely').UpdateResult[] | undefined>;
92
+ key: (CommonQueryKey | QueryKey)[];
93
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<import('kysely').UpdateResult[] | undefined, Error, undefined>>;
94
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
95
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
96
+ data: import('vue').ShallowRef<import('kysely').UpdateResult[] | undefined>;
97
+ error: import('vue').ShallowRef<Error | null>;
98
+ isLoading: import('vue').ComputedRef<boolean>;
99
+ variables: import('vue').ShallowRef<{
100
+ keys: Archive["pluginName"][];
101
+ trx?: Kysely<DB>;
102
+ } | undefined>;
103
+ mutate: (vars: {
104
+ keys: Archive["pluginName"][];
105
+ trx?: Kysely<DB>;
106
+ }) => void;
107
+ reset: () => void;
108
+ };
109
+ export declare const useQuery: <T>(query: (db: SelectQueryBuilder<DB, "plugin", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import('@pinia/colada').UseQueryReturn<T, Error, T>;
@@ -1,9 +1,59 @@
1
- import { Selectable } from 'kysely';
1
+ import { Kysely, Selectable, SelectQueryBuilder } from 'kysely';
2
+ import { CommonQueryKey } from './utils';
3
+ import { DB } from '.';
2
4
  import * as ItemStoreDB from './itemStore';
3
5
  export interface Table {
6
+ /** @description primary key */
4
7
  timestamp: number;
5
8
  itemKey: string;
6
9
  isViewed: boolean;
7
10
  }
8
11
  export type Item = Selectable<Table>;
9
- export declare function upsert(item: ItemStoreDB.StorableItem): Promise<void>;
12
+ export declare enum QueryKey {
13
+ item = "db:recentView:"
14
+ }
15
+ export declare const useUpsert: () => {
16
+ upsert: (vars: {
17
+ item: ItemStoreDB.StorableItem;
18
+ trx?: Kysely<DB>;
19
+ }) => Promise<void>;
20
+ key: (CommonQueryKey | ItemStoreDB.QueryKey | QueryKey)[];
21
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
22
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
23
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
24
+ data: import('vue').ShallowRef<void | undefined>;
25
+ error: import('vue').ShallowRef<Error | null>;
26
+ isLoading: import('vue').ComputedRef<boolean>;
27
+ variables: import('vue').ShallowRef<{
28
+ item: ItemStoreDB.StorableItem;
29
+ trx?: Kysely<DB>;
30
+ } | undefined>;
31
+ mutate: (vars: {
32
+ item: ItemStoreDB.StorableItem;
33
+ trx?: Kysely<DB>;
34
+ }) => void;
35
+ reset: () => void;
36
+ };
37
+ export declare const useRemove: () => {
38
+ remove: (vars: {
39
+ items: Item["timestamp"][];
40
+ trx?: Kysely<DB>;
41
+ }) => Promise<void>;
42
+ key: (CommonQueryKey | QueryKey)[];
43
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
44
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
45
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
46
+ data: import('vue').ShallowRef<void | undefined>;
47
+ error: import('vue').ShallowRef<Error | null>;
48
+ isLoading: import('vue').ComputedRef<boolean>;
49
+ variables: import('vue').ShallowRef<{
50
+ items: Item["timestamp"][];
51
+ trx?: Kysely<DB>;
52
+ } | undefined>;
53
+ mutate: (vars: {
54
+ items: Item["timestamp"][];
55
+ trx?: Kysely<DB>;
56
+ }) => void;
57
+ reset: () => void;
58
+ };
59
+ export declare const useQuery: <T>(query: (db: SelectQueryBuilder<DB, "recentView", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import('@pinia/colada').UseQueryReturn<T, Error, T>;
@@ -1,5 +1,7 @@
1
- import { JSONColumnType, Selectable } from 'kysely';
2
1
  import { SourcedValue, SourcedKeyType, uni } from '@delta-comic/model';
2
+ import { JSONColumnType, Kysely, Selectable, SelectQueryBuilder } from 'kysely';
3
+ import { CommonQueryKey } from './utils';
4
+ import { DB } from '.';
3
5
  export declare const key: SourcedValue<[plugin: string, label: string]>;
4
6
  export type Key_ = SourcedKeyType<typeof key>;
5
7
  export type Key = Exclude<Key_, string>;
@@ -7,6 +9,7 @@ export interface AuthorTable {
7
9
  author: JSONColumnType<uni.item.Author>;
8
10
  itemKey: null;
9
11
  type: 'author';
12
+ /** @description primary key */
10
13
  key: string;
11
14
  plugin: string;
12
15
  }
@@ -15,11 +18,58 @@ export interface EpTable {
15
18
  author: null;
16
19
  itemKey: string;
17
20
  type: 'ep';
21
+ /** @description primary key */
18
22
  key: string;
19
23
  plugin: string;
20
24
  }
21
25
  export type EpItem = Selectable<EpTable>;
22
26
  export type Table = AuthorTable | EpTable;
23
27
  export type Item = AuthorItem | EpItem;
24
- export declare function getAll(): Promise<Item[]>;
25
- export declare function upsert(item: Item): Promise<import('kysely').InsertResult[]>;
28
+ export declare enum QueryKey {
29
+ item = "db:subscribe:"
30
+ }
31
+ export declare const useUpsert: () => {
32
+ upsert: (vars: {
33
+ items: Item[];
34
+ trx?: Kysely<DB>;
35
+ }) => Promise<void>;
36
+ key: (CommonQueryKey | QueryKey)[];
37
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
38
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
39
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
40
+ data: import('vue').ShallowRef<void | undefined>;
41
+ error: import('vue').ShallowRef<Error | null>;
42
+ isLoading: import('vue').ComputedRef<boolean>;
43
+ variables: import('vue').ShallowRef<{
44
+ items: Item[];
45
+ trx?: Kysely<DB>;
46
+ } | undefined>;
47
+ mutate: (vars: {
48
+ items: Item[];
49
+ trx?: Kysely<DB>;
50
+ }) => void;
51
+ reset: () => void;
52
+ };
53
+ export declare const useRemove: () => {
54
+ remove: (vars: {
55
+ keys: Item["key"][];
56
+ trx?: Kysely<DB>;
57
+ }) => Promise<void>;
58
+ key: (CommonQueryKey | QueryKey)[];
59
+ state: import('vue').ComputedRef<import('@pinia/colada').DataState<void, Error, undefined>>;
60
+ status: import('vue').ShallowRef<import('@pinia/colada').DataStateStatus>;
61
+ asyncStatus: import('vue').ShallowRef<import('@pinia/colada').AsyncStatus>;
62
+ data: import('vue').ShallowRef<void | undefined>;
63
+ error: import('vue').ShallowRef<Error | null>;
64
+ isLoading: import('vue').ComputedRef<boolean>;
65
+ variables: import('vue').ShallowRef<{
66
+ keys: Item["key"][];
67
+ trx?: Kysely<DB>;
68
+ } | undefined>;
69
+ mutate: (vars: {
70
+ keys: Item["key"][];
71
+ trx?: Kysely<DB>;
72
+ }) => void;
73
+ reset: () => void;
74
+ };
75
+ export declare const useQuery: <T>(query: (db: SelectQueryBuilder<DB, "subscribe", {}>) => Promise<T>, otherKeys?: any[], initialData?: () => T) => import('@pinia/colada').UseQueryReturn<T, Error, T>;
@@ -0,0 +1,7 @@
1
+ import { Kysely, SelectQueryBuilder } from 'kysely';
2
+ import { DB } from '.';
3
+ export declare const withTransition: <T>(handler: (trx: Kysely<DB>) => Promise<T>, trx?: Kysely<DB>) => Promise<T>;
4
+ export declare function countDb(sql: SelectQueryBuilder<DB, any, object>): Promise<number>;
5
+ export declare enum CommonQueryKey {
6
+ common = "db"
7
+ }
package/dist/pack.tgz CHANGED
Binary file
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@delta-comic/db",
3
- "version": "0.0.8",
3
+ "version": "1.3.1",
4
4
  "description": "空阙虱楼",
5
- "homepage": "https://github.com/delta-comic/delta-comic-core",
5
+ "homepage": "https://github.com/delta-comic/delta-comic",
6
6
  "license": "AGPL-3.0-only",
7
7
  "author": {
8
8
  "name": "wenxig",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "https://github.com/delta-comic/delta-comic-core.git"
13
+ "url": "https://github.com/delta-comic/delta-comic.git"
14
14
  },
15
15
  "files": [
16
16
  "dist"
@@ -29,6 +29,7 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
+ "@pinia/colada": "^1.0.0",
32
33
  "@tauri-apps/plugin-sql": "^2.3.2",
33
34
  "@tauri-apps/plugin-store": "^2.4.2",
34
35
  "@vueuse/core": "^14.2.1",
@@ -36,12 +37,15 @@
36
37
  "kysely-plugin-serialize": "^0.8.2",
37
38
  "mitt": "^3.0.1"
38
39
  },
40
+ "devDependencies": {
41
+ "vite": "npm:@voidzero-dev/vite-plus-core@latest",
42
+ "vite-plus": "latest"
43
+ },
39
44
  "peerDependencies": {
40
45
  "kysely": "^0.28",
41
46
  "vue": "^3.5",
42
- "@delta-comic/model": "0.0.5",
43
- "@delta-comic/utils": "0.0.7",
44
- "@delta-comic/plugin": "0.3.5"
47
+ "@delta-comic/model": "1.3.1",
48
+ "@delta-comic/utils": "1.3.1"
45
49
  },
46
50
  "release": {
47
51
  "tagFormat": "db-${version}"
@@ -50,13 +54,7 @@
50
54
  "tarball": "./dist/pack.tgz"
51
55
  },
52
56
  "readme": "./README.md",
53
- "devDependencies": {
54
- "vite": "8.0.0-beta.16"
55
- },
56
57
  "scripts": {
57
- "build": "vite build && pnpm pack --out ./dist/pack.tgz",
58
- "version:major": "pnpm version major --no-git-tag-version || true",
59
- "version:minor": "pnpm version minor --no-git-tag-version || true",
60
- "version:patch": "pnpm version patch --no-git-tag-version || true"
58
+ "build": "vp build && pnpm pack --out ./dist/pack.tgz"
61
59
  }
62
60
  }
@@ -1,2 +0,0 @@
1
- import { cn as e } from "./esm-YHRn16YB.js";
2
- export { e as createQueryId };