@lapis-notes/api 0.1.4 → 0.2.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.
Files changed (188) hide show
  1. package/CHANGELOG.md +206 -0
  2. package/README.md +21 -2
  3. package/dist/__tests__/fixtures/indexed-mutations.json +6862 -0
  4. package/dist/__tests__/fixtures/memory-storage.json +309 -0
  5. package/dist/__tests__/fixtures/native-facade-contract.json +3224 -0
  6. package/dist/__tests__/fixtures/projection-query.json +195 -0
  7. package/dist/__tests__/fixtures/projection-values.json +60 -0
  8. package/dist/__tests__/fixtures/search-preparation.json +1513 -0
  9. package/dist/__tests__/fixtures/search-retrieval.json +15409 -0
  10. package/dist/__tests__/fixtures/search-semantic-model.json +3691 -0
  11. package/dist/__tests__/fixtures/search-semantic-retrieval.json +6603 -0
  12. package/dist/__tests__/fixtures/search-storage.json +409 -0
  13. package/dist/__tests__/fixtures/task-projection.json +428 -0
  14. package/dist/__tests__/indexed-mutation-support.js +262 -0
  15. package/dist/__tests__/projection-query-support.js +40 -0
  16. package/dist/__tests__/search-retrieval-support.js +47 -0
  17. package/dist/app-database-host.d.ts +1 -0
  18. package/dist/app-shell-plugin-persistence.d.ts +3 -2
  19. package/dist/app-shell-plugin-persistence.js +37 -3
  20. package/dist/cache.svelte.d.ts +8 -1
  21. package/dist/cache.svelte.js +103 -5
  22. package/dist/command.svelte.js +29 -2
  23. package/dist/components/editor/editor.css +4 -0
  24. package/dist/components/editor/editor.svelte +21 -9
  25. package/dist/components/editor/embedded-editor-surface.js +3 -1
  26. package/dist/components/editor/inline-title-alignment.d.ts +3 -0
  27. package/dist/components/editor/inline-title-alignment.js +57 -0
  28. package/dist/configuration.svelte.d.ts +270 -206
  29. package/dist/configuration.svelte.js +161 -86
  30. package/dist/context.svelte.d.ts +21 -3
  31. package/dist/context.svelte.js +63 -20
  32. package/dist/diagnostics.d.ts +8 -0
  33. package/dist/diagnostics.js +6 -0
  34. package/dist/editor-save-context.d.ts +12 -1
  35. package/dist/editor-save-context.js +32 -1
  36. package/dist/editor-view-registry.d.ts +10 -0
  37. package/dist/editor-view-registry.js +44 -4
  38. package/dist/editor.svelte.js +128 -37
  39. package/dist/embed-registry.d.ts +10 -0
  40. package/dist/embed-registry.js +15 -0
  41. package/dist/file-editing-failures.d.ts +2 -0
  42. package/dist/file-editing-failures.js +29 -0
  43. package/dist/file-editing-native-issues.d.ts +19 -0
  44. package/dist/file-editing-native-issues.js +65 -0
  45. package/dist/file-editing-sessions.d.ts +56 -8
  46. package/dist/file-editing-sessions.js +185 -15
  47. package/dist/file-manager.d.ts +8 -1
  48. package/dist/file-manager.js +37 -3
  49. package/dist/file-state-store.d.ts +5 -0
  50. package/dist/file-state-store.js +34 -0
  51. package/dist/file-text-conflicts.d.ts +25 -0
  52. package/dist/file-text-conflicts.js +35 -0
  53. package/dist/file-text-mutation.d.ts +13 -0
  54. package/dist/file-text-mutation.js +100 -0
  55. package/dist/file-text-persistence.d.ts +36 -0
  56. package/dist/file-text-persistence.js +234 -0
  57. package/dist/file-text-state-writer.d.ts +34 -0
  58. package/dist/file-text-state-writer.js +183 -0
  59. package/dist/files-configuration.d.ts +20 -0
  60. package/dist/files-configuration.js +47 -0
  61. package/dist/generated/plugin-host-modules.schema.generated.d.ts +87 -37
  62. package/dist/generated/plugin-host-modules.schema.generated.js +102 -37
  63. package/dist/glob.d.ts +3 -0
  64. package/dist/glob.js +2 -1
  65. package/dist/icons/changes.d.ts +3 -0
  66. package/dist/icons/changes.js +16 -0
  67. package/dist/icons/index.d.ts +5 -1
  68. package/dist/icons/index.js +44 -3
  69. package/dist/icons/registry.d.ts +35 -0
  70. package/dist/icons/registry.js +154 -0
  71. package/dist/icons/safe-svg.d.ts +2 -0
  72. package/dist/icons/safe-svg.js +44 -0
  73. package/dist/index.d.ts +5 -1
  74. package/dist/index.js +3 -1
  75. package/dist/lapis-extension.d.ts +6 -2
  76. package/dist/lapis-extension.js +2 -0
  77. package/dist/metadata.svelte.js +45 -2
  78. package/dist/native-background-indexing.d.ts +48 -0
  79. package/dist/native-background-indexing.js +208 -0
  80. package/dist/native-database-protocol.d.ts +29 -0
  81. package/dist/native-database-protocol.js +1 -0
  82. package/dist/native-editing-intent-lease.d.ts +17 -0
  83. package/dist/native-editing-intent-lease.js +188 -0
  84. package/dist/native-editing-intents-protocol.d.ts +70 -0
  85. package/dist/native-editing-intents-protocol.js +1 -0
  86. package/dist/native-editing-intents.d.ts +8 -0
  87. package/dist/native-editing-intents.js +1 -0
  88. package/dist/native-editing-problems.d.ts +3 -0
  89. package/dist/native-editing-problems.js +180 -0
  90. package/dist/native-editing-recovery.d.ts +24 -0
  91. package/dist/native-editing-recovery.js +198 -0
  92. package/dist/native-editing-session.d.ts +51 -0
  93. package/dist/native-editing-session.js +251 -0
  94. package/dist/native-history-index-protocol.d.ts +80 -0
  95. package/dist/native-history-index-protocol.js +1 -0
  96. package/dist/native-history-index.d.ts +6 -0
  97. package/dist/native-history-index.js +1 -0
  98. package/dist/native-indexing-protocol.d.ts +63 -0
  99. package/dist/native-indexing-protocol.js +1 -0
  100. package/dist/native-participant-protocol.d.ts +67 -0
  101. package/dist/native-participant-protocol.js +3 -0
  102. package/dist/native-queue-protocol.d.ts +73 -0
  103. package/dist/native-queue-protocol.js +3 -0
  104. package/dist/native-tasks-protocol.d.ts +264 -0
  105. package/dist/native-tasks-protocol.js +1 -0
  106. package/dist/native-tasks.d.ts +35 -0
  107. package/dist/native-tasks.js +79 -0
  108. package/dist/native-turn-protocol.d.ts +81 -0
  109. package/dist/native-turn-protocol.js +1 -0
  110. package/dist/native-turns.d.ts +29 -0
  111. package/dist/native-turns.js +2 -0
  112. package/dist/plugin-asset-server.js +3 -2
  113. package/dist/plugin-dependency-resolver.d.ts +1 -1
  114. package/dist/plugin-distribution/compatibility.d.ts +1 -1
  115. package/dist/plugin-distribution/compatibility.js +10 -5
  116. package/dist/plugin-distribution/installed-plugin-state.js +2 -1
  117. package/dist/plugin-distribution/installer.d.ts +6 -0
  118. package/dist/plugin-distribution/installer.js +90 -37
  119. package/dist/plugin-distribution/manager.d.ts +4 -1
  120. package/dist/plugin-distribution/manager.js +12 -5
  121. package/dist/plugin-distribution/registry-cache.js +2 -1
  122. package/dist/plugin-distribution/registry-source-state.js +2 -1
  123. package/dist/plugin-distribution/schemas.d.ts +26 -8
  124. package/dist/plugin-distribution/schemas.js +2 -1
  125. package/dist/plugin-distribution/types.d.ts +4 -0
  126. package/dist/plugin-manager.d.ts +20 -4
  127. package/dist/plugin-manager.js +228 -64
  128. package/dist/plugin-runtime-entry.d.ts +1 -1
  129. package/dist/plugin-runtime-entry.js +16 -0
  130. package/dist/plugin.d.ts +18 -2
  131. package/dist/plugin.js +93 -39
  132. package/dist/registry-schema/catalog-v1.d.ts +60 -9
  133. package/dist/registry-schema/catalog-v1.js +2 -1
  134. package/dist/registry-schema/catalog-v2.d.ts +60 -9
  135. package/dist/registry-schema/catalog-v2.js +1 -1
  136. package/dist/search-result-provider.d.ts +95 -0
  137. package/dist/search-result-provider.js +42 -0
  138. package/dist/status-bar.svelte.d.ts +26 -20
  139. package/dist/status-bar.svelte.js +1 -0
  140. package/dist/storage/app-database.d.ts +6 -2
  141. package/dist/storage/app-database.js +41 -34
  142. package/dist/storage/desktop-native.d.ts +5 -3
  143. package/dist/storage/desktop-native.js +59 -6
  144. package/dist/storage/directory-watcher.d.ts +27 -0
  145. package/dist/storage/directory-watcher.js +201 -0
  146. package/dist/storage/fs.d.ts +14 -27
  147. package/dist/storage/fs.js +2 -168
  148. package/dist/storage/index-projection.js +33 -15
  149. package/dist/storage/memory-vault-adapter.d.ts +2 -0
  150. package/dist/storage/memory-vault-adapter.js +14 -1
  151. package/dist/storage/path.d.ts +6 -2
  152. package/dist/storage/path.js +8 -2
  153. package/dist/storage/projection-query-candidates.d.ts +3 -0
  154. package/dist/storage/projection-query-candidates.js +69 -0
  155. package/dist/storage/remote-app-database.d.ts +2 -2
  156. package/dist/storage/remote-app-database.js +1 -1
  157. package/dist/storage/runtime.d.ts +3 -0
  158. package/dist/storage/runtime.js +3 -0
  159. package/dist/storage/search-embedding-record.d.ts +3 -0
  160. package/dist/storage/search-embedding-record.js +18 -0
  161. package/dist/storage/turso-app-database.d.ts +2 -0
  162. package/dist/storage/turso-app-database.js +67 -30
  163. package/dist/storage/vault-listing.d.ts +3 -0
  164. package/dist/storage/vault-listing.js +36 -0
  165. package/dist/storage/vault-reconciliation.d.ts +19 -0
  166. package/dist/storage/vault-reconciliation.js +137 -0
  167. package/dist/storage/vault-session.d.ts +8 -0
  168. package/dist/storage/vault-session.js +10 -2
  169. package/dist/storage/vault.svelte.d.ts +53 -4
  170. package/dist/storage/vault.svelte.js +223 -87
  171. package/dist/sync-host.d.ts +12 -3
  172. package/dist/sync-host.js +5 -1
  173. package/dist/vault-change-views.d.ts +4 -0
  174. package/dist/vault-change-views.js +43 -0
  175. package/dist/vault-changes.d.ts +37 -0
  176. package/dist/vault-changes.js +228 -0
  177. package/dist/view.svelte.d.ts +182 -149
  178. package/dist/view.svelte.js +11 -2
  179. package/dist/workspace-close-guard.d.ts +3 -0
  180. package/dist/workspace-close-guard.js +35 -0
  181. package/dist/workspace-host-internal.js +10 -2
  182. package/dist/workspace-layout-normalizer.d.ts +4 -2
  183. package/dist/workspace-layout-normalizer.js +5 -5
  184. package/dist/workspace-view-document.d.ts +3 -0
  185. package/dist/workspace-view-document.js +12 -0
  186. package/dist/workspace.svelte.d.ts +13 -2
  187. package/dist/workspace.svelte.js +371 -82
  188. package/package.json +45 -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 = "plugin-save" | "configuration-update" | "external-reload";
