@lapis-notes/api 0.1.3 → 0.2.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/CHANGELOG.md +304 -13
- package/README.md +19 -0
- package/dist/__tests__/fixtures/indexed-mutations.json +6862 -0
- package/dist/__tests__/fixtures/memory-storage.json +309 -0
- package/dist/__tests__/fixtures/native-facade-contract.json +3224 -0
- package/dist/__tests__/fixtures/projection-query.json +195 -0
- package/dist/__tests__/fixtures/projection-values.json +60 -0
- package/dist/__tests__/fixtures/search-preparation.json +1513 -0
- package/dist/__tests__/fixtures/search-retrieval.json +15409 -0
- package/dist/__tests__/fixtures/search-semantic-model.json +3691 -0
- package/dist/__tests__/fixtures/search-semantic-retrieval.json +6603 -0
- package/dist/__tests__/fixtures/search-storage.json +409 -0
- package/dist/__tests__/fixtures/task-projection.json +428 -0
- package/dist/__tests__/indexed-mutation-support.js +262 -0
- package/dist/__tests__/projection-query-support.js +40 -0
- package/dist/__tests__/search-retrieval-support.js +47 -0
- package/dist/app-database-host.d.ts +1 -0
- package/dist/app-shell-plugin-persistence.d.ts +3 -2
- package/dist/app-shell-plugin-persistence.js +37 -3
- package/dist/cache.svelte.d.ts +8 -1
- package/dist/cache.svelte.js +103 -5
- package/dist/command.svelte.js +29 -2
- package/dist/components/editor/editor.css +4 -0
- package/dist/components/editor/editor.svelte +24 -11
- package/dist/components/editor/embedded-editor-surface.js +3 -1
- package/dist/components/editor/inline-title-alignment.d.ts +3 -0
- package/dist/components/editor/inline-title-alignment.js +57 -0
- package/dist/configuration.svelte.d.ts +270 -206
- package/dist/configuration.svelte.js +161 -86
- package/dist/context.svelte.d.ts +23 -3
- package/dist/context.svelte.js +68 -30
- package/dist/diagnostics.d.ts +8 -0
- package/dist/diagnostics.js +6 -0
- package/dist/editor-save-context.d.ts +35 -0
- package/dist/editor-save-context.js +132 -0
- package/dist/editor-view-registry.d.ts +10 -0
- package/dist/editor-view-registry.js +44 -4
- package/dist/editor.svelte.d.ts +19 -1
- package/dist/editor.svelte.js +528 -55
- package/dist/embed-registry.d.ts +10 -0
- package/dist/embed-registry.js +15 -0
- package/dist/file-editing-failures.d.ts +2 -0
- package/dist/file-editing-failures.js +29 -0
- package/dist/file-editing-native-issues.d.ts +19 -0
- package/dist/file-editing-native-issues.js +65 -0
- package/dist/file-editing-sessions.d.ts +76 -0
- package/dist/file-editing-sessions.js +367 -0
- package/dist/file-manager.d.ts +9 -1
- package/dist/file-manager.js +45 -3
- package/dist/file-state-store.d.ts +5 -0
- package/dist/file-state-store.js +34 -0
- package/dist/file-text-conflicts.d.ts +25 -0
- package/dist/file-text-conflicts.js +35 -0
- package/dist/file-text-mutation.d.ts +13 -0
- package/dist/file-text-mutation.js +100 -0
- package/dist/file-text-persistence.d.ts +36 -0
- package/dist/file-text-persistence.js +234 -0
- package/dist/file-text-state-writer.d.ts +34 -0
- package/dist/file-text-state-writer.js +183 -0
- package/dist/files-configuration.d.ts +20 -0
- package/dist/files-configuration.js +47 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +114 -34
- package/dist/generated/plugin-host-modules.schema.generated.js +132 -34
- package/dist/glob.d.ts +3 -0
- package/dist/glob.js +2 -1
- package/dist/icons/changes.d.ts +3 -0
- package/dist/icons/changes.js +16 -0
- package/dist/icons/index.d.ts +5 -1
- package/dist/icons/index.js +44 -3
- package/dist/icons/registry.d.ts +35 -0
- package/dist/icons/registry.js +154 -0
- package/dist/icons/safe-svg.d.ts +2 -0
- package/dist/icons/safe-svg.js +44 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +4 -1
- package/dist/lapis-extension.d.ts +6 -2
- package/dist/lapis-extension.js +2 -0
- package/dist/metadata-store.d.ts +23 -0
- package/dist/metadata-store.js +1 -0
- package/dist/metadata.svelte.js +45 -2
- package/dist/native-background-indexing.d.ts +48 -0
- package/dist/native-background-indexing.js +208 -0
- package/dist/native-database-protocol.d.ts +29 -0
- package/dist/native-database-protocol.js +1 -0
- package/dist/native-editing-intent-lease.d.ts +17 -0
- package/dist/native-editing-intent-lease.js +188 -0
- package/dist/native-editing-intents-protocol.d.ts +70 -0
- package/dist/native-editing-intents-protocol.js +1 -0
- package/dist/native-editing-intents.d.ts +8 -0
- package/dist/native-editing-intents.js +1 -0
- package/dist/native-editing-problems.d.ts +3 -0
- package/dist/native-editing-problems.js +180 -0
- package/dist/native-editing-recovery.d.ts +24 -0
- package/dist/native-editing-recovery.js +198 -0
- package/dist/native-editing-session.d.ts +51 -0
- package/dist/native-editing-session.js +251 -0
- package/dist/native-history-index-protocol.d.ts +80 -0
- package/dist/native-history-index-protocol.js +1 -0
- package/dist/native-history-index.d.ts +6 -0
- package/dist/native-history-index.js +1 -0
- package/dist/native-indexing-protocol.d.ts +63 -0
- package/dist/native-indexing-protocol.js +1 -0
- package/dist/native-participant-protocol.d.ts +67 -0
- package/dist/native-participant-protocol.js +3 -0
- package/dist/native-queue-protocol.d.ts +73 -0
- package/dist/native-queue-protocol.js +3 -0
- package/dist/native-tasks-protocol.d.ts +264 -0
- package/dist/native-tasks-protocol.js +1 -0
- package/dist/native-tasks.d.ts +35 -0
- package/dist/native-tasks.js +79 -0
- package/dist/native-turn-protocol.d.ts +81 -0
- package/dist/native-turn-protocol.js +1 -0
- package/dist/native-turns.d.ts +29 -0
- package/dist/native-turns.js +2 -0
- package/dist/plugin-asset-server.js +3 -2
- package/dist/plugin-dependency-resolver.d.ts +1 -1
- package/dist/plugin-distribution/compatibility.d.ts +1 -1
- package/dist/plugin-distribution/compatibility.js +10 -5
- package/dist/plugin-distribution/installed-plugin-state.js +2 -1
- package/dist/plugin-distribution/installer.d.ts +6 -0
- package/dist/plugin-distribution/installer.js +90 -37
- package/dist/plugin-distribution/manager.d.ts +4 -1
- package/dist/plugin-distribution/manager.js +12 -5
- package/dist/plugin-distribution/registry-cache.js +2 -1
- package/dist/plugin-distribution/registry-source-state.js +2 -1
- package/dist/plugin-distribution/schemas.d.ts +26 -8
- package/dist/plugin-distribution/schemas.js +2 -1
- package/dist/plugin-distribution/types.d.ts +4 -0
- package/dist/plugin-manager.d.ts +21 -5
- package/dist/plugin-manager.js +228 -64
- package/dist/plugin-runtime-entry.d.ts +1 -1
- package/dist/plugin-runtime-entry.js +16 -0
- package/dist/plugin.d.ts +19 -3
- package/dist/plugin.js +110 -44
- package/dist/registry-schema/catalog-v1.d.ts +60 -9
- package/dist/registry-schema/catalog-v1.js +2 -1
- package/dist/registry-schema/catalog-v2.d.ts +60 -9
- package/dist/registry-schema/catalog-v2.js +1 -1
- package/dist/search-result-provider.d.ts +95 -0
- package/dist/search-result-provider.js +42 -0
- package/dist/status-bar.svelte.d.ts +26 -20
- package/dist/status-bar.svelte.js +1 -0
- package/dist/storage/app-database.d.ts +9 -23
- package/dist/storage/app-database.js +41 -34
- package/dist/storage/desktop-native.d.ts +5 -3
- package/dist/storage/desktop-native.js +59 -6
- package/dist/storage/directory-watcher.d.ts +27 -0
- package/dist/storage/directory-watcher.js +201 -0
- package/dist/storage/fs.d.ts +14 -27
- package/dist/storage/fs.js +2 -168
- package/dist/storage/index-projection.js +33 -15
- package/dist/storage/memory-vault-adapter.d.ts +2 -0
- package/dist/storage/memory-vault-adapter.js +14 -1
- package/dist/storage/path.d.ts +6 -2
- package/dist/storage/path.js +8 -2
- package/dist/storage/projection-query-candidates.d.ts +3 -0
- package/dist/storage/projection-query-candidates.js +69 -0
- package/dist/storage/remote-app-database.d.ts +2 -2
- package/dist/storage/remote-app-database.js +1 -1
- package/dist/storage/runtime.d.ts +3 -0
- package/dist/storage/runtime.js +3 -0
- package/dist/storage/search-embedding-record.d.ts +3 -0
- package/dist/storage/search-embedding-record.js +18 -0
- package/dist/storage/turso-app-database.d.ts +2 -0
- package/dist/storage/turso-app-database.js +67 -30
- package/dist/storage/vault-listing.d.ts +3 -0
- package/dist/storage/vault-listing.js +36 -0
- package/dist/storage/vault-reconciliation.d.ts +19 -0
- package/dist/storage/vault-reconciliation.js +137 -0
- package/dist/storage/vault-session.d.ts +8 -0
- package/dist/storage/vault-session.js +10 -2
- package/dist/storage/vault.svelte.d.ts +53 -4
- package/dist/storage/vault.svelte.js +223 -87
- package/dist/sync-editor-flush.d.ts +6 -0
- package/dist/sync-editor-flush.js +22 -0
- package/dist/sync-host-local.d.ts +15 -0
- package/dist/sync-host-local.js +228 -0
- package/dist/sync-host-security.d.ts +24 -9
- package/dist/sync-host-security.js +47 -14
- package/dist/sync-host.d.ts +33 -4
- package/dist/sync-host.js +160 -10
- package/dist/sync-repository.d.ts +106 -0
- package/dist/sync-repository.js +18 -0
- package/dist/vault-change-views.d.ts +4 -0
- package/dist/vault-change-views.js +43 -0
- package/dist/vault-changes.d.ts +37 -0
- package/dist/vault-changes.js +228 -0
- package/dist/view.svelte.d.ts +182 -149
- package/dist/view.svelte.js +39 -21
- package/dist/workspace-close-guard.d.ts +3 -0
- package/dist/workspace-close-guard.js +35 -0
- package/dist/workspace-host-internal.js +10 -2
- package/dist/workspace-layout-normalizer.d.ts +4 -2
- package/dist/workspace-layout-normalizer.js +5 -5
- package/dist/workspace-view-document.d.ts +3 -0
- package/dist/workspace-view-document.js +12 -0
- package/dist/workspace.svelte.d.ts +13 -2
- package/dist/workspace.svelte.js +371 -82
- package/package.json +61 -8
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const insetProperty = "--ui-editor-inline-title-inset";
|
|
2
|
+
/** Keep the sibling filename aligned with CodeMirror's unindented text column. */
|
|
3
|
+
export function syncInlineTitleAlignment(view, host) {
|
|
4
|
+
const sizer = host.parentElement;
|
|
5
|
+
const key = {};
|
|
6
|
+
let active = true;
|
|
7
|
+
function schedule() {
|
|
8
|
+
if (!active)
|
|
9
|
+
return;
|
|
10
|
+
view.requestMeasure({
|
|
11
|
+
key,
|
|
12
|
+
read() {
|
|
13
|
+
const bounds = host.getBoundingClientRect();
|
|
14
|
+
const content = view.contentDOM.getBoundingClientRect();
|
|
15
|
+
if (!host.isConnected || bounds.width <= 0 || content.width <= 0) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const style = view.dom.ownerDocument.defaultView.getComputedStyle(view.contentDOM);
|
|
19
|
+
const rtl = style.direction === "rtl";
|
|
20
|
+
const padding = parseFloat(rtl ? style.paddingRight : style.paddingLeft) || 0;
|
|
21
|
+
return Math.max(0, (rtl ? bounds.right - content.right : content.left - bounds.left) +
|
|
22
|
+
padding);
|
|
23
|
+
},
|
|
24
|
+
write(inset) {
|
|
25
|
+
if (!active || inset === null)
|
|
26
|
+
return;
|
|
27
|
+
const value = `${inset}px`;
|
|
28
|
+
if (sizer.style.getPropertyValue(insetProperty) !== value) {
|
|
29
|
+
sizer.style.setProperty(insetProperty, value);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const resize = new ResizeObserver(schedule);
|
|
35
|
+
resize.observe(host);
|
|
36
|
+
resize.observe(view.dom);
|
|
37
|
+
resize.observe(view.contentDOM);
|
|
38
|
+
// Reconfiguration may replace gutter columns or change editor classes without
|
|
39
|
+
// resizing the outer host. Writes land on the sibling sizer, outside this tree.
|
|
40
|
+
const mutation = new MutationObserver(schedule);
|
|
41
|
+
mutation.observe(view.dom, {
|
|
42
|
+
childList: true,
|
|
43
|
+
subtree: true,
|
|
44
|
+
attributes: true,
|
|
45
|
+
attributeFilter: ["class", "style"],
|
|
46
|
+
});
|
|
47
|
+
const fonts = host.ownerDocument.fonts;
|
|
48
|
+
fonts?.addEventListener("loadingdone", schedule);
|
|
49
|
+
schedule();
|
|
50
|
+
return () => {
|
|
51
|
+
active = false;
|
|
52
|
+
resize.disconnect();
|
|
53
|
+
mutation.disconnect();
|
|
54
|
+
fonts?.removeEventListener("loadingdone", schedule);
|
|
55
|
+
sizer.style.removeProperty(insetProperty);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -1,258 +1,322 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "zod/v3";
|
|
2
2
|
import type { App } from "./context.svelte";
|
|
3
3
|
import { SettingTab } from "./settings.svelte";
|
|
4
4
|
import { EventDispatcher } from "./events";
|
|
5
|
-
type PluginDataUpdateOrigin =
|
|
5
|
+
type PluginDataUpdateOrigin =
|
|
6
|
+
| "plugin-save"
|
|
7
|
+
| "configuration-update"
|
|
8
|
+
| "external-reload";
|
|
6
9
|
type PluginDataUpdateEvent = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
pluginId: string;
|
|
11
|
+
value: any;
|
|
12
|
+
prev: any;
|
|
13
|
+
origin: PluginDataUpdateOrigin;
|
|
11
14
|
};
|
|
12
15
|
export type StringType = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
type: "string";
|
|
17
|
+
editPresentation?: "multilineText";
|
|
18
|
+
format?: string;
|
|
19
|
+
optionsSource?: string;
|
|
20
|
+
allowUnknownOptions?: boolean;
|
|
21
|
+
default?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
markdownDescription?: string;
|
|
25
|
+
order?: number;
|
|
26
|
+
deprecationMessage?: string;
|
|
27
|
+
markdownDeprecationMessage?: string;
|
|
25
28
|
};
|
|
26
29
|
export type NumberType = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
type: "number";
|
|
31
|
+
order?: number;
|
|
32
|
+
default?: number;
|
|
33
|
+
minimum?: number;
|
|
34
|
+
maximum?: number;
|
|
35
|
+
step?: number;
|
|
36
|
+
title?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
markdownDescription?: string;
|
|
39
|
+
deprecationMessage?: string;
|
|
40
|
+
markdownDeprecationMessage?: string;
|
|
38
41
|
};
|
|
39
42
|
export type IntegerType = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
type: "integer";
|
|
44
|
+
order?: number;
|
|
45
|
+
default?: number;
|
|
46
|
+
minimum?: number;
|
|
47
|
+
maximum?: number;
|
|
48
|
+
step?: number;
|
|
49
|
+
title?: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
markdownDescription?: string;
|
|
52
|
+
deprecationMessage?: string;
|
|
53
|
+
markdownDeprecationMessage?: string;
|
|
51
54
|
};
|
|
52
55
|
export type BooleanType = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
type: "boolean";
|
|
57
|
+
order?: number;
|
|
58
|
+
default?: boolean;
|
|
59
|
+
title?: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
markdownDescription?: string;
|
|
62
|
+
deprecationMessage?: string;
|
|
63
|
+
markdownDeprecationMessage?: string;
|
|
61
64
|
};
|
|
62
65
|
export type EnumType = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
type: "string";
|
|
67
|
+
order?: number;
|
|
68
|
+
enum: string[];
|
|
69
|
+
default?: string;
|
|
70
|
+
title?: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
markdownDescription?: string;
|
|
73
|
+
enumDescriptions?: string[];
|
|
74
|
+
enumMarkdownDescriptions?: string[];
|
|
75
|
+
enumItemLabels?: string[];
|
|
76
|
+
optionsSource?: string;
|
|
77
|
+
allowUnknownOptions?: boolean;
|
|
78
|
+
deprecationMessage?: string;
|
|
79
|
+
markdownDeprecationMessage?: string;
|
|
77
80
|
};
|
|
78
81
|
export type ArrayType = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
type: "array";
|
|
83
|
+
order?: number;
|
|
84
|
+
items: SchemaType;
|
|
85
|
+
minItems?: number;
|
|
86
|
+
maxItems?: number;
|
|
87
|
+
default?: any[];
|
|
88
|
+
title?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
markdownDescription?: string;
|
|
91
|
+
deprecationMessage?: string;
|
|
92
|
+
markdownDeprecationMessage?: string;
|
|
90
93
|
};
|
|
91
94
|
export type ObjectType = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
type: "object";
|
|
96
|
+
order?: number;
|
|
97
|
+
title?: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
markdownDescription?: string;
|
|
100
|
+
properties: Record<string, SchemaType>;
|
|
101
|
+
additionalProperties?: boolean | SchemaType;
|
|
102
|
+
default?: Record<string, unknown>;
|
|
103
|
+
deprecationMessage?: string;
|
|
104
|
+
markdownDeprecationMessage?: string;
|
|
102
105
|
};
|
|
103
106
|
export type CustomType = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
type: "custom";
|
|
108
|
+
component: SettingTab;
|
|
109
|
+
title?: string;
|
|
110
|
+
description?: string;
|
|
111
|
+
markdownDescription?: string;
|
|
109
112
|
};
|
|
110
|
-
export type SchemaType =
|
|
111
|
-
|
|
113
|
+
export type SchemaType =
|
|
114
|
+
| StringType
|
|
115
|
+
| NumberType
|
|
116
|
+
| IntegerType
|
|
117
|
+
| EnumType
|
|
118
|
+
| BooleanType
|
|
119
|
+
| ObjectType
|
|
120
|
+
| CustomType
|
|
121
|
+
| ArrayType;
|
|
122
|
+
export declare function isFlatPrimitiveObjectSchema(
|
|
123
|
+
schema: ObjectType,
|
|
124
|
+
): boolean;
|
|
112
125
|
export declare function isRecordObjectSchema(schema: ObjectType): boolean;
|
|
113
126
|
export declare function isPrimitiveArraySchema(schema: ArrayType): boolean;
|
|
114
|
-
declare const configurationType: z.ZodObject<
|
|
127
|
+
declare const configurationType: z.ZodObject<
|
|
128
|
+
{
|
|
115
129
|
id: z.ZodOptional<z.ZodString>;
|
|
116
130
|
$schema: z.ZodOptional<z.ZodString>;
|
|
117
131
|
title: z.ZodString;
|
|
118
132
|
type: z.ZodLiteral<"object">;
|
|
119
|
-
properties: z.ZodRecord<
|
|
120
|
-
|
|
133
|
+
properties: z.ZodRecord<
|
|
134
|
+
z.ZodString,
|
|
135
|
+
z.ZodLazy<z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>>
|
|
136
|
+
>;
|
|
137
|
+
},
|
|
138
|
+
"strip",
|
|
139
|
+
z.ZodTypeAny,
|
|
140
|
+
{
|
|
121
141
|
title: string;
|
|
122
142
|
type: "object";
|
|
123
143
|
properties: Record<string, SchemaType>;
|
|
124
144
|
id?: string | undefined;
|
|
125
145
|
$schema?: string | undefined;
|
|
126
|
-
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
127
148
|
title: string;
|
|
128
149
|
type: "object";
|
|
129
150
|
properties: Record<string, SchemaType>;
|
|
130
151
|
id?: string | undefined;
|
|
131
152
|
$schema?: string | undefined;
|
|
132
|
-
}
|
|
133
|
-
|
|
153
|
+
}
|
|
154
|
+
>;
|
|
155
|
+
export declare const configType: z.ZodLazy<
|
|
156
|
+
z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>
|
|
157
|
+
>;
|
|
134
158
|
export type ConfigurationType = z.infer<typeof configurationType>;
|
|
135
|
-
export declare const constributesType: z.ZodUnion<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
159
|
+
export declare const constributesType: z.ZodUnion<
|
|
160
|
+
[
|
|
161
|
+
z.ZodObject<
|
|
162
|
+
{
|
|
163
|
+
id: z.ZodOptional<z.ZodString>;
|
|
164
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
165
|
+
title: z.ZodString;
|
|
166
|
+
type: z.ZodLiteral<"object">;
|
|
167
|
+
properties: z.ZodRecord<
|
|
168
|
+
z.ZodString,
|
|
169
|
+
z.ZodLazy<z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>>
|
|
170
|
+
>;
|
|
171
|
+
},
|
|
172
|
+
"strip",
|
|
173
|
+
z.ZodTypeAny,
|
|
174
|
+
{
|
|
175
|
+
title: string;
|
|
176
|
+
type: "object";
|
|
177
|
+
properties: Record<string, SchemaType>;
|
|
178
|
+
id?: string | undefined;
|
|
179
|
+
$schema?: string | undefined;
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
title: string;
|
|
183
|
+
type: "object";
|
|
184
|
+
properties: Record<string, SchemaType>;
|
|
185
|
+
id?: string | undefined;
|
|
186
|
+
$schema?: string | undefined;
|
|
187
|
+
}
|
|
188
|
+
>,
|
|
189
|
+
z.ZodArray<
|
|
190
|
+
z.ZodObject<
|
|
191
|
+
{
|
|
192
|
+
id: z.ZodOptional<z.ZodString>;
|
|
193
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
194
|
+
title: z.ZodString;
|
|
195
|
+
type: z.ZodLiteral<"object">;
|
|
196
|
+
properties: z.ZodRecord<
|
|
197
|
+
z.ZodString,
|
|
198
|
+
z.ZodLazy<z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>>
|
|
199
|
+
>;
|
|
200
|
+
},
|
|
201
|
+
"strip",
|
|
202
|
+
z.ZodTypeAny,
|
|
203
|
+
{
|
|
204
|
+
title: string;
|
|
205
|
+
type: "object";
|
|
206
|
+
properties: Record<string, SchemaType>;
|
|
207
|
+
id?: string | undefined;
|
|
208
|
+
$schema?: string | undefined;
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
title: string;
|
|
212
|
+
type: "object";
|
|
213
|
+
properties: Record<string, SchemaType>;
|
|
214
|
+
id?: string | undefined;
|
|
215
|
+
$schema?: string | undefined;
|
|
216
|
+
}
|
|
217
|
+
>,
|
|
218
|
+
"many"
|
|
219
|
+
>,
|
|
220
|
+
]
|
|
221
|
+
>;
|
|
172
222
|
export type ContributesType = z.infer<typeof constributesType>;
|
|
173
223
|
export type ConfigurationGroupType = {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
224
|
+
id: string;
|
|
225
|
+
title: string;
|
|
226
|
+
description?: string;
|
|
227
|
+
markdownDescription?: string;
|
|
178
228
|
};
|
|
179
229
|
export interface WorkspaceConfiguration {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
230
|
+
has(key: string): boolean;
|
|
231
|
+
get<T>(key: string, defaultValue?: T): T;
|
|
232
|
+
update(key: string, value: any): Promise<void>;
|
|
233
|
+
entries<T>(): [string, T][];
|
|
234
|
+
values<T>(): T[];
|
|
235
|
+
keys(): string[];
|
|
186
236
|
}
|
|
187
237
|
export type ConfigurationSchemaType = SchemaType & {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
238
|
+
configId: string;
|
|
239
|
+
category: string;
|
|
240
|
+
categoryId: string;
|
|
241
|
+
groupPath?: ConfigurationGroupType[];
|
|
192
242
|
};
|
|
193
243
|
export declare class ConfigurationSchema extends EventDispatcher<{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
244
|
+
updated: [
|
|
245
|
+
{
|
|
246
|
+
key: string;
|
|
247
|
+
value: any;
|
|
248
|
+
prev?: any;
|
|
249
|
+
},
|
|
250
|
+
];
|
|
199
251
|
}> {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
252
|
+
private values;
|
|
253
|
+
constructor();
|
|
254
|
+
getConfiguration(section?: string): WorkspaceConfiguration;
|
|
255
|
+
getDefinition(key: string): ConfigurationSchemaType | undefined;
|
|
256
|
+
validateConfigurationOption(key: string, value: unknown): unknown;
|
|
257
|
+
getDefaultEntries(): [string, unknown][];
|
|
258
|
+
register(...schemas: any[]): void;
|
|
259
|
+
unregister(...schemas: any[]): void;
|
|
260
|
+
removeWebView(id: string): void;
|
|
261
|
+
registerWebView(id: string, title: string, component: SettingTab): void;
|
|
262
|
+
updateConfigurationOption(key: string, value: any): Promise<void>;
|
|
263
|
+
removeConfigurationOption(key: string): Promise<void>;
|
|
212
264
|
}
|
|
213
265
|
export declare class Configuration extends EventDispatcher<{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
266
|
+
updated: [
|
|
267
|
+
{
|
|
268
|
+
key: string;
|
|
269
|
+
value: any;
|
|
270
|
+
prev: any;
|
|
271
|
+
},
|
|
272
|
+
];
|
|
273
|
+
"plugin-data-updated": [event: PluginDataUpdateEvent];
|
|
220
274
|
}> {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
275
|
+
readonly app: App;
|
|
276
|
+
readonly basePath: string;
|
|
277
|
+
private values;
|
|
278
|
+
readonly schema: ConfigurationSchema;
|
|
279
|
+
constructor(app: App, basePath: string);
|
|
280
|
+
load(): Promise<void>;
|
|
281
|
+
hasPluginData(pluginId: string): boolean;
|
|
282
|
+
getPluginData<T = any>(pluginId: string): T | null;
|
|
283
|
+
updatePluginData(
|
|
284
|
+
pluginId: string,
|
|
285
|
+
value: any,
|
|
286
|
+
options?: {
|
|
287
|
+
origin?: PluginDataUpdateOrigin;
|
|
288
|
+
},
|
|
289
|
+
): Promise<void>;
|
|
290
|
+
removePluginData(
|
|
291
|
+
pluginId: string,
|
|
292
|
+
options?: {
|
|
293
|
+
origin?: PluginDataUpdateOrigin;
|
|
294
|
+
},
|
|
295
|
+
): Promise<void>;
|
|
296
|
+
reloadFromDisk(options?: {
|
|
297
|
+
emitPluginDataEvents?: boolean;
|
|
298
|
+
materializeDefaults?: boolean;
|
|
299
|
+
origin?: PluginDataUpdateOrigin;
|
|
300
|
+
}): Promise<void>;
|
|
301
|
+
getConfiguration(section?: string): WorkspaceConfiguration;
|
|
302
|
+
updateConfigurationOption(key: string, value: any): Promise<void>;
|
|
303
|
+
/**
|
|
304
|
+
* Validate and persist a set of flat configuration keys as one update.
|
|
305
|
+
*
|
|
306
|
+
* Validation and the vault write both complete before observable state or
|
|
307
|
+
* update events change, so consumers never see a partially applied batch.
|
|
308
|
+
*
|
|
309
|
+
* @public
|
|
310
|
+
*/
|
|
311
|
+
updateConfigurationOptions(
|
|
312
|
+
changes: Readonly<Record<string, any>>,
|
|
313
|
+
): Promise<void>;
|
|
314
|
+
removeConfigurationOption(key: string): Promise<void>;
|
|
315
|
+
private persist;
|
|
316
|
+
private getPluginDataStore;
|
|
317
|
+
private readValuesFromDisk;
|
|
318
|
+
private emitPluginDataDiffs;
|
|
319
|
+
private watchExternalConfigChanges;
|
|
320
|
+
materializeSchemaDefaults(): Promise<void>;
|
|
257
321
|
}
|
|
258
322
|
export {};
|