@kitionstage/sdk 0.0.0-stage → 0.5.2-stage.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +73 -2
  2. package/dist/LICENSE +177 -0
  3. package/dist/THIRD_PARTY_NOTICES +28 -0
  4. package/dist/lib/assets/kitEngine.worker-3iMvwtlI.js +12732 -0
  5. package/dist/lib/assets/loro_wasm_bg-Gulzks_0.wasm +0 -0
  6. package/dist/lib/chunks/batch-BWpAyHvP.js +789 -0
  7. package/dist/lib/chunks/canonical-BIWfVCL-.js +87 -0
  8. package/dist/lib/chunks/envelope-D6MGY-ZN.js +61 -0
  9. package/dist/lib/chunks/replica-D8w3I4sn.js +2472 -0
  10. package/dist/lib/chunks/runtime-BVJHE1Pg.js +997 -0
  11. package/dist/lib/chunks/session-BqXC9a1-.js +281 -0
  12. package/dist/lib/chunks/toolIds-BCeSGHpV.js +821 -0
  13. package/dist/lib/chunks/workspaceTree-Destqupf.js +23 -0
  14. package/dist/lib/convergence/index.js +1035 -0
  15. package/dist/lib/convergence/node.js +8 -0
  16. package/dist/lib/embed-server/callbacks.js +37 -0
  17. package/dist/lib/embed-server/cli.js +19 -0
  18. package/dist/lib/embed-server/index.js +272 -0
  19. package/dist/lib/extensions/index.js +439 -0
  20. package/dist/lib/extensions/panel.html +208 -0
  21. package/dist/lib/extensions/runtime.js +198 -0
  22. package/dist/lib/extensions/sandbox.html +35 -0
  23. package/dist/lib/kdm/index.js +437 -0
  24. package/dist/lib/kit-dev-host/checkUiIds.mjs +44 -0
  25. package/dist/lib/kit-dev-host/index.js +308 -0
  26. package/dist/lib/kit-dev-host/lineRow.mjs +47 -0
  27. package/dist/lib/kit-dev-host/modeSmoke.mjs +178 -0
  28. package/dist/lib/kit-editor/index.js +6481 -0
  29. package/dist/lib/kit-editor/styles.css +807 -0
  30. package/dist/lib/kit-editor/workspaceTree.js +1 -0
  31. package/dist/lib/kit-engine/index.js +7 -0
  32. package/dist/lib/kit-host/index.js +530 -0
  33. package/dist/lib/kit-ui-protocol/index.js +336 -0
  34. package/dist/lib/node-only/embed-server-callbacks.js +2 -0
  35. package/dist/lib/node-only/embed-server.js +2 -0
  36. package/dist/lib/sync/index.js +1008 -0
  37. package/dist/lib/sync/openToken.js +201 -0
  38. package/dist/lib/sync/replicaVersions.js +51 -0
  39. package/dist/standalone/chunks/batch-CAGYk6m4.js +789 -0
  40. package/dist/standalone/chunks/client-B9xkOcvf.js +772 -0
  41. package/dist/standalone/chunks/collab-CTQZ9h7J.js +1022 -0
  42. package/dist/standalone/chunks/comment-Ds9t8xSE.js +94 -0
  43. package/dist/standalone/chunks/comments-uVDS8Wxp.js +41 -0
  44. package/dist/standalone/chunks/document-B5MMuYyN.js +324 -0
  45. package/dist/standalone/chunks/envelope-GX4Cynkx.js +7612 -0
  46. package/dist/standalone/chunks/index-BEgEEnhU.js +287 -0
  47. package/dist/standalone/chunks/index-EEl8hGbP.js +1967 -0
  48. package/dist/standalone/chunks/kits-Cp51mDlw.js +9 -0
  49. package/dist/standalone/chunks/replica-Di2iCPiD.js +3281 -0
  50. package/dist/standalone/chunks/replicaVersions-C3rJxnk9.js +50 -0
  51. package/dist/standalone/chunks/touched-T9jKJjxn.js +78 -0
  52. package/dist/standalone/index.js +12 -0
  53. package/dist/standalone/script/index.js +339 -0
  54. package/dist/standalone/script/kits/board.js +5 -0
  55. package/dist/standalone/script/kits/cad.js +5 -0
  56. package/dist/standalone/script/kits/design.js +5 -0
  57. package/dist/standalone/script/kits/doc.js +5 -0
  58. package/dist/standalone/script/kits/film.js +5 -0
  59. package/dist/standalone/script/kits/html.js +5 -0
  60. package/dist/standalone/script/kits/index.js +38 -0
  61. package/dist/standalone/script/kits/layout.js +5 -0
  62. package/dist/standalone/script/kits/motion.js +5 -0
  63. package/dist/standalone/script/kits/note.js +5 -0
  64. package/dist/standalone/script/kits/pdf.js +5 -0
  65. package/dist/standalone/script/kits/photo.js +5 -0
  66. package/dist/standalone/script/kits/scene.js +5 -0
  67. package/dist/standalone/script/kits/sheet.js +5 -0
  68. package/dist/standalone/script/kits/slide.js +5 -0
  69. package/dist/standalone/script/kits/table.js +5 -0
  70. package/dist/standalone/script/kits/vector.js +5 -0
  71. package/dist/standalone/script/node.js +401 -0
  72. package/dist/standalone/script/proxy.js +254 -0
  73. package/dist/types/convergence/src/adapter.d.ts +131 -0
  74. package/dist/types/convergence/src/engine.d.ts +66 -0
  75. package/dist/types/convergence/src/index.d.ts +21 -0
  76. package/dist/types/convergence/src/net.d.ts +52 -0
  77. package/dist/types/convergence/src/node.d.ts +6 -0
  78. package/dist/types/convergence/src/report.d.ts +56 -0
  79. package/dist/types/convergence/src/rng.d.ts +12 -0
  80. package/dist/types/convergence/src/scenarios.d.ts +15 -0
  81. package/dist/types/convergence/src/state.d.ts +67 -0
  82. package/dist/types/embed/src/agent.d.ts +88 -0
  83. package/dist/types/embed/src/blobs.d.ts +2 -0
  84. package/dist/types/embed/src/collab.d.ts +250 -0
  85. package/dist/types/embed/src/comments.d.ts +30 -0
  86. package/dist/types/embed/src/errors.d.ts +24 -0
  87. package/dist/types/embed/src/handlers.d.ts +92 -0
  88. package/dist/types/embed/src/index.d.ts +20 -0
  89. package/dist/types/embed/src/mount.d.ts +39 -0
  90. package/dist/types/embed/src/replicaStore.d.ts +3 -0
  91. package/dist/types/embed/src/rooms.d.ts +40 -0
  92. package/dist/types/embed/src/schemas.d.ts +7 -0
  93. package/dist/types/embed/src/syncClients.d.ts +28 -0
  94. package/dist/types/embed/src/theme.d.ts +7 -0
  95. package/dist/types/embed/src/types.d.ts +596 -0
  96. package/dist/types/embed/src/ui.d.ts +33 -0
  97. package/dist/types/embed/src/version.d.ts +2 -0
  98. package/dist/types/embed-server/src/callbacks.d.ts +30 -0
  99. package/dist/types/embed-server/src/cli.d.ts +1 -0
  100. package/dist/types/embed-server/src/index.d.ts +19 -0
  101. package/dist/types/embed-server/src/page.d.ts +15 -0
  102. package/dist/types/embed-server/src/server.d.ts +39 -0
  103. package/dist/types/embed-server/src/session.d.ts +22 -0
  104. package/dist/types/extensions/src/gate.d.ts +17 -0
  105. package/dist/types/extensions/src/generated/runtime.d.ts +8 -0
  106. package/dist/types/extensions/src/host.d.ts +135 -0
  107. package/dist/types/extensions/src/index.d.ts +13 -0
  108. package/dist/types/extensions/src/manifest.d.ts +82 -0
  109. package/dist/types/extensions/src/protocol.d.ts +159 -0
  110. package/dist/types/extensions/src/rpc.d.ts +52 -0
  111. package/dist/types/extensions/src/runtime/document.d.ts +40 -0
  112. package/dist/types/extensions/src/runtime/index.d.ts +10 -0
  113. package/dist/types/extensions/src/runtime/panel.d.ts +19 -0
  114. package/dist/types/extensions/src/runtime/runtime.d.ts +54 -0
  115. package/dist/types/extensions/src/runtime/worker.d.ts +1 -0
  116. package/dist/types/extensions/src/sandbox.d.ts +41 -0
  117. package/dist/types/kdm/src/args.d.ts +12 -0
  118. package/dist/types/kdm/src/batch.d.ts +118 -0
  119. package/dist/types/kdm/src/canonical.d.ts +25 -0
  120. package/dist/types/kdm/src/comment.d.ts +114 -0
  121. package/dist/types/kdm/src/diff.d.ts +125 -0
  122. package/dist/types/kdm/src/envelope.d.ts +27 -0
  123. package/dist/types/kdm/src/errors.d.ts +28 -0
  124. package/dist/types/kdm/src/footprint.d.ts +21 -0
  125. package/dist/types/kdm/src/ids.d.ts +57 -0
  126. package/dist/types/kdm/src/index.d.ts +18 -0
  127. package/dist/types/kdm/src/marks.d.ts +32 -0
  128. package/dist/types/kdm/src/op.d.ts +124 -0
  129. package/dist/types/kdm/src/origin.d.ts +41 -0
  130. package/dist/types/kdm/src/overlay.d.ts +92 -0
  131. package/dist/types/kdm/src/projection.d.ts +29 -0
  132. package/dist/types/kdm/src/read.d.ts +90 -0
  133. package/dist/types/kdm/src/replica.d.ts +403 -0
  134. package/dist/types/kdm/src/schema.d.ts +185 -0
  135. package/dist/types/kdm/src/testing.d.ts +28 -0
  136. package/dist/types/kdm/src/toolIds.d.ts +61 -0
  137. package/dist/types/kdm/src/touched.d.ts +24 -0
  138. package/dist/types/kdm/src/tx.d.ts +215 -0
  139. package/dist/types/kdm/src/value.d.ts +23 -0
  140. package/dist/types/kit-dev-host/src/checkNoPaths.d.ts +19 -0
  141. package/dist/types/kit-dev-host/src/checkUiIds.d.mts +2 -0
  142. package/dist/types/kit-dev-host/src/index.d.ts +179 -0
  143. package/dist/types/kit-dev-host/src/lineRow.d.mts +14 -0
  144. package/dist/types/kit-dev-host/src/memoryFiles.d.ts +15 -0
  145. package/dist/types/kit-dev-host/src/modeSmoke.d.mts +8 -0
  146. package/dist/types/kit-editor/src/CommandDialog.d.ts +22 -0
  147. package/dist/types/kit-editor/src/CommentsPanel.d.ts +45 -0
  148. package/dist/types/kit-editor/src/CustomizeDialog.d.ts +32 -0
  149. package/dist/types/kit-editor/src/HostButtons.d.ts +11 -0
  150. package/dist/types/kit-editor/src/RenderFailure.d.ts +7 -0
  151. package/dist/types/kit-editor/src/TextSink.d.ts +6 -0
  152. package/dist/types/kit-editor/src/brand.d.ts +2 -0
  153. package/dist/types/kit-editor/src/catalogMenus.d.ts +27 -0
  154. package/dist/types/kit-editor/src/chart.d.ts +138 -0
  155. package/dist/types/kit-editor/src/conflicts.d.ts +12 -0
  156. package/dist/types/kit-editor/src/drawing.d.ts +83 -0
  157. package/dist/types/kit-editor/src/editor.d.ts +544 -0
  158. package/dist/types/kit-editor/src/engine/KitCanvas.d.ts +70 -0
  159. package/dist/types/kit-editor/src/engine/backdrop.d.ts +32 -0
  160. package/dist/types/kit-editor/src/engine/createKitFile.d.ts +12 -0
  161. package/dist/types/kit-editor/src/engine/decorations.d.ts +14 -0
  162. package/dist/types/kit-editor/src/engine/engineOverlays.d.ts +197 -0
  163. package/dist/types/kit-editor/src/engine/engineTools.d.ts +116 -0
  164. package/dist/types/kit-editor/src/engine/kitDraft.d.ts +70 -0
  165. package/dist/types/kit-editor/src/engine/kitEngine.d.ts +390 -0
  166. package/dist/types/kit-editor/src/engine/kitEngine.worker.d.ts +30 -0
  167. package/dist/types/kit-editor/src/engine/kitHost.d.ts +41 -0
  168. package/dist/types/kit-editor/src/engine/kitModel.d.ts +32 -0
  169. package/dist/types/kit-editor/src/engine/kitModelRunner.d.ts +99 -0
  170. package/dist/types/kit-editor/src/engine/kitModule.d.ts +185 -0
  171. package/dist/types/kit-editor/src/engine/kitShortcuts.d.ts +32 -0
  172. package/dist/types/kit-editor/src/engine/kitTools.d.ts +79 -0
  173. package/dist/types/kit-editor/src/engine/lazyFonts.d.ts +34 -0
  174. package/dist/types/kit-editor/src/engine/lentFiles.d.ts +29 -0
  175. package/dist/types/kit-editor/src/engine/rasterViewport.d.ts +178 -0
  176. package/dist/types/kit-editor/src/engine/readOnly.d.ts +78 -0
  177. package/dist/types/kit-editor/src/engine/refusal.d.ts +39 -0
  178. package/dist/types/kit-editor/src/engine/replica.d.ts +23 -0
  179. package/dist/types/kit-editor/src/engine/useKitDocument.d.ts +154 -0
  180. package/dist/types/kit-editor/src/engine/workerRelay.d.ts +62 -0
  181. package/dist/types/kit-editor/src/files.d.ts +74 -0
  182. package/dist/types/kit-editor/src/frame/EditorFrame.d.ts +74 -0
  183. package/dist/types/kit-editor/src/frame/FocusBar.d.ts +10 -0
  184. package/dist/types/kit-editor/src/frame/MenuNodes.d.ts +20 -0
  185. package/dist/types/kit-editor/src/frame/MenuRibbon.d.ts +8 -0
  186. package/dist/types/kit-editor/src/frame/ModeButton.d.ts +7 -0
  187. package/dist/types/kit-editor/src/frame/menus.d.ts +64 -0
  188. package/dist/types/kit-editor/src/frame/modes.d.ts +51 -0
  189. package/dist/types/kit-editor/src/frame/useFrameLayout.d.ts +34 -0
  190. package/dist/types/kit-editor/src/host.d.ts +127 -0
  191. package/dist/types/kit-editor/src/index.d.ts +85 -0
  192. package/dist/types/kit-editor/src/ink.d.ts +26 -0
  193. package/dist/types/kit-editor/src/lease.d.ts +53 -0
  194. package/dist/types/kit-editor/src/oneInFlight.d.ts +7 -0
  195. package/dist/types/kit-editor/src/phrases.d.ts +25 -0
  196. package/dist/types/kit-editor/src/presence.d.ts +79 -0
  197. package/dist/types/kit-editor/src/strings.d.ts +6 -0
  198. package/dist/types/kit-editor/src/toolIcons.d.ts +32 -0
  199. package/dist/types/kit-editor/src/uiCatalog.d.ts +59 -0
  200. package/dist/types/kit-editor/src/uiConfig.d.ts +53 -0
  201. package/dist/types/kit-editor/src/uiContext.d.ts +65 -0
  202. package/dist/types/kit-editor/src/uiStore.d.ts +20 -0
  203. package/dist/types/kit-editor/src/useCommentAnchors.d.ts +29 -0
  204. package/dist/types/kit-editor/src/useKitSession.d.ts +115 -0
  205. package/dist/types/kit-editor/src/workspaceTree.d.ts +5 -0
  206. package/dist/types/kit-engine/src/contract.d.ts +154 -0
  207. package/dist/types/kit-engine/src/index.d.ts +2 -0
  208. package/dist/types/kit-engine/src/session.d.ts +133 -0
  209. package/dist/types/kit-host/src/files.d.ts +163 -0
  210. package/dist/types/kit-host/src/index.d.ts +315 -0
  211. package/dist/types/kit-ui-protocol/src/index.d.ts +1145 -0
  212. package/dist/types/loro-crdt.d.ts +9 -0
  213. package/dist/types/script/kits/board.d.ts +534 -0
  214. package/dist/types/script/kits/cad.d.ts +2937 -0
  215. package/dist/types/script/kits/design.d.ts +3213 -0
  216. package/dist/types/script/kits/doc.d.ts +2575 -0
  217. package/dist/types/script/kits/film.d.ts +4067 -0
  218. package/dist/types/script/kits/html.d.ts +38 -0
  219. package/dist/types/script/kits/index.d.ts +20 -0
  220. package/dist/types/script/kits/layout.d.ts +3483 -0
  221. package/dist/types/script/kits/motion.d.ts +4826 -0
  222. package/dist/types/script/kits/note.d.ts +631 -0
  223. package/dist/types/script/kits/pdf.d.ts +829 -0
  224. package/dist/types/script/kits/photo.d.ts +7574 -0
  225. package/dist/types/script/kits/scene.d.ts +2962 -0
  226. package/dist/types/script/kits/sheet.d.ts +2419 -0
  227. package/dist/types/script/kits/slide.d.ts +1894 -0
  228. package/dist/types/script/kits/table.d.ts +654 -0
  229. package/dist/types/script/kits/vector.d.ts +5167 -0
  230. package/dist/types/script/src/agentRelay.d.ts +48 -0
  231. package/dist/types/script/src/capabilities.d.ts +21 -0
  232. package/dist/types/script/src/document.d.ts +87 -0
  233. package/dist/types/script/src/drafts.d.ts +141 -0
  234. package/dist/types/script/src/exchange.d.ts +30 -0
  235. package/dist/types/script/src/headless.d.ts +190 -0
  236. package/dist/types/script/src/index.d.ts +15 -0
  237. package/dist/types/script/src/kitModel.d.ts +17 -0
  238. package/dist/types/script/src/kits.d.ts +8 -0
  239. package/dist/types/script/src/node.d.ts +42 -0
  240. package/dist/types/script/src/port.d.ts +89 -0
  241. package/dist/types/script/src/proxy.d.ts +132 -0
  242. package/dist/types/script/src/room.d.ts +162 -0
  243. package/dist/types/script/src/sources.d.ts +73 -0
  244. package/dist/types/sync/src/backoff.d.ts +9 -0
  245. package/dist/types/sync/src/blobSection.d.ts +23 -0
  246. package/dist/types/sync/src/capabilities.d.ts +20 -0
  247. package/dist/types/sync/src/client.d.ts +253 -0
  248. package/dist/types/sync/src/framing.d.ts +35 -0
  249. package/dist/types/sync/src/hash.d.ts +2 -0
  250. package/dist/types/sync/src/index.d.ts +19 -0
  251. package/dist/types/sync/src/leases.d.ts +82 -0
  252. package/dist/types/sync/src/openToken.d.ts +104 -0
  253. package/dist/types/sync/src/protocol.d.ts +484 -0
  254. package/dist/types/sync/src/relay.d.ts +52 -0
  255. package/dist/types/sync/src/replicaVersions.d.ts +17 -0
  256. package/dist/types/sync/src/saveMachine.d.ts +83 -0
  257. package/dist/types/sync/src/saveRun.d.ts +52 -0
  258. package/dist/types/sync/src/transport.d.ts +19 -0
  259. package/package.json +229 -4