5
+ type PluginDataUpdateOrigin =
6
+ | "plugin-save"
7
+ | "configuration-update"
8
+ | "external-reload";
6
9
  type PluginDataUpdateEvent = {
7
- pluginId: string;
8
- value: any;
9
- prev: any;
10
- origin: PluginDataUpdateOrigin;
10
+ pluginId: string;
11
+ value: any;
12
+ prev: any;
13
+ origin: PluginDataUpdateOrigin;
11
14
  };
12
15
  export type StringType = {
13
- type: "string";
14
- editPresentation?: "multilineText";
15
- format?: string;
16
- optionsSource?: string;
17
- allowUnknownOptions?: boolean;
18
- default?: string;
19
- title?: string;
20
- description?: string;
21
- markdownDescription?: string;
22
- order?: number;
23
- deprecationMessage?: string;
24
- markdownDeprecationMessage?: string;
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
- type: "number";
28
- order?: number;
29
- default?: number;
30
- minimum?: number;
31
- maximum?: number;
32
- step?: number;
33
- title?: string;
34
- description?: string;
35
- markdownDescription?: string;
36
- deprecationMessage?: string;
37
- markdownDeprecationMessage?: string;
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
- type: "integer";
41
- order?: number;
42
- default?: number;
43
- minimum?: number;
44
- maximum?: number;
45
- step?: number;
46
- title?: string;
47
- description?: string;
48
- markdownDescription?: string;
49
- deprecationMessage?: string;
50
- markdownDeprecationMessage?: string;
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
- type: "boolean";
54
- order?: number;
55
- default?: boolean;
56
- title?: string;
57
- description?: string;
58
- markdownDescription?: string;
59
- deprecationMessage?: string;
60
- markdownDeprecationMessage?: string;
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
- type: "string";
64
- order?: number;
65
- enum: string[];
66
- default?: string;
67
- title?: string;
68
- description?: string;
69
- markdownDescription?: string;
70
- enumDescriptions?: string[];
71
- enumMarkdownDescriptions?: string[];
72
- enumItemLabels?: string[];
73
- optionsSource?: string;
74
- allowUnknownOptions?: boolean;
75
- deprecationMessage?: string;
76
- markdownDeprecationMessage?: string;
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
- type: "array";
80
- order?: number;
81
- items: SchemaType;
82
- minItems?: number;
83
- maxItems?: number;
84
- default?: any[];
85
- title?: string;
86
- description?: string;
87
- markdownDescription?: string;
88
- deprecationMessage?: string;
89
- markdownDeprecationMessage?: string;
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
- type: "object";
93
- order?: number;
94
- title?: string;
95
- description?: string;
96
- markdownDescription?: string;
97
- properties: Record<string, SchemaType>;
98
- additionalProperties?: boolean | SchemaType;
99
- default?: Record<string, unknown>;
100
- deprecationMessage?: string;
101
- markdownDeprecationMessage?: string;
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
- type: "custom";
105
- component: SettingTab;
106
- title?: string;
107
- description?: string;
108
- markdownDescription?: string;
107
+ type: "custom";
108
+ component: SettingTab;
109
+ title?: string;
110
+ description?: string;
111
+ markdownDescription?: string;
109
112
  };
