orgnote-api 0.20.2 → 0.40.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/api.d.ts +93 -98
- package/constants/{command-groups.contant.d.ts → command-groups.d.ts} +2 -1
- package/constants/{command-groups.contant.js → command-groups.js} +2 -0
- package/constants/extension-errors.d.ts +9 -0
- package/constants/extension-errors.js +18 -0
- package/constants/file-guard-errors.d.ts +8 -0
- package/constants/file-guard-errors.js +18 -0
- package/constants/git-errors.d.ts +9 -0
- package/constants/git-errors.js +18 -0
- package/constants/i18n-keys.d.ts +371 -0
- package/constants/i18n-keys.js +158 -0
- package/constants/index.d.ts +9 -1
- package/constants/index.js +9 -1
- package/constants/oauth-providers.d.ts +1 -0
- package/constants/oauth-providers.js +1 -0
- package/constants/route-names.d.ts +36 -0
- package/constants/route-names.js +37 -0
- package/constants/route-paths.d.ts +5 -0
- package/constants/route-paths.js +4 -0
- package/constants/style-sizes.d.ts +1 -0
- package/constants/style-sizes.js +1 -0
- package/encryption/__tests__/encryption.spec.js +4 -5
- package/encryption/__tests__/note-encryption.spec.js +46 -348
- package/encryption/encryption.d.ts +9 -4
- package/encryption/encryption.js +25 -5
- package/encryption/note-encryption.d.ts +1 -1
- package/encryption/note-encryption.js +6 -6
- package/files-api.d.ts +0 -1
- package/index.d.ts +4 -1
- package/index.js +4 -1
- package/mappers/orgnode-to-note.d.ts +2 -2
- package/mappers/orgnode-to-note.js +3 -2
- package/models/auth-store.d.ts +3 -3
- package/models/buffer-store.d.ts +14 -0
- package/models/buffer.d.ts +24 -0
- package/models/colors.d.ts +1 -0
- package/models/command.d.ts +13 -8
- package/models/commands-group-store.d.ts +11 -0
- package/models/commands-store.d.ts +13 -0
- package/models/completion-store.d.ts +14 -0
- package/models/completion.d.ts +16 -7
- package/models/config-store.d.ts +9 -0
- package/models/confirmation-modal.d.ts +11 -0
- package/models/context-menu-store.d.ts +10 -0
- package/models/cron-store.d.ts +21 -0
- package/models/cron-task.d.ts +30 -0
- package/models/css-utils.d.ts +17 -0
- package/models/default-commands.d.ts +52 -3
- package/models/default-commands.js +59 -2
- package/models/encryption-store.d.ts +10 -0
- package/models/encryption-store.js +1 -0
- package/models/encryption.d.ts +54 -11
- package/models/encryption.js +28 -1
- package/models/extension-registry-store.d.ts +9 -0
- package/models/extension-registry-store.js +1 -0
- package/models/extension-store.d.ts +18 -0
- package/models/extension-store.js +1 -0
- package/models/extension.d.ts +96 -24
- package/models/extension.js +88 -1
- package/models/file-guard-store.d.ts +14 -0
- package/models/file-guard-store.js +1 -0
- package/models/file-guard.d.ts +27 -0
- package/models/file-guard.js +1 -0
- package/models/{file-cache.d.ts → file-info.d.ts} +1 -1
- package/models/file-info.js +1 -0
- package/models/file-manager-store.d.ts +10 -12
- package/models/file-opener-store.d.ts +6 -4
- package/models/file-system-manager-store.d.ts +13 -0
- package/models/file-system-manager-store.js +1 -0
- package/models/file-system-store.d.ts +19 -0
- package/models/file-system-store.js +1 -0
- package/models/file-system.d.ts +32 -5
- package/models/file-system.js +2 -0
- package/models/file-upload.d.ts +6 -0
- package/models/file-upload.js +1 -0
- package/models/file-watcher-store.d.ts +18 -0
- package/models/file-watcher-store.js +1 -0
- package/models/files-store.d.ts +2 -2
- package/models/git-store.d.ts +12 -0
- package/models/git-store.js +1 -0
- package/models/git.d.ts +47 -0
- package/models/git.js +1 -0
- package/models/i18n-keys.d.ts +2 -0
- package/models/i18n-keys.js +1 -0
- package/models/index.d.ts +56 -2
- package/models/index.js +59 -2
- package/models/layout-snapshot-repository.d.ts +14 -0
- package/models/layout-snapshot-repository.js +1 -0
- package/models/layout-store.d.ts +17 -0
- package/models/layout-store.js +1 -0
- package/models/layout.d.ts +16 -0
- package/models/layout.js +1 -0
- package/models/log-repository.d.ts +17 -0
- package/models/log-repository.js +1 -0
- package/models/log-store.d.ts +15 -0
- package/models/log-store.js +1 -0
- package/models/log.d.ts +12 -0
- package/models/log.js +1 -0
- package/models/logger.d.ts +8 -0
- package/models/logger.js +1 -0
- package/models/menu-action.d.ts +18 -0
- package/models/menu-action.js +1 -0
- package/models/modal-store.d.ts +16 -0
- package/models/modal-store.js +1 -0
- package/models/modal.d.ts +10 -2
- package/models/note.d.ts +30 -13
- package/models/notification-config.d.ts +14 -0
- package/models/notification-config.js +1 -0
- package/models/notifications-store.d.ts +20 -0
- package/models/notifications-store.js +1 -0
- package/models/oauth-provider.d.ts +2 -1
- package/models/orgnote-config.d.ts +80 -0
- package/models/orgnote-config.js +42 -0
- package/models/orgnote-url.d.ts +6 -0
- package/models/orgnote-url.js +1 -0
- package/models/pane-snapshot-repository.d.ts +0 -0
- package/models/pane-snapshot-repository.js +0 -0
- package/models/pane.d.ts +38 -0
- package/models/pane.js +1 -0
- package/models/panes-store.d.ts +30 -0
- package/models/panes-store.js +1 -0
- package/models/platform-detection.d.ts +11 -0
- package/models/platform-detection.js +1 -0
- package/models/platform-specific.d.ts +1 -0
- package/models/platform-specific.js +1 -0
- package/models/platform.d.ts +2 -0
- package/models/platform.js +1 -0
- package/models/queue-store.d.ts +49 -0
- package/models/queue-store.js +1 -0
- package/models/queue-task.d.ts +15 -0
- package/models/queue-task.js +1 -0
- package/models/repositories.d.ts +58 -38
- package/models/screen-detection.d.ts +10 -0
- package/models/screen-detection.js +1 -0
- package/models/settings-store.d.ts +12 -0
- package/models/settings-store.js +1 -0
- package/models/settings-ui-store.d.ts +7 -0
- package/models/settings-ui-store.js +1 -0
- package/models/sidebar-store.d.ts +22 -0
- package/models/sidebar-store.js +1 -0
- package/models/splash-screen.d.ts +13 -0
- package/models/splash-screen.js +1 -0
- package/models/store.d.ts +1 -1
- package/models/style-size.d.ts +2 -0
- package/models/style-size.js +1 -0
- package/models/style-variant.d.ts +1 -0
- package/models/style-variant.js +1 -0
- package/models/sync-store.d.ts +8 -6
- package/models/sync.d.ts +0 -5
- package/models/system-info.d.ts +47 -0
- package/models/system-info.js +1 -0
- package/models/theme-store.d.ts +16 -0
- package/models/theme-store.js +1 -0
- package/models/theme-variables.d.ts +4 -189
- package/models/theme-variables.js +2 -191
- package/models/toolbar-store.d.ts +9 -0
- package/models/toolbar-store.js +1 -0
- package/models/ui-store.d.ts +6 -0
- package/models/ui-store.js +1 -0
- package/models/user.d.ts +3 -4
- package/models/vue-component.d.ts +4 -2
- package/package-lock.json +5553 -0
- package/package.json +37 -26
- package/remote-api/api.d.ts +288 -669
- package/remote-api/api.js +199 -485
- package/remote-api/base.js +1 -1
- package/remote-api/common.d.ts +1 -1
- package/sync/__tests__/memory-state.spec.d.ts +1 -0
- package/sync/__tests__/memory-state.spec.js +49 -0
- package/sync/__tests__/plan.spec.d.ts +1 -0
- package/sync/__tests__/plan.spec.js +116 -0
- package/sync/create-sync-plan.d.ts +2 -0
- package/sync/create-sync-plan.js +13 -0
- package/sync/fetch.d.ts +8 -0
- package/sync/fetch.js +32 -0
- package/sync/index.d.ts +10 -0
- package/sync/index.js +9 -0
- package/sync/memory-state.d.ts +2 -0
- package/sync/memory-state.js +22 -0
- package/sync/operations/conflict.d.ts +10 -0
- package/sync/operations/conflict.js +56 -0
- package/sync/operations/delete-local.d.ts +2 -0
- package/sync/operations/delete-local.js +17 -0
- package/sync/operations/delete-remote.d.ts +2 -0
- package/sync/operations/delete-remote.js +26 -0
- package/sync/operations/download.d.ts +2 -0
- package/sync/operations/download.js +20 -0
- package/sync/operations/index.d.ts +5 -0
- package/sync/operations/index.js +5 -0
- package/sync/operations/synced-file.d.ts +14 -0
- package/sync/operations/synced-file.js +5 -0
- package/sync/operations/upload.d.ts +2 -0
- package/sync/operations/upload.js +30 -0
- package/sync/plan.d.ts +9 -0
- package/sync/plan.js +57 -0
- package/sync/recovery.d.ts +2 -0
- package/sync/recovery.js +6 -0
- package/sync/scan.d.ts +4 -0
- package/sync/scan.js +40 -0
- package/sync/types.d.ts +74 -0
- package/sync/types.js +7 -0
- package/sync/utils/__tests__/oldest-synced-at.spec.d.ts +1 -0
- package/sync/utils/__tests__/oldest-synced-at.spec.js +38 -0
- package/sync/utils/oldest-synced-at.d.ts +2 -0
- package/sync/utils/oldest-synced-at.js +9 -0
- package/types/index.d.ts +0 -0
- package/types/index.js +0 -0
- package/utils/__tests__/find-files-diff.spec.d.ts +1 -0
- package/{tools → utils}/__tests__/find-files-diff.spec.js +3 -3
- package/utils/__tests__/find-note-files-diff.spec.d.ts +1 -0
- package/{tools → utils}/__tests__/find-note-files-diff.spec.js +5 -5
- package/utils/__tests__/get-file-name.spec.d.ts +1 -0
- package/utils/__tests__/get-string-path.spec.d.ts +1 -0
- package/utils/__tests__/is-gpg-encrypted.spec.d.ts +1 -0
- package/utils/__tests__/is-org-file.spec.d.ts +1 -0
- package/utils/__tests__/join.spec.d.ts +1 -0
- package/utils/__tests__/join.spec.js +32 -0
- package/utils/__tests__/nullable-guards.spec.d.ts +1 -0
- package/utils/__tests__/nullable-guards.spec.js +44 -0
- package/utils/__tests__/parent-folder.spec.d.ts +1 -0
- package/utils/__tests__/read-org-files-recursively.spec.d.ts +1 -0
- package/utils/__tests__/split-path.spec.d.ts +1 -0
- package/utils/__tests__/to-absolute-path.spec.d.ts +1 -0
- package/utils/__tests__/to-absolute-path.spec.js +26 -0
- package/utils/__tests__/to-error.spec.d.ts +1 -0
- package/utils/__tests__/to-error.spec.js +112 -0
- package/utils/__tests__/with-root.spec.d.ts +1 -0
- package/utils/__tests__/with-root.spec.js +20 -0
- package/{tools → utils}/find-notes-files-diff.js +6 -3
- package/{tools → utils}/index.d.ts +4 -1
- package/{tools → utils}/index.js +4 -1
- package/utils/join-path.d.ts +1 -0
- package/utils/join-path.js +13 -0
- package/utils/nullable-guards.d.ts +2 -0
- package/utils/nullable-guards.js +6 -0
- package/utils/to-absolute-path.d.ts +2 -0
- package/utils/to-absolute-path.js +2 -0
- package/utils/to-error.d.ts +6 -0
- package/utils/to-error.js +33 -0
- package/utils/toml.d.ts +3 -0
- package/utils/toml.js +31 -0
- package/utils/with-root.d.ts +1 -0
- package/utils/with-root.js +6 -0
- package/websocket/client.d.ts +24 -0
- package/websocket/client.js +83 -0
- package/models/file-tree.d.ts +0 -12
- package/tools/__tests__/join.spec.js +0 -24
- package/tools/join-path.d.ts +0 -1
- package/tools/join-path.js +0 -7
- package/tools/mock-server.d.ts +0 -1
- package/tools/mock-server.js +0 -12
- /package/models/{file-cache.js → buffer-store.js} +0 -0
- /package/models/{file-tree.js → buffer.js} +0 -0
- /package/{tools/__tests__/find-files-diff.spec.d.ts → models/colors.js} +0 -0
- /package/{tools/__tests__/find-note-files-diff.spec.d.ts → models/commands-group-store.js} +0 -0
- /package/{tools/__tests__/get-file-name.spec.d.ts → models/commands-store.js} +0 -0
- /package/{tools/__tests__/get-string-path.spec.d.ts → models/completion-store.js} +0 -0
- /package/{tools/__tests__/is-gpg-encrypted.spec.d.ts → models/config-store.js} +0 -0
- /package/{tools/__tests__/is-org-file.spec.d.ts → models/confirmation-modal.js} +0 -0
- /package/{tools/__tests__/join.spec.d.ts → models/context-menu-store.js} +0 -0
- /package/{tools/__tests__/parent-folder.spec.d.ts → models/cron-store.js} +0 -0
- /package/{tools/__tests__/read-org-files-recursively.spec.d.ts → models/cron-task.js} +0 -0
- /package/{tools/__tests__/split-path.spec.d.ts → models/css-utils.js} +0 -0
- /package/{tools → utils}/__tests__/get-file-name.spec.js +0 -0
- /package/{tools → utils}/__tests__/get-string-path.spec.js +0 -0
- /package/{tools → utils}/__tests__/is-gpg-encrypted.spec.js +0 -0
- /package/{tools → utils}/__tests__/is-org-file.spec.js +0 -0
- /package/{tools → utils}/__tests__/parent-folder.spec.js +0 -0
- /package/{tools → utils}/__tests__/read-org-files-recursively.spec.js +0 -0
- /package/{tools → utils}/__tests__/split-path.spec.js +0 -0
- /package/{tools → utils}/find-notes-files-diff.d.ts +0 -0
- /package/{tools → utils}/get-file-name.d.ts +0 -0
- /package/{tools → utils}/get-file-name.js +0 -0
- /package/{tools → utils}/get-parent-dir.d.ts +0 -0
- /package/{tools → utils}/get-parent-dir.js +0 -0
- /package/{tools → utils}/get-string-path.d.ts +0 -0
- /package/{tools → utils}/get-string-path.js +0 -0
- /package/{tools → utils}/is-gpg-encrypted.d.ts +0 -0
- /package/{tools → utils}/is-gpg-encrypted.js +0 -0
- /package/{tools → utils}/is-org-file.d.ts +0 -0
- /package/{tools → utils}/is-org-file.js +0 -0
- /package/{tools → utils}/split-path.d.ts +0 -0
- /package/{tools → utils}/split-path.js +0 -0
package/models/index.js
CHANGED
|
@@ -11,16 +11,73 @@ export * from "./default-commands.js";
|
|
|
11
11
|
export * from "./encryption.js";
|
|
12
12
|
export * from "./file-system.js";
|
|
13
13
|
export * from "./sync.js";
|
|
14
|
-
export * from "./file-
|
|
14
|
+
export * from "./file-info.js";
|
|
15
15
|
export * from "./file-path.js";
|
|
16
|
-
export * from "./file-tree.js";
|
|
17
16
|
export * from "./user.js";
|
|
18
17
|
export * from "./oauth-provider.js";
|
|
18
|
+
export * from "./orgnote-config.js";
|
|
19
|
+
export * from "./platform-specific.js";
|
|
20
|
+
export * from "./css-utils.js";
|
|
21
|
+
export * from "./i18n-keys.js";
|
|
22
|
+
export * from "./vue-component.js";
|
|
23
|
+
export * from "./file-upload.js";
|
|
24
|
+
export * from "./confirmation-modal.js";
|
|
25
|
+
export * from "./pane.js";
|
|
26
|
+
export * from "./buffer.js";
|
|
27
|
+
export * from "./log.js";
|
|
28
|
+
export * from "./logger.js";
|
|
29
|
+
export * from "./layout.js";
|
|
30
|
+
export * from "./menu-action.js";
|
|
31
|
+
export * from "./queue-task.js";
|
|
32
|
+
export * from "./cron-task.js";
|
|
33
|
+
export * from "./platform.js";
|
|
34
|
+
export * from "./platform-detection.js";
|
|
35
|
+
export * from "./git.js";
|
|
36
|
+
export * from "./file-guard.js";
|
|
37
|
+
export * from "./file-guard-store.js";
|
|
38
|
+
// Composables
|
|
39
|
+
export * from "./splash-screen.js";
|
|
40
|
+
export * from "./screen-detection.js";
|
|
41
|
+
export * from "./system-info.js";
|
|
19
42
|
// Stores
|
|
20
43
|
export * from "./sync-store.js";
|
|
21
44
|
export * from "./files-store.js";
|
|
22
45
|
export * from "./file-opener-store.js";
|
|
23
46
|
export * from "./file-manager-store.js";
|
|
24
47
|
export * from "./auth-store.js";
|
|
48
|
+
export * from "./commands-store.js";
|
|
49
|
+
export * from "./commands-group-store.js";
|
|
50
|
+
export * from "./extension-store.js";
|
|
51
|
+
export * from "./file-system-store.js";
|
|
52
|
+
export * from "./file-watcher-store.js";
|
|
53
|
+
export * from "./settings-store.js";
|
|
54
|
+
export * from "./encryption-store.js";
|
|
55
|
+
export * from "./ui-store.js";
|
|
56
|
+
export * from "./sidebar-store.js";
|
|
57
|
+
export * from "./toolbar-store.js";
|
|
58
|
+
export * from "./modal-store.js";
|
|
59
|
+
export * from "./settings-ui-store.js";
|
|
60
|
+
export * from "./completion-store.js";
|
|
61
|
+
export * from "./panes-store.js";
|
|
62
|
+
export * from "./layout-store.js";
|
|
63
|
+
export * from "./file-system-manager-store.js";
|
|
64
|
+
export * from "./config-store.js";
|
|
65
|
+
export * from "./notifications-store.js";
|
|
66
|
+
export * from "./notification-config.js";
|
|
67
|
+
export * from "./buffer-store.js";
|
|
68
|
+
export * from "./log-store.js";
|
|
69
|
+
export * from "./context-menu-store.js";
|
|
70
|
+
export * from "./queue-store.js";
|
|
71
|
+
export * from "./cron-store.js";
|
|
72
|
+
export * from "./git-store.js";
|
|
73
|
+
export * from "./extension-registry-store.js";
|
|
74
|
+
export * from "./theme-store.js";
|
|
75
|
+
// UI
|
|
76
|
+
export * from "./style-variant.js";
|
|
77
|
+
export * from "./style-size.js";
|
|
25
78
|
// Repositories
|
|
26
79
|
export * from "./repositories.js";
|
|
80
|
+
export * from "./log-repository.js";
|
|
81
|
+
export * from "./layout-snapshot-repository.js";
|
|
82
|
+
// URL
|
|
83
|
+
export * from "./orgnote-url.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LayoutSnapshot } from './pane.js';
|
|
2
|
+
export interface StoredLayoutSnapshot {
|
|
3
|
+
id: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
snapshot: LayoutSnapshot;
|
|
6
|
+
}
|
|
7
|
+
export interface LayoutSnapshotRepository {
|
|
8
|
+
save(snapshot: LayoutSnapshot, id?: string): Promise<void>;
|
|
9
|
+
get(id: string): Promise<StoredLayoutSnapshot | undefined>;
|
|
10
|
+
getLatest(): Promise<StoredLayoutSnapshot | undefined>;
|
|
11
|
+
list(limit?: number): Promise<StoredLayoutSnapshot[]>;
|
|
12
|
+
delete(id: string): Promise<void>;
|
|
13
|
+
clear(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { StoreDefinition } from './store.js';
|
|
3
|
+
import { LayoutNode, DropDirection as SplitDirection } from './layout.js';
|
|
4
|
+
import { LayoutSnapshot } from './pane.js';
|
|
5
|
+
export interface LayoutStore {
|
|
6
|
+
layout: ShallowRef<LayoutNode | undefined>;
|
|
7
|
+
initLayout: (layout?: LayoutNode) => Promise<void>;
|
|
8
|
+
splitPaneInLayout: (paneId: string, direction: SplitDirection, createInitialTab?: boolean) => Promise<string | undefined>;
|
|
9
|
+
removePaneFromLayout: (paneId: string) => void;
|
|
10
|
+
updateNodeSizes: (nodeId: string, sizes: number[]) => void;
|
|
11
|
+
normalizeSizes: (sizes: number[]) => number[];
|
|
12
|
+
saveLayout: () => Promise<void>;
|
|
13
|
+
restoreLayout: () => Promise<void>;
|
|
14
|
+
getLayoutSnapshot: () => LayoutSnapshot | undefined;
|
|
15
|
+
restoreLayoutSnapshot: (snapshot: LayoutSnapshot) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export type LayoutStoreDefinition = StoreDefinition<LayoutStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type LayoutOrientation = 'horizontal' | 'vertical';
|
|
2
|
+
export type DropZone = 'left' | 'right' | 'top' | 'bottom' | 'center';
|
|
3
|
+
export type DropDirection = 'left' | 'right' | 'top' | 'bottom';
|
|
4
|
+
export type LayoutNode = LayoutPaneNode | LayoutSplitNode;
|
|
5
|
+
export interface LayoutPaneNode {
|
|
6
|
+
type: 'pane';
|
|
7
|
+
id: string;
|
|
8
|
+
paneId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LayoutSplitNode {
|
|
11
|
+
type: 'split';
|
|
12
|
+
id: string;
|
|
13
|
+
orientation: LayoutOrientation;
|
|
14
|
+
children: LayoutNode[];
|
|
15
|
+
sizes?: number[];
|
|
16
|
+
}
|
package/models/layout.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LogLevel, LogRecord } from './log.js';
|
|
2
|
+
export interface LogFilter {
|
|
3
|
+
level?: LogLevel;
|
|
4
|
+
from?: Date;
|
|
5
|
+
to?: Date;
|
|
6
|
+
text?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface LoggerRepository {
|
|
11
|
+
add(record: LogRecord): Promise<void>;
|
|
12
|
+
bulkAdd(records: LogRecord[]): Promise<void>;
|
|
13
|
+
query(filter: LogFilter): Promise<LogRecord[]>;
|
|
14
|
+
count(filter?: Omit<LogFilter, 'limit' | 'offset'>): Promise<number>;
|
|
15
|
+
clear(): Promise<void>;
|
|
16
|
+
purgeOlderThan(date: Date): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import { StoreDefinition } from './store.js';
|
|
3
|
+
import { LogRecord, LogLevel } from './log.js';
|
|
4
|
+
export interface LogStore {
|
|
5
|
+
logs: Ref<LogRecord[]>;
|
|
6
|
+
addLog: (log: LogRecord) => void;
|
|
7
|
+
addLogs: (logs: LogRecord[]) => void;
|
|
8
|
+
getLogsByLevel: (level: LogLevel) => LogRecord[];
|
|
9
|
+
getLogsSince: (timestamp: Date) => LogRecord[];
|
|
10
|
+
getCountByLevel: (level: LogLevel) => number;
|
|
11
|
+
clearLogs: () => void;
|
|
12
|
+
clearLogsByLevel: (level: LogLevel) => void;
|
|
13
|
+
exportAsText: () => string;
|
|
14
|
+
}
|
|
15
|
+
export type LogStoreDefinition = StoreDefinition<LogStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/log.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type LogLevel = 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
2
|
+
export interface LogRecord {
|
|
3
|
+
id?: number;
|
|
4
|
+
ts: Date;
|
|
5
|
+
level: LogLevel;
|
|
6
|
+
message: string;
|
|
7
|
+
bindings?: Record<string, unknown>;
|
|
8
|
+
context?: Record<string, unknown>;
|
|
9
|
+
repeatCount?: number;
|
|
10
|
+
firstTs?: Date;
|
|
11
|
+
lastTs?: Date;
|
|
12
|
+
}
|
package/models/log.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface Logger {
|
|
2
|
+
info: (msg: string, ...args: unknown[]) => void;
|
|
3
|
+
error: (msg: string, ...args: unknown[]) => void;
|
|
4
|
+
warn: (msg: string, ...args: unknown[]) => void;
|
|
5
|
+
debug: (msg: string, ...args: unknown[]) => void;
|
|
6
|
+
trace: (msg: string, ...args: unknown[]) => void;
|
|
7
|
+
child: (bindings: Record<string, unknown>) => Logger;
|
|
8
|
+
}
|
package/models/logger.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CommandName } from './command.js';
|
|
2
|
+
type DefinedMenuGroup = 'file' | 'dir' | 'tab';
|
|
3
|
+
export type MenuGroup = DefinedMenuGroup | (string & {});
|
|
4
|
+
export interface MenuActionBase<T = unknown> {
|
|
5
|
+
icon?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ManualMenuAction<T = unknown> extends MenuActionBase<T> {
|
|
9
|
+
handler: (data: T) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface CommandMenuAction extends MenuActionBase {
|
|
12
|
+
command: CommandName;
|
|
13
|
+
}
|
|
14
|
+
export type MenuAction = ManualMenuAction | CommandMenuAction;
|
|
15
|
+
export interface MenuGroupParams {
|
|
16
|
+
items: MenuAction[];
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Ref, ShallowRef } from 'vue';
|
|
2
|
+
import { StoreDefinition } from './store.js';
|
|
3
|
+
import { VueComponent } from './vue-component.js';
|
|
4
|
+
import { Modal, ModalConfig } from './modal.js';
|
|
5
|
+
import { ComputedRef } from 'vue';
|
|
6
|
+
export interface ModalStore {
|
|
7
|
+
open: <TReturn = unknown>(cmp: VueComponent, config?: ModalConfig) => Promise<TReturn>;
|
|
8
|
+
title: Ref<string | undefined>;
|
|
9
|
+
close: <TReturn = unknown>(data?: TReturn) => void;
|
|
10
|
+
component: ComputedRef<VueComponent | undefined>;
|
|
11
|
+
config: ComputedRef<ModalConfig | undefined>;
|
|
12
|
+
closeAll: () => void;
|
|
13
|
+
modals: ShallowRef<Modal[]>;
|
|
14
|
+
updateConfig: (config: Partial<ModalConfig>) => void;
|
|
15
|
+
}
|
|
16
|
+
export type ModalStoreDefinition = StoreDefinition<ModalStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/modal.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { VueComponent } from './vue-component.js';
|
|
2
|
-
export interface ModalConfig<T =
|
|
2
|
+
export interface ModalConfig<T = any> {
|
|
3
3
|
closable?: boolean;
|
|
4
4
|
title?: string;
|
|
5
5
|
modalProps?: T;
|
|
6
|
+
modalEmits?: Record<string, (params: any) => any>;
|
|
7
|
+
position?: 'top' | 'center' | 'bottom';
|
|
8
|
+
fullScreen?: boolean;
|
|
9
|
+
noPadding?: boolean;
|
|
10
|
+
wide?: boolean;
|
|
11
|
+
mini?: boolean;
|
|
12
|
+
headerTitleComponent?: VueComponent;
|
|
6
13
|
}
|
|
7
|
-
export interface Modal {
|
|
14
|
+
export interface Modal<TReturn = any> {
|
|
8
15
|
config?: ModalConfig;
|
|
16
|
+
closed?: Promise<TReturn>;
|
|
9
17
|
component: VueComponent;
|
|
10
18
|
}
|
package/models/note.d.ts
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EncryptionType } from './encryption.js';
|
|
2
2
|
export interface NotesFilter {
|
|
3
3
|
searchText?: string;
|
|
4
4
|
userId?: string;
|
|
5
5
|
limit?: number;
|
|
6
6
|
offset?: number;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
9
|
-
id
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
export interface NoteMeta {
|
|
9
|
+
id?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
fileTags?: string[];
|
|
13
|
+
previewImg?: string;
|
|
14
|
+
published?: boolean;
|
|
15
|
+
startup?: string;
|
|
16
|
+
images?: string[];
|
|
17
|
+
connectedNotes?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
export interface PublicUser {
|
|
20
|
+
id?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
nickName?: string;
|
|
23
|
+
avatarUrl?: string;
|
|
24
|
+
email?: string;
|
|
25
|
+
profileUrl?: string;
|
|
18
26
|
}
|
|
19
|
-
export interface
|
|
20
|
-
|
|
27
|
+
export interface NoteInfo {
|
|
28
|
+
id?: string;
|
|
29
|
+
meta: NoteMeta;
|
|
30
|
+
createdAt?: string;
|
|
31
|
+
encryptionType?: EncryptionType;
|
|
32
|
+
updatedAt?: string;
|
|
33
|
+
touchedAt?: string;
|
|
34
|
+
deletedAt?: string;
|
|
35
|
+
filePath?: string[];
|
|
36
|
+
isMy?: boolean;
|
|
37
|
+
author?: PublicUser;
|
|
21
38
|
bookmarked?: boolean;
|
|
22
39
|
encrypted?: boolean;
|
|
23
40
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StyleVariant } from './style-variant.js';
|
|
2
|
+
export interface NotificationConfig {
|
|
3
|
+
id?: string;
|
|
4
|
+
message: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
group?: boolean;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
level?: StyleVariant;
|
|
9
|
+
caption?: string;
|
|
10
|
+
closable?: boolean;
|
|
11
|
+
icon?: string;
|
|
12
|
+
iconEnabled?: boolean;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Notify } from 'quasar';
|
|
2
|
+
import { NotificationConfig } from './notification-config.js';
|
|
3
|
+
import { StoreDefinition } from './store.js';
|
|
4
|
+
import { Ref } from 'vue';
|
|
5
|
+
export interface Notification {
|
|
6
|
+
read?: boolean;
|
|
7
|
+
config: NotificationConfig;
|
|
8
|
+
dismiss?: ReturnType<typeof Notify.create>;
|
|
9
|
+
icon?: string;
|
|
10
|
+
iconEnabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface NotificationsStore {
|
|
13
|
+
notify: (config: NotificationConfig) => void;
|
|
14
|
+
clear: () => void;
|
|
15
|
+
hideAll: () => void;
|
|
16
|
+
delete: (notificationId: string) => void;
|
|
17
|
+
markAsRead: (notificationId: string) => void;
|
|
18
|
+
notifications: Ref<Notification[]>;
|
|
19
|
+
}
|
|
20
|
+
export type NotificationsStoreDefinition = StoreDefinition<NotificationsStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { OAUTH_PROVIDERS } from "../constants/index.js";
|
|
2
|
+
export type OAuthProvider = (typeof OAUTH_PROVIDERS)[number];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { InferOutput } from 'valibot';
|
|
2
|
+
export declare const ORG_NOTE_CONFIG_SCHEMA: import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectWithRestSchema<{
|
|
3
|
+
readonly editor: import("valibot").ObjectSchema<{
|
|
4
|
+
readonly showSpecialSymbols: import("valibot").BooleanSchema<undefined>;
|
|
5
|
+
readonly showPropertyDrawer: import("valibot").BooleanSchema<undefined>;
|
|
6
|
+
readonly saveDelayMs: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
7
|
+
readonly validationDelayMs: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
8
|
+
}, undefined>;
|
|
9
|
+
readonly developer: import("valibot").ObjectSchema<{
|
|
10
|
+
readonly developerMode: import("valibot").BooleanSchema<undefined>;
|
|
11
|
+
readonly maximumLogsCount: import("valibot").NumberSchema<undefined>;
|
|
12
|
+
readonly storeQueueTasksMinutes: import("valibot").NumberSchema<undefined>;
|
|
13
|
+
readonly corsProxy: import("valibot").StringSchema<undefined>;
|
|
14
|
+
}, undefined>;
|
|
15
|
+
readonly completion: import("valibot").ObjectSchema<{
|
|
16
|
+
readonly showGroup: import("valibot").BooleanSchema<undefined>;
|
|
17
|
+
readonly defaultCompletionLimit: import("valibot").NumberSchema<undefined>;
|
|
18
|
+
readonly fuseThreshold: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
19
|
+
}, undefined>;
|
|
20
|
+
readonly system: import("valibot").ObjectSchema<{
|
|
21
|
+
readonly language: import("valibot").StringSchema<undefined>;
|
|
22
|
+
}, undefined>;
|
|
23
|
+
readonly synchronization: import("valibot").ObjectSchema<{
|
|
24
|
+
readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"none", undefined>, import("valibot").LiteralSchema<"api", undefined>], undefined>;
|
|
25
|
+
}, undefined>;
|
|
26
|
+
readonly ui: import("valibot").ObjectSchema<{
|
|
27
|
+
readonly showUserProfiles: import("valibot").BooleanSchema<undefined>;
|
|
28
|
+
readonly theme: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"light", undefined>, import("valibot").LiteralSchema<"dark", undefined>, import("valibot").LiteralSchema<"auto", undefined>], undefined>;
|
|
29
|
+
readonly darkThemeName: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").StringSchema<undefined>, import("valibot").LiteralSchema<any, undefined>], undefined>, undefined>;
|
|
30
|
+
readonly lightThemeName: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").StringSchema<undefined>, import("valibot").LiteralSchema<any, undefined>], undefined>, undefined>;
|
|
31
|
+
readonly enableAnimations: import("valibot").BooleanSchema<undefined>;
|
|
32
|
+
readonly notificationTimeout: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
33
|
+
readonly persistantPanes: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
34
|
+
readonly persistantPanesSaveDelay: import("valibot").NumberSchema<undefined>;
|
|
35
|
+
readonly dropZoneEdgeRatio: import("valibot").NumberSchema<undefined>;
|
|
36
|
+
}, undefined>;
|
|
37
|
+
readonly extensions: import("valibot").ObjectSchema<{
|
|
38
|
+
readonly sources: import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
39
|
+
}, undefined>;
|
|
40
|
+
readonly encryption: import("valibot").IntersectSchema<[import("valibot").ObjectSchema<{
|
|
41
|
+
readonly encryptFilesByDefault: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
|
|
42
|
+
}, undefined>, import("valibot").SchemaWithPipe<readonly [import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
|
|
43
|
+
readonly type: import("valibot").LiteralSchema<"gpgKeys", undefined>;
|
|
44
|
+
readonly privateKey: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MetadataAction<string, {
|
|
45
|
+
readonly textarea: true;
|
|
46
|
+
readonly upload: true;
|
|
47
|
+
}>]>;
|
|
48
|
+
readonly publicKey: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>, import("valibot").MetadataAction<string, {
|
|
49
|
+
readonly textarea: true;
|
|
50
|
+
readonly upload: true;
|
|
51
|
+
}>]>;
|
|
52
|
+
readonly privateKeyPassphrase: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
53
|
+
}, undefined>, import("valibot").ObjectSchema<{
|
|
54
|
+
readonly type: import("valibot").LiteralSchema<"gpgPassword", undefined>;
|
|
55
|
+
readonly password: import("valibot").StringSchema<undefined>;
|
|
56
|
+
}, undefined>, import("valibot").ObjectSchema<{
|
|
57
|
+
readonly type: import("valibot").LiteralSchema<"disabled", undefined>;
|
|
58
|
+
}, undefined>], undefined>, import("valibot").MetadataAction<{
|
|
59
|
+
type: "gpgKeys";
|
|
60
|
+
privateKey: string;
|
|
61
|
+
publicKey?: string;
|
|
62
|
+
privateKeyPassphrase?: string;
|
|
63
|
+
} | {
|
|
64
|
+
type: "gpgPassword";
|
|
65
|
+
password: string;
|
|
66
|
+
} | {
|
|
67
|
+
type: "disabled";
|
|
68
|
+
}, {
|
|
69
|
+
readonly conditionalKey: "type";
|
|
70
|
+
}>]>], undefined>;
|
|
71
|
+
}, import("valibot").UnknownSchema, undefined>]>;
|
|
72
|
+
export interface DefinedOrgNoteSettings {
|
|
73
|
+
vault?: string;
|
|
74
|
+
}
|
|
75
|
+
export type OrgNoteSettings = DefinedOrgNoteSettings & {
|
|
76
|
+
[key: string]: unknown;
|
|
77
|
+
};
|
|
78
|
+
export type OrgNoteConfig = InferOutput<typeof ORG_NOTE_CONFIG_SCHEMA> & {
|
|
79
|
+
[key: string]: any;
|
|
80
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { object, boolean, number, string, union, optional, array, literal, pipe, unknown, objectWithRest, } from 'valibot';
|
|
2
|
+
import { OrgNoteEncryptionSchema } from "./encryption.js";
|
|
3
|
+
export const ORG_NOTE_CONFIG_SCHEMA = pipe(objectWithRest({
|
|
4
|
+
editor: object({
|
|
5
|
+
showSpecialSymbols: boolean(),
|
|
6
|
+
showPropertyDrawer: boolean(),
|
|
7
|
+
saveDelayMs: optional(number()),
|
|
8
|
+
validationDelayMs: optional(number()),
|
|
9
|
+
}),
|
|
10
|
+
developer: object({
|
|
11
|
+
developerMode: boolean(),
|
|
12
|
+
maximumLogsCount: number(),
|
|
13
|
+
storeQueueTasksMinutes: number(),
|
|
14
|
+
corsProxy: string(),
|
|
15
|
+
}),
|
|
16
|
+
completion: object({
|
|
17
|
+
showGroup: boolean(),
|
|
18
|
+
defaultCompletionLimit: number(),
|
|
19
|
+
fuseThreshold: optional(number()),
|
|
20
|
+
}),
|
|
21
|
+
system: object({
|
|
22
|
+
language: string(),
|
|
23
|
+
}),
|
|
24
|
+
synchronization: object({
|
|
25
|
+
type: union([literal('none'), literal('api')]),
|
|
26
|
+
}),
|
|
27
|
+
ui: object({
|
|
28
|
+
showUserProfiles: boolean(),
|
|
29
|
+
theme: union([literal('light'), literal('dark'), literal('auto')]),
|
|
30
|
+
darkThemeName: optional(union([string(), literal(null)])),
|
|
31
|
+
lightThemeName: optional(union([string(), literal(null)])),
|
|
32
|
+
enableAnimations: boolean(),
|
|
33
|
+
notificationTimeout: optional(number()),
|
|
34
|
+
persistantPanes: optional(boolean()),
|
|
35
|
+
persistantPanesSaveDelay: number(),
|
|
36
|
+
dropZoneEdgeRatio: number(),
|
|
37
|
+
}),
|
|
38
|
+
extensions: object({
|
|
39
|
+
sources: array(string()),
|
|
40
|
+
}),
|
|
41
|
+
encryption: OrgNoteEncryptionSchema,
|
|
42
|
+
}, unknown()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
File without changes
|
package/models/pane.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import type { Router } from 'vue-router';
|
|
3
|
+
import type { LayoutNode } from './layout.js';
|
|
4
|
+
export interface Pane {
|
|
5
|
+
id: string;
|
|
6
|
+
activeTabId: string;
|
|
7
|
+
tabs: ShallowRef<Record<string, Tab>>;
|
|
8
|
+
}
|
|
9
|
+
export interface Tab {
|
|
10
|
+
title: string;
|
|
11
|
+
id: string;
|
|
12
|
+
paneId: string;
|
|
13
|
+
router: Router;
|
|
14
|
+
}
|
|
15
|
+
export type InitialTabParams = Partial<Pick<Tab, 'title' | 'id' | 'paneId'>>;
|
|
16
|
+
export interface TabSnapshot {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
paneId: string;
|
|
20
|
+
routeLocation: {
|
|
21
|
+
path: string;
|
|
22
|
+
params: Record<string, string>;
|
|
23
|
+
query: Record<string, string>;
|
|
24
|
+
hash: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface PaneSnapshot {
|
|
29
|
+
id: string;
|
|
30
|
+
activeTabId: string;
|
|
31
|
+
tabs: TabSnapshot[];
|
|
32
|
+
}
|
|
33
|
+
export interface LayoutSnapshot {
|
|
34
|
+
panes: PaneSnapshot[];
|
|
35
|
+
activePaneId: string;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
layout: LayoutNode;
|
|
38
|
+
}
|
package/models/pane.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Ref, ShallowRef, ComputedRef } from 'vue';
|
|
2
|
+
import { StoreDefinition } from './store.js';
|
|
3
|
+
import { InitialTabParams, Tab, Pane, PaneSnapshot } from './pane.js';
|
|
4
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
5
|
+
export interface PaneStore {
|
|
6
|
+
panes: Ref<Record<string, ShallowRef<Pane>>>;
|
|
7
|
+
activePaneId: Ref<string | undefined>;
|
|
8
|
+
activePane: ComputedRef<Pane | undefined>;
|
|
9
|
+
activeTab: ComputedRef<Tab | undefined>;
|
|
10
|
+
createPane: (params?: Partial<Pane>) => Promise<Pane>;
|
|
11
|
+
getPane: (id: string) => ShallowRef<Pane | undefined>;
|
|
12
|
+
closePane: (paneId: string) => void;
|
|
13
|
+
setActivePane: (paneId: string) => void;
|
|
14
|
+
isDraggingTab: Ref<boolean>;
|
|
15
|
+
draggedTabData: Ref<{
|
|
16
|
+
tabId: string;
|
|
17
|
+
paneId: string;
|
|
18
|
+
} | undefined>;
|
|
19
|
+
initNewTab: (params?: InitialTabParams) => Promise<Tab>;
|
|
20
|
+
addTab: (paneId: string, params?: InitialTabParams) => Promise<Tab | undefined>;
|
|
21
|
+
closeTab: (paneId: string, tabId: string) => Promise<boolean>;
|
|
22
|
+
selectTab: (paneId: string, tabId: string) => void;
|
|
23
|
+
moveTab: (tabId: string, fromPaneId: string, toPaneId: string, index?: number) => Promise<Tab | undefined>;
|
|
24
|
+
navigate: (params: RouteLocationRaw, paneId?: string, tabId?: string) => Promise<void>;
|
|
25
|
+
startDraggingTab: (tabId: string, paneId: string) => void;
|
|
26
|
+
stopDraggingTab: () => void;
|
|
27
|
+
getPanesData: () => PaneSnapshot[];
|
|
28
|
+
restorePanesData: (panes: PaneSnapshot[]) => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export type PaneStoreDefinition = StoreDefinition<PaneStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type PlatformType = 'mobile' | 'desktop' | 'capacitor' | 'nativeMobile' | 'electron' | 'linux' | 'mac' | 'win' | 'chrome' | 'firefox' | 'opera' | 'safari' | 'webkit' | 'ios' | 'ipad' | 'iphone' | 'ipod' | 'winphone' | 'blackberry' | 'android' | 'cordova' | 'pwa' | 'ssr' | 'bex';
|
|
2
|
+
export interface PlatformDetection {
|
|
3
|
+
is: Record<PlatformType, boolean>;
|
|
4
|
+
current: PlatformType[];
|
|
5
|
+
}
|
|
6
|
+
export type PlatformHandler<T> = {
|
|
7
|
+
[K in PlatformType]?: () => T | Promise<T>;
|
|
8
|
+
} & {
|
|
9
|
+
default: () => T | Promise<T>;
|
|
10
|
+
};
|
|
11
|
+
export type PlatformMatch = <T>(handlers: PlatformHandler<T>) => Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PlatformSpecificFn = <T extends (...params: any[]) => any>(fn?: T, defaultValue?: Awaited<ReturnType<T>> | Promise<Awaited<ReturnType<T>>>) => (...params: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|