@@ -0,0 +1,631 @@
1
+ import type { CommandMap, ModelDocument, ModelList, ModelObject, ModelText, RequestContext } from '../src/index.js';
2
+ import { type KitDescriptor } from '../src/kits.js';
3
+ type Json = null | boolean | number | string | Json[] | {
4
+ [key: string]: Json;
5
+ };
6
+ /** kit.note: registered with @kition/sdk/script when this module loads. */
7
+ export declare const noteKit: KitDescriptor;
8
+ /** The fields a new `Note` takes (`list.add(fields)`). */
9
+ export type NoteFields = {
10
+ eol?: "lf" | "crlf" | "mixed" | null;
11
+ bom?: boolean | null;
12
+ };
13
+ /** A `Note` of kit.note. */
14
+ export interface Note extends ModelObject {
15
+ get body(): ModelText;
16
+ set body(value: string);
17
+ eol: "lf" | "crlf" | "mixed" | null;
18
+ bom: boolean | null;
19
+ readonly sections: ModelList<Section, SectionFields>;
20
+ readonly tasks: ModelList<Task, TaskFields>;
21
+ readonly tables: ModelList<Table, TableFields>;
22
+ readonly links: ModelList<Link, LinkFields>;
23
+ readonly properties: ModelList<Property, PropertyFields>;
24
+ }
25
+ /** The fields a new `CommentThread` takes (`list.add(fields)`). */
26
+ export type CommentThreadFields = {
27
+ anchor: Json;
28
+ resolved?: boolean | null;
29
+ };
30
+ /** A `CommentThread` of kit.note. */
31
+ export interface CommentThread extends ModelObject {
32
+ anchor: Json;
33
+ resolved: boolean | null;
34
+ readonly comments: ModelList<Comment, CommentFields>;
35
+ }
36
+ /** The fields a new `Comment` takes (`list.add(fields)`). */
37
+ export type CommentFields = {
38
+ author: string;
39
+ name?: string | null;
40
+ created: string;
41
+ };
42
+ /** A `Comment` of kit.note. */
43
+ export interface Comment extends ModelObject {
44
+ author: string;
45
+ name: string | null;
46
+ get body(): ModelText;
47
+ set body(value: string);
48
+ created: string;
49
+ }
50
+ /** The fields a new `Section` takes (`list.add(fields)`). */
51
+ export type SectionFields = {
52
+ level: number;
53
+ };
54
+ /** A `Section` of kit.note. */
55
+ export interface Section extends ModelObject {
56
+ /** Read-only: the kit keeps it as it is. */
57
+ readonly number: string;
58
+ /** Read-only: the kit keeps it as it is. */
59
+ readonly heading: string;
60
+ /** Read-only: the kit keeps it as it is. */
61
+ readonly path: string;
62
+ level: number;
63
+ /** Read-only: the kit keeps it as it is. */
64
+ readonly body: string;
65
+ readonly sections: ModelList<Section, SectionFields>;
66
+ readonly tasks: ModelList<Task, TaskFields>;
67
+ readonly tables: ModelList<Table, TableFields>;
68
+ readonly links: ModelList<Link, LinkFields>;
69
+ }
70
+ /** The fields a new `Task` takes (`list.add(fields)`). */
71
+ export type TaskFields = {
72
+ checked: boolean;
73
+ };
74
+ /** A `Task` of kit.note. */
75
+ export interface Task extends ModelObject {
76
+ /** Read-only: the kit keeps it as it is. */
77
+ readonly number: string;
78
+ /** Read-only: the kit keeps it as it is. */
79
+ readonly text: string;
80
+ checked: boolean;
81
+ }
82
+ /** The fields a new `Table` takes (`list.add(fields)`). */
83
+ export type TableFields = {};
84
+ /** A `Table` of kit.note. */
85
+ export interface Table extends ModelObject {
86
+ /** Read-only: the kit keeps it as it is. */
87
+ readonly number: string;
88
+ /** Read-only: the kit keeps it as it is. */
89
+ readonly header: string;
90
+ /** Read-only: the kit keeps it as it is. */
91
+ readonly rows: number;
92
+ /** Read-only: the kit keeps it as it is. */
93
+ readonly columns: number;
94
+ /** Read-only: the kit keeps it as it is. */
95
+ readonly text: string;
96
+ }
97
+ /** The fields a new `Link` takes (`list.add(fields)`). */
98
+ export type LinkFields = {};
99
+ /** A `Link` of kit.note. */
100
+ export interface Link extends ModelObject {
101
+ /** Read-only: the kit keeps it as it is. */
102
+ readonly number: string;
103
+ /** Read-only: the kit keeps it as it is. */
104
+ readonly destination: string;
105
+ }
106
+ /** The fields a new `Property` takes (`list.add(fields)`). */
107
+ export type PropertyFields = {};
108
+ /** A `Property` of kit.note. */
109
+ export interface Property extends ModelObject {
110
+ /** Read-only: the kit keeps it as it is. */
111
+ readonly number: string;
112
+ /** Read-only: the kit keeps it as it is. */
113
+ readonly key: string;
114
+ /** Read-only: the kit keeps it as it is. */
115
+ readonly value: string;
116
+ }
117
+ /** Every command of kit.note, by id, with its parameters. */
118
+ export interface NoteCommands extends CommandMap {
119
+ /** Read the text. Answers the note's raw Markdown (front matter included) and its length, or only the part between `from` and `to` (text positions from 0). Use it to read exact text before editing by position. Params: { from?: number, to?: number, unit?: "scalar" | "utf16" } (the whole text by default). */
120
+ "text.read": {
121
+ from?: number; /** Where to stop (exclusive); the end by default. */
122
+ to?: number; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
123
+ unit?: "scalar" | "utf16";
124
+ };
125
+ /** Read the outline. Lists the headings with their level, line (from 1), heading path, section range and word count, a page at a time (`limit`, then `cursor` from `next`). Use it to find the path or line that section commands take. Params: { limit?: number, cursor?: string }. */
126
+ "outline.read": {
127
+ cursor?: string; /** The most headings to answer (default 200, at most 1000). */
128
+ limit?: number;
129
+ };
130
+ /** List the note's objects and their ids. Lists the note's sections, tasks, tables, properties and links with the ids this session gives them (`section:3`, `task:2`), their label and first line, in document order by kind; `kinds` limits the list. Section commands take a section's id as `section`, `task.toggle` a task's as `task`, and receipts and `others` name what changed by these ids. An id follows its object through edits (a section renamed or moved keeps it) while the note stays open; it is never written into the file. Params: { kinds?: ("section" | "task" | "table" | "property" | "link")[] }. */
131
+ "projection.read": {
132
+ kinds?: Array<"section" | "task" | "table" | "property" | "link">;
133
+ };
134
+ /** Read a section. Answers the Markdown of one section (the heading and everything under it), picked by heading path or line, with its range and first line; `withHeading: false` leaves the heading line out. Params: { heading?: string[], line?: number, section?: string, withHeading?: boolean, unit?: "scalar" | "utf16" }. */
135
+ "section.read": {
136
+ heading?: Array<string>; /** The heading's line, from 1, instead of heading. */
137
+ line?: number; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
138
+ section?: string; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
139
+ unit?: "scalar" | "utf16"; /** Include the heading line. */
140
+ withHeading?: boolean;
141
+ };
142
+ /** Read a block. Answers the Markdown of the block carrying the block id `blockId` (`^id`), with its range and first line. Params: { blockId: string, unit?: "scalar" | "utf16" }. */
143
+ "block.read": {
144
+ blockId: string; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
145
+ unit?: "scalar" | "utf16";
146
+ };
147
+ /** List the properties. Lists the front-matter properties with key, value, type, writing style and lines, and reports duplicated keys and YAML it cannot read. Use it before `property.set`, `property.delete` or `property.rename`. Params: {}. */
148
+ "property.list": Record<string, never>;
149
+ /** Read a table. Answers one table (`table`, from 0) as its header, body rows, column alignment and lines; without `table` it answers how many tables the note has and where each is. Params: { table?: number } (without table: how many tables there are). */
150
+ "table.read": {
151
+ table?: number;
152
+ };
153
+ /** List links, tags and block ids. Lists the note's wikilinks, Markdown links, embeds, images, URLs, tags and block ids with their line and, for links, whether the target exists; `kinds` limits the list. Params: { kinds?: ("wikilink" | "markdown" | "embed" | "image" | "url" | "tag" | "blockId")[] }. */
154
+ "links.list": {
155
+ kinds?: Array<"wikilink" | "markdown" | "embed" | "image" | "url" | "tag" | "blockId">;
156
+ };
157
+ /** List tasks. Lists the task items (`- [ ]`, `- [x]`) with line, text, done and block id, in the whole note or one section. Use it to get the line `task.toggle` takes. Params: { heading?: string[], line?: number, section?: string } (all tasks by default). */
158
+ "tasks.list": {
159
+ heading?: Array<string>; /** The heading's line, from 1, instead of heading. */
160
+ line?: number; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
161
+ section?: string;
162
+ };
163
+ /** Find text. Finds text (or a regular expression with `regex: true`) in the note's body (the front matter is not searched: read properties with `property.list`) and answers each match's `from`, `to`, line and text. The way to get text positions for `text.insert`, `text.replace` and `comment.add`. Params: { find: string, regex?: boolean, caseSensitive?: boolean, unit?: "scalar" | "utf16", limit?: number }. */
164
+ "text.find": {
165
+ caseSensitive?: boolean; /** The text, or a regular expression with regex. */
166
+ find: string; /** The most matches to answer (default 100). */
167
+ limit?: number; /** Read find as a regular expression (Rust syntax). */
168
+ regex?: boolean; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
169
+ unit?: "scalar" | "utf16";
170
+ };
171
+ /** Read the page layout. Answers how the note prints on `letter` or `a4` pages: the page count, where each block lands (page, x, y, width, height in points), blocks too wide for the column, and what the pages cannot draw. Use it to check page breaks before exporting a PDF. Params: { pageSize?: "letter" | "a4", page?: number } (every page by default). */
172
+ "page.layout": {
173
+ page?: number; /** The page size. */
174
+ pageSize?: "letter" | "a4";
175
+ };
176
+ /** Export. Writes the note as a standalone HTML file (the reading view with its stylesheet; `standalone: false` only the `<main>` element) or prints it to a PDF on `letter` or `a4` pages, and answers the file as base64 `data` with its size, a file name and, for a PDF, its page count and what the pages could not draw. Does not change the note. Params: { format: "html" | "pdf", standalone?: boolean, pageSize?: "letter" | "a4" }. */
177
+ "file.export": {
178
+ format: "html" | "pdf"; /** PDF: the page size. */
179
+ pageSize?: "letter" | "a4"; /** HTML: a whole file with its stylesheet; false writes the <main> element only. */
180
+ standalone?: boolean;
181
+ };
182
+ /** List comment threads. Lists the comment threads with their comments, resolved state, and the text each is anchored to with where it is now (or that it is gone). Use it to get the thread ids the other comment commands take. Params: { unit?: "scalar" | "utf16" }. */
183
+ "comment.threads": {
184
+ unit?: "scalar" | "utf16";
185
+ };
186
+ /** Expand a template. Answers `markdown` with the template variables (`{{title}}`, `{{date}}`, `{{time}}`, `{{date:FORMAT}}`) filled in, without changing the note; pass the result to `note.write` or `section.insert`. Params: { markdown: string, title?: string, date?: string }. */
187
+ "template.expand": {
188
+ date?: string; /** Template text with {{title}}, {{date}}, {{time}} and {{date:FORMAT}} (YYYY, MM, DD, HH, mm, ss). */
189
+ markdown: string; /** What {{title}} becomes. */
190
+ title?: string;
191
+ };
192
+ /** Insert text. Inserts `text` at a text position (from 0) and answers the note's new length. Get positions from `text.find`; inserting at 0 puts text above the front matter. Params: { at: number, text: string, unit?: "scalar" | "utf16", expected?: string }. Changes the document. */
193
+ "text.insert": {
194
+ at: number; /** What the empty range at `at` holds: ""; any other text fails the insert. */
195
+ expected?: string; /** The Markdown to insert. */
196
+ text: string; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
197
+ unit?: "scalar" | "utf16";
198
+ };
199
+ /** Delete text. Deletes the text between `from` and `to` and answers the note's new length; pass `expected` (the text you mean to delete) so a stale position fails instead of deleting the wrong text. Params: { from: number, to: number, unit?: "scalar" | "utf16", expected?: string }. Changes the document. */
200
+ "text.delete": {
201
+ expected?: string; /** Where the range starts. */
202
+ from: number; /** Where the range ends (exclusive). */
203
+ to: number; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
204
+ unit?: "scalar" | "utf16";
205
+ };
206
+ /** Replace text. Replaces the text between `from` and `to` with `text` and answers the note's new length; pass `expected` with the current text so a stale range fails. Params: { from: number, to: number, text: string, unit?: "scalar" | "utf16", expected?: string }. Changes the document. */
207
+ "text.replace": {
208
+ expected?: string; /** Where the range starts. */
209
+ from: number; /** The Markdown to put there. */
210
+ text: string; /** Where the range ends (exclusive). */
211
+ to: number; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
212
+ unit?: "scalar" | "utf16";
213
+ };
214
+ /** Find and replace. Replaces matches of `find` in the note's body with `replace` (matches in the front matter are not counted: change properties with `property.set`): the first by default, the n-th with `occurrence`, or every one with `occurrence: "all"`; `regex` and `caseSensitive` as in `text.find`. Answers how many were replaced. Params: { find: string, replace: string, occurrence?: number | "all", regex?: boolean, caseSensitive?: boolean }. Changes the document. */
215
+ "text.findReplace": {
216
+ caseSensitive?: boolean; /** The text, or a regular expression with regex. */
217
+ find: string; /** Which match to replace: a number from 1, or "all"; 1 by default. */
218
+ occurrence?: Json; /** Read find as a regular expression (Rust syntax). */
219
+ regex?: boolean; /** The replacement; with regex, $1 names a group. */
220
+ replace: string;
221
+ };
222
+ /** Write the whole note. Replaces the whole note with `markdown` as one undo step, rewriting only the lines that differ. Use it to write a new note; prefer section, block and text commands to change part of one. Params: { markdown: string }. Changes the document. */
223
+ "note.write": {
224
+ markdown: string;
225
+ };
226
+ /** Replace a section. Replaces the body of the section at a heading path or line (subsections included) with `markdown`, keeping its heading unless `withHeading: true` (then `markdown` includes the heading). Params: { heading?: string[], line?: number, section?: string, markdown: string, withHeading?: boolean }. Changes the document. */
227
+ "section.replace": {
228
+ heading?: Array<string>; /** The heading's line, from 1, instead of heading. */
229
+ line?: number; /** The section's new Markdown. */
230
+ markdown: string; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
231
+ section?: string; /** Replace the heading line too. */
232
+ withHeading?: boolean;
233
+ };
234
+ /** Insert into a section. Inserts `markdown` as a new block before the heading, after the section and its subsections, right under the heading (`start`), or at the end of the section's own text before its subsections (`end`). Params: { heading?: string[], line?: number, section?: string, position: "before" | "after" | "start" | "end", markdown: string }. Changes the document. */
235
+ "section.insert": {
236
+ heading?: Array<string>; /** The heading's line, from 1, instead of heading. */
237
+ line?: number; /** The Markdown to insert. */
238
+ markdown: string; /** Before the heading, after the section, or inside it at its start or end. */
239
+ position: "before" | "after" | "start" | "end"; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
240
+ section?: string;
241
+ };
242
+ /** Delete a section. Deletes the section at a heading path or line: its heading and everything under it, subsections included. Params: { heading?: string[], line?: number, section?: string }. Changes the document. */
243
+ "section.delete": {
244
+ heading?: Array<string>; /** The heading's line, from 1, instead of heading. */
245
+ line?: number; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
246
+ section?: string;
247
+ };
248
+ /** Move a section. Moves the section at a heading path or line, with its subsections, before, after, or into the start or end of another section (`toHeading` or `toLine`); a section cannot move into itself. Params: { heading?: string[], line?: number, section?: string, toHeading?: string[], toLine?: number, toSection?: string, position: "before" | "after" | "start" | "end" }. Changes the document. */
249
+ "section.move": {
250
+ heading?: Array<string>; /** The heading's line, from 1, instead of heading. */
251
+ line?: number; /** Where, relative to that heading's section. */
252
+ position: "before" | "after" | "start" | "end"; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
253
+ section?: string; /** The heading to move it next to, by path. */
254
+ toHeading?: Array<string>; /** The heading to move it next to, by line, instead of toHeading. */
255
+ toLine?: number; /** The section to move it next to, by its id from outline.read, instead of toHeading or toLine. */
256
+ toSection?: string;
257
+ };
258
+ /** Set a heading's level. Sets the level (1 to 6) of the heading at a path or line by rewriting only its `#` run (an underlined heading's underline); its subsections keep their own levels. Params: { heading?: string[], line?: number, section?: string, level: number, style?: "atx" }. Changes the document. */
259
+ "heading.setLevel": {
260
+ heading?: Array<string>; /** The new level, 1 to 6. */
261
+ level: number; /** The heading's line, from 1, instead of heading. */
262
+ line?: number; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
263
+ section?: string; /** Rewrite an underlined heading as a # heading. */
264
+ style?: "atx";
265
+ };
266
+ /** Replace a block. Replaces the block carrying the block id `blockId` with `markdown`, keeping its `^id` unless `markdown` sets one. Params: { blockId: string, markdown: string }. Changes the document. */
267
+ "block.replace": {
268
+ blockId: string; /** The block's new Markdown; its ^id is kept unless this sets one. */
269
+ markdown: string;
270
+ };
271
+ /** Append a block. Appends `markdown` as a new block at the end of the section at a heading path or line, or at the end of the note without one. Params: { heading?: string[], line?: number, section?: string, markdown: string } (the end of the note without a heading). Changes the document. */
272
+ "block.append": {
273
+ heading?: Array<string>; /** The heading's line, from 1, instead of heading. */
274
+ line?: number; /** The Markdown to add as a block of its own. */
275
+ markdown: string; /** The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. */
276
+ section?: string;
277
+ };
278
+ /** Set a block id. Gives a block a block id (`^id`) so links and `block.*` commands can reach it: the block ending on `line`, or the one already carrying `blockId` (renaming its id). Params: { line?: number, blockId?: string, occurrence?: number, id: string }. Changes the document. */
279
+ "block.setId": {
280
+ blockId?: string; /** The new id: letters, digits and hyphens, without the caret. */
281
+ id: string; /** The block's last line, from 1. */
282
+ line?: number; /** Which of the blocks with that id, from 1. */
283
+ occurrence?: number;
284
+ };
285
+ /** Check or uncheck a task. Checks or unchecks the task at `line` (from 1) or carrying `blockId`; `done` sets it, otherwise it flips. Answers whether it is checked now. Get lines from `tasks.list`. Params: { line?: number, blockId?: string, task?: string, done?: boolean }. Changes the document. */
286
+ "task.toggle": {
287
+ blockId?: string; /** Checked or not; flips it by default. */
288
+ done?: boolean; /** The task's line, from 1. */
289
+ line?: number; /** The task's id from tasks.list ("task:2"), instead of line or blockId. */
290
+ task?: string;
291
+ };
292
+ /** Set a property. Sets a front-matter property to a string, number, boolean, null or list of strings in the key's own writing style, adding the property (and the front matter) when it is missing. Params: { key: string, value: string | number | boolean | null | string[] }. Changes the document. */
293
+ "property.set": {
294
+ key: string; /** A string, number, boolean, null, or a list of strings. */
295
+ value: Json;
296
+ };
297
+ /** Delete a property. Deletes the front-matter property `key` and its lines; `occurrence` picks one when the key is written more than once. Params: { key: string, occurrence?: number }. Changes the document. */
298
+ "property.delete": {
299
+ key: string; /** Which of a key written twice, from 1. */
300
+ occurrence?: number;
301
+ };
302
+ /** Rename a property. Renames the front-matter property `key` to `to`, changing only the key and keeping its value and place. Params: { key: string, to: string }. Changes the document. */
303
+ "property.rename": {
304
+ key: string; /** The new key. */
305
+ to: string;
306
+ };
307
+ /** Insert a table. Inserts a new table of `columns` columns (with optional header cells and `rows` empty body rows) before a line, at a section position, or at the end of the note, and answers its table index. Params: { line?: number, heading?: string[], position?: "before" | "after" | "start" | "end", columns: number, rows?: number, header?: string[] } (the end of the note by default). Changes the document. */
308
+ "table.create": {
309
+ columns: number; /** The header cells. */
310
+ header?: Array<string>; /** Or a heading's path, with position. */
311
+ heading?: Array<string>; /** Insert before this line, from 1. */
312
+ line?: number; /** Where, relative to the heading's section; end by default. */
313
+ position?: "before" | "after" | "start" | "end"; /** How many empty body rows (default 1). */
314
+ rows?: number;
315
+ };
316
+ /** Set a table cell. Sets one cell's text: `table` and `column` count from 0, `row` 0 is the header and body rows count from 1. Pass `expected` with the current text so a stale cell fails. Params: { table: number, row: number, column: number, text: string, expected?: string }. Changes the document. */
317
+ "table.setCell": {
318
+ column: number; /** The cell's text now; the command is refused when it differs. */
319
+ expected?: string; /** The row, 0 for the header row. */
320
+ row: number; /** The table's index in the note, from 0 (document order). */
321
+ table: number; /** The cell's new text (inline Markdown, one line). */
322
+ text: string;
323
+ };
324
+ /** Insert a table row. Inserts a body row before body row `at` (1 is the first; one past the last appends) with optional `cells`. Params: { table: number, at: number, cells?: string[] }. Changes the document. */
325
+ "table.insertRow": {
326
+ at: number; /** The new row's cells. */
327
+ cells?: Array<string>; /** The table's index in the note, from 0 (document order). */
328
+ table: number;
329
+ };
330
+ /** Insert a table column. Inserts a column at `at` (from 0; one past the last appends) with an optional header and alignment; every row gets an empty cell there. Params: { table: number, at: number, header?: string, align?: "left" | "center" | "right" | "none" }. Changes the document. */
331
+ "table.insertColumn": {
332
+ align?: "left" | "center" | "right" | "none"; /** Where the new column goes, from 0; one past the last appends. */
333
+ at: number; /** The new column's header. */
334
+ header?: string; /** The table's index in the note, from 0 (document order). */
335
+ table: number;
336
+ };
337
+ /** Delete a table row. Deletes body row `row` (from 1) from a table; the header row cannot be deleted. Params: { table: number, row: number }. Changes the document. */
338
+ "table.deleteRow": {
339
+ row: number; /** The table's index in the note, from 0 (document order). */
340
+ table: number;
341
+ };
342
+ /** Delete a table column. Deletes column `column` (from 0) from every row of a table, header included. Params: { table: number, column: number }. Changes the document. */
343
+ "table.deleteColumn": {
344
+ column: number; /** The table's index in the note, from 0 (document order). */
345
+ table: number;
346
+ };
347
+ /** Move a table row. Moves body row `from` to position `to` within a table (body rows count from 1). Params: { table: number, from: number, to: number }. Changes the document. */
348
+ "table.moveRow": {
349
+ from: number; /** The table's index in the note, from 0 (document order). */
350
+ table: number; /** Where it ends up, from 1. */
351
+ to: number;
352
+ };
353
+ /** Move a table column. Moves column `from` to position `to` within a table (from 0), header and alignment included. Params: { table: number, from: number, to: number }. Changes the document. */
354
+ "table.moveColumn": {
355
+ from: number; /** The table's index in the note, from 0 (document order). */
356
+ table: number; /** Where it ends up, from 0. */
357
+ to: number;
358
+ };
359
+ /** Align a table column. Sets a column's alignment (left, center, right or none) by rewriting only its cell of the delimiter row. Params: { table: number, column: number, align: "left" | "center" | "right" | "none" }. Changes the document. */
360
+ "table.align": {
361
+ align: "left" | "center" | "right" | "none"; /** The column, from 0. */
362
+ column: number; /** The table's index in the note, from 0 (document order). */
363
+ table: number;
364
+ };
365
+ /** Format a table. Rewrites a table with padded cells so its columns line up in the Markdown source, keeping every cell's text. Params: { table: number }. Changes the document. */
366
+ "table.format": {
367
+ table: number;
368
+ };
369
+ /** Insert a link. Inserts a link to `destination` at a text position, as a wikilink or a Markdown link, with optional display text, or as an embed with `embed: true`. Params: { at: number, unit?: "scalar" | "utf16", destination: string, text?: string, style?: "wikilink" | "markdown", embed?: boolean }. Changes the document. */
370
+ "link.insert": {
371
+ at: number; /** What the link points at, as the note writes it: Plan, Plan#Risks, docs/plan.md. */
372
+ destination: string; /** Embed it (![[...]]) instead of linking. */
373
+ embed?: boolean; /** [[wikilink]] or [text](markdown). */
374
+ style?: "wikilink" | "markdown"; /** The text shown (a wikilink's alias). */
375
+ text?: string; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
376
+ unit?: "scalar" | "utf16";
377
+ };
378
+ /** Change a link. Changes the destination (and the text, when given) of the `index`-th link on `line`, as `links.list` numbers them; nothing else of the link changes. Params: { line: number, index: number, destination: string, text?: string }. Changes the document. */
379
+ "link.update": {
380
+ destination: string; /** Which link of the line, from 0. */
381
+ index: number; /** The link's line, from 1. */
382
+ line: number; /** The new text shown. */
383
+ text?: string;
384
+ };
385
+ /** Retarget links to a renamed file. Rewrites every link and embed to the file `from` so it points at `to`, as after a rename, and answers how many it rewrote; the host runs it. Params: { from: string, to: string }. Changes the document. */
386
+ "links.retarget": {
387
+ from: string; /** The new one. */
388
+ to: string;
389
+ };
390
+ /** Add a comment. Starts a comment thread anchored to a text range (`from`/`to`), the `occurrence`-th match of `quote`, a heading, or the whole note without an anchor, and answers the thread's and the comment's ids. Comments are kept beside the note, never written into the file. Params: { body: string, from?: number, to?: number, unit?: "scalar" | "utf16", quote?: string, occurrence?: number, heading?: string[], line?: number, author?: string, name?: string, created?: string } (the whole note without an anchor). Changes the document. */
391
+ "comment.add": {
392
+ author?: string; /** The comment's text. */
393
+ body: string; /** When, ISO 8601 UTC; now by default. */
394
+ created?: string; /** Where the commented range starts. */
395
+ from?: number; /** Or a heading's path: comments on the heading. */
396
+ heading?: Array<string>; /** Or the heading's line, from 1. */
397
+ line?: number; /** The author's display name. */
398
+ name?: string; /** Which occurrence of quote, from 1. */
399
+ occurrence?: number; /** Or the text to comment on; its first occurrence unless occurrence is given. */
400
+ quote?: string; /** Where it ends (exclusive). */
401
+ to?: number; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
402
+ unit?: "scalar" | "utf16";
403
+ };
404
+ /** Reply to a comment. Adds a reply to the comment thread `thread` and answers the new comment's id. Params: { thread: string, body: string, author?: string, name?: string, created?: string }. Acts on `thread`. Changes the document. */
405
+ "comment.reply": {
406
+ author?: string; /** The reply's text. */
407
+ body: string; /** When, ISO 8601 UTC; now by default. */
408
+ created?: string; /** The author's display name. */
409
+ name?: string; /** The thread's id. */
410
+ thread: string;
411
+ };
412
+ /** Resolve a comment thread. Marks the comment thread `thread` resolved, or open again with `resolved: false`. Params: { thread: string, resolved?: boolean }. Acts on `thread`. Changes the document. */
413
+ "comment.resolve": {
414
+ resolved?: boolean; /** The thread's id. */
415
+ thread: string;
416
+ };
417
+ /** Move a comment thread. Anchors the comment thread `thread` to another text range, quote or heading, as the editor does when its anchor text is edited. Params: { thread: string, quote?: string, occurrence?: number, from?: number, to?: number, unit?: "scalar" | "utf16", heading?: string[], line?: number }. Acts on `thread`. Changes the document. */
418
+ "comment.move": {
419
+ from?: number; /** Or a heading's path: anchors it to the heading. */
420
+ heading?: Array<string>; /** Or the heading's line, from 1. */
421
+ line?: number; /** Which occurrence of quote, from 1. */
422
+ occurrence?: number; /** The text to anchor it to. */
423
+ quote?: string; /** The thread's id. */
424
+ thread: string; /** And where it ends (exclusive). */
425
+ to?: number; /** How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. */
426
+ unit?: "scalar" | "utf16";
427
+ };
428
+ /** Delete a comment. Deletes one comment from a thread; deleting the last one removes the thread. Params: { thread: string, comment: string }. Acts on `comment`. Changes the document. */
429
+ "comment.delete": {
430
+ comment: string; /** The thread's id. */
431
+ thread: string;
432
+ };
433
+ /** Set the line endings. Sets the file's line endings to LF or CRLF and whether it starts with a byte order mark; the text is otherwise unchanged. Answers the line style the file has now. Params: { eol: "lf" | "crlf", bom?: boolean }. Changes the document. */
434
+ "file.setLineEndings": {
435
+ bom?: boolean; /** LF or CRLF for every line. */
436
+ eol: "lf" | "crlf";
437
+ };
438
+ /** Read the selection. Answers the editor's selection: anchor and focus positions, the selected text, the caret's line and column, the line's text before it, and where the caret is drawn. Params: {}. */
439
+ "selection.get": Record<string, never>;
440
+ /** Set the selection. Sets the editor's selection by anchor and focus positions, selects a line, puts the caret at a line and column, or at a point of the document. Params: { anchor?: number, focus?: number, line?: number, column?: number, x?: number, y?: number }. */
441
+ "selection.set": {
442
+ anchor?: number; /** With line: the column, from 1, in Unicode characters (at most the line's end). */
443
+ column?: number; /** Where it ends (the caret); anchor by default. */
444
+ focus?: number; /** Or a line, from 1: selects it, or with column puts the caret there. */
445
+ line?: number; /** Or a point of the document (with y), in document pixels: the caret goes there. */
446
+ x?: number; /** With x: the point's y, in document pixels. */
447
+ y?: number;
448
+ };
449
+ /** Select All. Selects the whole note in the editor. Params: {}. */
450
+ "edit.selectAll": Record<string, never>;
451
+ /** Cut. Removes the editor's selection from the note and answers its text for the clipboard. Params: {}. Changes the document. */
452
+ "edit.cut": Record<string, never>;
453
+ /** Where the tables are drawn. Answers where the editor draws each table's columns and rows between `top` and `bottom`, for the table widget's controls. Params: { top?: number, bottom?: number }. */
454
+ "table.geometry": {
455
+ bottom?: number; /** Only tables below this document height. */
456
+ top?: number;
457
+ };
458
+ /** Where the code blocks are drawn. Answers where the editor draws each fenced code block between `top` and `bottom`, with its language, for its copy and language controls. Params: { top?: number, bottom?: number }. */
459
+ "code.blocks": {
460
+ bottom?: number; /** Only tables below this document height. */
461
+ top?: number;
462
+ };
463
+ /** The Mermaid diagrams to draw and where. Answers the Mermaid diagrams and HTML blocks the editor still has to size, those drawn between `top` and `bottom` with their boxes, and the column width. Params: { top?: number, bottom?: number }. */
464
+ "diagrams.view": {
465
+ bottom?: number; /** Only tables below this document height. */
466
+ top?: number;
467
+ };
468
+ /** A Mermaid diagram's drawn size. Gives the editor a Mermaid diagram's or HTML block's drawn size, by its source, so the page reserves that space; answers whether the size changed. Params: { source: string, width: number, height: number }. */
469
+ "diagram.set": {
470
+ height: number; /** The diagram's source: the code between its fences. */
471
+ source: string; /** Its drawn width in document pixels. */
472
+ width: number;
473
+ };
474
+ /** The front matter as a properties block. Answers the front matter as the editor's properties block (each row's key, kind, values and position), or null when the note shows none. Params: {}. */
475
+ "properties.view": Record<string, never>;
476
+ /** The pictures the note draws that are not loaded. Answers the pictures the note draws that the editor has not loaded yet, and those drawn now, by name. Params: {}. */
477
+ "image.wanted": Record<string, never>;
478
+ /** Hand the note a picture's bytes. Hands the editor a picture's bytes (`data`, base64) by name so the note draws it; bytes that are not a picture record it as missing. Params: { name: string, data: string }. */
479
+ "image.set": {
480
+ data: string; /** The picture's name as the note writes it. */
481
+ name: string;
482
+ };
483
+ /** Replace the selection. Replaces the editor's selection with `text`; with `paste: true` it is pasted text, and an address pasted over a selection links it. Params: { text: string, paste?: boolean }. Changes the document. */
484
+ "selection.replace": {
485
+ paste?: boolean; /** The text that replaces the selection. */
486
+ text: string;
487
+ };
488
+ /** Fit the page to the visible width. Sets the page to the editor's visible width (and height) so lines wrap to it; answers whether that changed and the page's width. Params: { width: number, height?: number }. */
489
+ "view.width": {
490
+ height?: number; /** The visible width in document pixels. */
491
+ width: number;
492
+ };
493
+ /** Paint the note in the host's color scheme. Paints the note with the light or the dark palette, as the host's color scheme is; nothing moves. Answers whether that changed. Params: { scheme: 'light' | 'dark' }. */
494
+ "view.scheme": {
495
+ scheme: "light" | "dark";
496
+ };
497
+ /** The pointer left the note: nothing is hovered. Tells the editor the pointer left the note, so no heading or item is drawn hovered. Params: {}. */
498
+ "view.hoverOut": Record<string, never>;
499
+ /** Where a character is drawn. Answers where the character at text position `at` is drawn on the page (x, top and height, in document pixels). Params: { at: number }. */
500
+ "selection.where": {
501
+ at: number;
502
+ };
503
+ /** What block a point of the page is in. Answers whether the page point `x`, `y` is in a callout, and whether the caret is in that callout too. Params: { x: number, y: number }. */
504
+ "view.blockAt": {
505
+ x: number; /** Down, in document pixels. */
506
+ y: number;
507
+ };
508
+ /** Fold the properties block to its heading, or open it. Folds the properties block to its heading line in the editor, or opens it again; writes nothing and answers whether it is folded now. Params: {}. */
509
+ "view.foldProperties": Record<string, never>;
510
+ /** Inline math. Toggles inline math (`$...$`) on the editor's selection, or on the word at the caret. Params: {}. Changes the document. */
511
+ "format.math": Record<string, never>;
512
+ /** Highlight in a colour. Highlights the editor's selection in `color` (Obsidian's coloured highlight, `==??...==`); in a highlight of that colour the highlight goes, in another its colour changes. Params: { color: string }. Changes the document. */
513
+ "format.highlightColor": {
514
+ color: "red" | "orange" | "yellow" | "green" | "blue" | "purple";
515
+ };
516
+ /** Clear formatting. Removes bold, italic, strikethrough, highlight, inline code and inline math marks from the lines the editor's selection covers. Params: {}. Changes the document. */
517
+ "format.clear": Record<string, never>;
518
+ /** A macOS Control editing key. Runs a macOS Control editing key (`key`, for example `a`, `e`, `k`, `t`, `o`) or Page Up and Page Down on the editor's caret, as macOS text fields do. Params: { key: string, shift?: boolean }. Changes the document. */
519
+ "selection.controlKey": {
520
+ key: string; /** With Shift (Page Up and Page Down extend the selection). */
521
+ shift?: boolean;
522
+ };
523
+ /** Bold. Toggles bold (`**...**`) on the editor's selection, or on the word at the caret. Params: {}. Changes the document. */
524
+ "format.bold": Record<string, never>;
525
+ /** Italic. Toggles italic (`*...*`) on the editor's selection, or on the word at the caret. Params: {}. Changes the document. */
526
+ "format.italic": Record<string, never>;
527
+ /** Strikethrough. Toggles strikethrough (`~~...~~`) on the editor's selection, or on the word at the caret. Params: {}. Changes the document. */
528
+ "format.strike": Record<string, never>;
529
+ /** Inline Code. Toggles inline code (backticks) on the editor's selection, or on the word at the caret. Params: {}. Changes the document. */
530
+ "format.code": Record<string, never>;
531
+ /** Highlight. Toggles highlight (`==...==`) on the editor's selection, or on the word at the caret. Params: {}. Changes the document. */
532
+ "format.highlight": Record<string, never>;
533
+ /** Link. Turns the editor's selection into a Markdown link (`[text]()`) and puts the caret where its address goes (where its text goes, without a selection). Params: {}. Changes the document. */
534
+ "format.link": Record<string, never>;
535
+ /** Paragraph. Turns the headings on the lines the editor's selection covers back into plain paragraphs. Params: {}. Changes the document. */
536
+ "format.paragraph": Record<string, never>;
537
+ /** Heading 1. Turns the lines the editor's selection covers into level-1 headings. Params: {}. Changes the document. */
538
+ "format.heading1": Record<string, never>;
539
+ /** Heading 2. Turns the lines the editor's selection covers into level-2 headings. Params: {}. Changes the document. */
540
+ "format.heading2": Record<string, never>;
541
+ /** Heading 3. Turns the lines the editor's selection covers into level-3 headings. Params: {}. Changes the document. */
542
+ "format.heading3": Record<string, never>;
543
+ /** Heading 4. Turns the lines the editor's selection covers into level-4 headings. Params: {}. Changes the document. */
544
+ "format.heading4": Record<string, never>;
545
+ /** Heading 5. Turns the lines the editor's selection covers into level-5 headings. Params: {}. Changes the document. */
546
+ "format.heading5": Record<string, never>;
547
+ /** Heading 6. Turns the lines the editor's selection covers into level-6 headings. Params: {}. Changes the document. */
548
+ "format.heading6": Record<string, never>;
549
+ /** Bulleted List. Turns the selected lines into a bulleted list (`- `), or back into paragraphs when every line is one already. Params: {}. Changes the document. */
550
+ "list.bullet": Record<string, never>;
551
+ /** Numbered List. Turns the selected lines into a numbered list (`1. `), or back into paragraphs when every line is one already. Params: {}. Changes the document. */
552
+ "list.numbered": Record<string, never>;
553
+ /** Task List. Turns the selected lines into task items (`- [ ] `), or takes the task marker away when every line has it. Params: {}. Changes the document. */
554
+ "list.task": Record<string, never>;
555
+ /** Toggle Checkbox. Checks the task items in the editor's selection, or opens them when none is open; other lines go a step: text becomes a task, a list item gets a box. Params: {}. Changes the document. */
556
+ "list.toggleCheckbox": Record<string, never>;
557
+ /** Indent. Indents every line the editor's selection covers by a tab (inside a quote, after its `>`). Params: {}. Changes the document. */
558
+ "edit.indent": Record<string, never>;
559
+ /** Outdent. Takes one tab, or up to four spaces, from the start of every line the editor's selection covers. Params: {}. Changes the document. */
560
+ "edit.outdent": Record<string, never>;
561
+ /** Move Line Up. Moves the lines the editor's selection covers up by one line. Params: {}. Changes the document. */
562
+ "edit.moveLineUp": Record<string, never>;
563
+ /** Move Line Down. Moves the lines the editor's selection covers down by one line. Params: {}. Changes the document. */
564
+ "edit.moveLineDown": Record<string, never>;
565
+ /** Delete Paragraph. Deletes the lines the editor's selection covers (the caret's line without a selection). Params: {}. Changes the document. */
566
+ "edit.deleteParagraph": Record<string, never>;
567
+ /** Comment. Wraps the editor's selection (or the word at the caret) in a Markdown comment (`%%...%%`) hidden when the note is read, or takes the comment away. Params: {}. Changes the document. */
568
+ "format.comment": Record<string, never>;
569
+ /** Quote. Turns the selected lines into a block quote (`> `), or back into paragraphs when every line is quoted already. Params: {}. Changes the document. */
570
+ "format.quote": Record<string, never>;
571
+ /** Promote Heading. Raises the headings the editor's selection covers by one level (for example `###` to `##`); a plain line becomes a level-6 heading. Params: {}. Changes the document. */
572
+ "format.headingUp": Record<string, never>;
573
+ /** Demote Heading. Lowers the headings the editor's selection covers by one level (for example `##` to `###`); a level-6 heading becomes a paragraph. Params: {}. Changes the document. */
574
+ "format.headingDown": Record<string, never>;
575
+ /** Fold Heading. Folds or opens the heading, or the list item with children, on the editor caret's line; answers how many are folded. Params: {}. */
576
+ "view.fold": Record<string, never>;
577
+ /** Fold All Headings. Folds every heading and every list item with children in the editor; answers how many are folded. Params: {}. */
578
+ "view.foldAll": Record<string, never>;
579
+ /** Unfold All. Opens every fold in the editor; answers that none is folded. Params: {}. */
580
+ "view.unfoldAll": Record<string, never>;
581
+ /** Fold More. Folds the innermost open heading or list item around the editor's caret; answers how many are folded. Params: {}. */
582
+ "view.foldMore": Record<string, never>;
583
+ /** Fold Less. Opens the outermost folded heading or list item around the editor's caret; answers how many are folded. Params: {}. */
584
+ "view.foldLess": Record<string, never>;
585
+ /** Select Section. Selects the whole section under the heading above the editor's caret. Params: {}. */
586
+ "edit.selectSection": Record<string, never>;
587
+ /** Sort Lines. Sorts the lines the editor's selection covers alphabetically, ignoring case. Params: {}. Changes the document. */
588
+ "edit.sortLines": Record<string, never>;
589
+ /** Trim Trailing Spaces. Removes trailing spaces and tabs from the lines the editor's selection covers. Params: {}. Changes the document. */
590
+ "edit.trimWhitespace": Record<string, never>;
591
+ /** Wikilink. Wraps the editor's selection in a wikilink (`[[...]]`), or inserts an empty one to type a note name into. Params: {}. Changes the document. */
592
+ "insert.wikilink": Record<string, never>;
593
+ /** Embed. Wraps the editor's selection in an embed (`![[...]]`), or inserts an empty one. Params: {}. Changes the document. */
594
+ "insert.embed": Record<string, never>;
595
+ /** Image. Inserts a Markdown image (`![...]()`) at the editor's caret, the selection as its alt text. Params: {}. Changes the document. */
596
+ "insert.image": Record<string, never>;
597
+ /** Tag. Inserts a tag sign (`#`) before the editor's selection to type a tag into. Params: {}. Changes the document. */
598
+ "insert.tag": Record<string, never>;
599
+ /** Table. Inserts an empty two-column table (header, delimiter and one body row) at the editor's caret. Params: {}. Changes the document. */
600
+ "insert.table": Record<string, never>;
601
+ /** Math Block. Puts the lines the editor's selection covers between `$$` fences, or inserts an empty math block. Params: {}. Changes the document. */
602
+ "insert.mathBlock": Record<string, never>;
603
+ /** Callout. Puts the lines the editor's selection covers in a note callout (`> [!NOTE]`), or inserts a new one with a title and contents. Params: {}. Changes the document. */
604
+ "insert.callout": Record<string, never>;
605
+ /** Footnote. Inserts a footnote reference at the editor's caret and its definition at the end of the note, the caret there. Params: {}. Changes the document. */
606
+ "insert.footnote": Record<string, never>;
607
+ /** Date. Puts today's local date (YYYY-MM-DD) in place of the editor's selection. Params: { utcOffset?: number }. Changes the document. */
608
+ "insert.date": {
609
+ utcOffset?: number;
610
+ };
611
+ /** Date and Time. Puts the current local date and time (YYYY-MM-DD HH:mm) in place of the editor's selection. Params: { utcOffset?: number }. Changes the document. */
612
+ "insert.timestamp": {
613
+ utcOffset?: number;
614
+ };
615
+ /** Code Block. Puts the lines the editor's selection covers between ``` fences, or inserts an empty code block. Params: {}. Changes the document. */
616
+ "insert.codeBlock": Record<string, never>;
617
+ /** Horizontal Rule. Inserts a horizontal rule (`---`) at the editor's caret. Params: {}. Changes the document. */
618
+ "insert.rule": Record<string, never>;
619
+ /** Undo. Takes back the caller's last edit (the person's or, with `scope: "agent"`, the agent's) without touching the other's edits; answers whether there was one. Params: { scope?: "person" | "agent" }. Changes the document. */
620
+ "edit.undo": {
621
+ scope?: "person" | "agent";
622
+ };
623
+ /** Redo. Applies again the edit the caller's last undo took back, in the same scope as `edit.undo`; answers whether there was one. Params: { scope?: "person" | "agent" }. Changes the document. */
624
+ "edit.redo": {
625
+ scope?: "person" | "agent";
626
+ };
627
+ }
628
+ /** A Note file opened with `openDocument<Note, NoteCommands>`. */
629
+ export type NoteDocument = ModelDocument<Note, NoteCommands>;
630
+ export type NoteContext = RequestContext<Note, NoteCommands>;
631
+ export {};