110
- export type SchemaType = StringType | NumberType | IntegerType | EnumType | BooleanType | ObjectType | CustomType | ArrayType;
111
- export declare function isFlatPrimitiveObjectSchema(schema: ObjectType): boolean;
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<z.ZodString, z.ZodLazy<z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>>>;
120
- }, "strip", z.ZodTypeAny, {
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
- export declare const configType: z.ZodLazy<z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>>;
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<[z.ZodObject<{
136
- id: z.ZodOptional<z.ZodString>;
137
- $schema: z.ZodOptional<z.ZodString>;
138
- title: z.ZodString;
139
- type: z.ZodLiteral<"object">;
140
- properties: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>>>;
141
- }, "strip", z.ZodTypeAny, {
142
- title: string;
143
- type: "object";
144
- properties: Record<string, SchemaType>;
145
- id?: string | undefined;
146
- $schema?: string | undefined;
147
- }, {
148
- title: string;
149
- type: "object";
150
- properties: Record<string, SchemaType>;
151
- id?: string | undefined;
152
- $schema?: string | undefined;
153
- }>, z.ZodArray<z.ZodObject<{
154
- id: z.ZodOptional<z.ZodString>;
155
- $schema: z.ZodOptional<z.ZodString>;
156
- title: z.ZodString;
157
- type: z.ZodLiteral<"object">;
158
- properties: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodType<SchemaType, z.ZodTypeDef, SchemaType>>>;
159
- }, "strip", z.ZodTypeAny, {
160
- title: string;
161
- type: "object";
162
- properties: Record<string, SchemaType>;
163
- id?: string | undefined;
164
- $schema?: string | undefined;
165
- }, {
166
- title: string;
167
- type: "object";
168
- properties: Record<string, SchemaType>;
169
- id?: string | undefined;
170
- $schema?: string | undefined;
171
- }>, "many">]>;
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
- id: string;
175
- title: string;
176
- description?: string;
177
- markdownDescription?: string;
224
+ id: string;
225
+ title: string;
226
+ description?: string;
227
+ markdownDescription?: string;
178
228
  };
179
229
  export interface WorkspaceConfiguration {
180
- has(key: string): boolean;
181
- get<T>(key: string, defaultValue?: T): T;
182
- update(key: string, value: any): Promise<void>;
183
- entries<T>(): [string, T][];
184
- values<T>(): T[];
185
- keys(): string[];
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
- configId: string;
189
- category: string;
190
- categoryId: string;
191
- groupPath?: ConfigurationGroupType[];
238
+ configId: string;
239
+ category: string;
240
+ categoryId: string;
241
+ groupPath?: ConfigurationGroupType[];
192
242
  };
193
243
  export declare class ConfigurationSchema extends EventDispatcher<{
194
- updated: [{
195
- key: string;
196
- value: any;
197
- prev?: any;
198
- }];
244
+ updated: [
245
+ {
246
+ key: string;
247
+ value: any;
248
+ prev?: any;
249
+ },
250
+ ];
199
251
  }> {
200
- private values;
201
- constructor();
202
- getConfiguration(section?: string): WorkspaceConfiguration;
203
- getDefinition(key: string): ConfigurationSchemaType | undefined;
204
- validateConfigurationOption(key: string, value: unknown): unknown;
205
- getDefaultEntries(): [string, unknown][];
206
- register(...schemas: any[]): void;
207
- unregister(...schemas: any[]): void;
208
- removeWebView(id: string): void;
209
- registerWebView(id: string, title: string, component: SettingTab): void;
210
- updateConfigurationOption(key: string, value: any): Promise<void>;
211
- removeConfigurationOption(key: string): Promise<void>;
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
- updated: [{
215
- key: string;
216
- value: any;
217
- prev: any;
218
- }];
219
- "plugin-data-updated": [event: PluginDataUpdateEvent];
266
+ updated: [
267
+ {
268
+ key: string;
269
+ value: any;
270
+ prev: any;
271
+ },
272
+ ];
273
+ "plugin-data-updated": [event: PluginDataUpdateEvent];
220
274
  }> {
221
- readonly app: App;
222
- readonly basePath: string;
223
- private values;
224
- readonly schema: ConfigurationSchema;
225
- constructor(app: App, basePath: string);
226
- load(): Promise<void>;
227
- hasPluginData(pluginId: string): boolean;
228
- getPluginData<T = any>(pluginId: string): T | null;
229
- updatePluginData(pluginId: string, value: any, options?: {
230
- origin?: PluginDataUpdateOrigin;
231
- }): Promise<void>;
232
- removePluginData(pluginId: string, options?: {
233
- origin?: PluginDataUpdateOrigin;
234
- }): Promise<void>;
235
- reloadFromDisk(options?: {
236
- emitPluginDataEvents?: boolean;
237
- origin?: PluginDataUpdateOrigin;
238
- }): Promise<void>;
239
- getConfiguration(section?: string): WorkspaceConfiguration;
240
- updateConfigurationOption(key: string, value: any): Promise<void>;
241
- /**
242
- * Validate and persist a set of flat configuration keys as one update.
243
- *
244
- * Validation and the vault write both complete before observable state or
245
- * update events change, so consumers never see a partially applied batch.
246
- *
247
- * @public
248
- */
249
- updateConfigurationOptions(changes: Readonly<Record<string, any>>): Promise<void>;
250
- removeConfigurationOption(key: string): Promise<void>;
251
- private persist;
252
- private getPluginDataStore;
253
- private readValuesFromDisk;
254
- private emitPluginDataDiffs;
255
- private watchExternalConfigChanges;
256
- materializeSchemaDefaults(): Promise<void>;
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 {};