@sanity/runtime-cli 10.9.2 → 10.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +39 -18
  2. package/dist/actions/blueprints/config.d.ts +1 -1
  3. package/dist/actions/blueprints/config.js +2 -11
  4. package/dist/actions/blueprints/stacks.d.ts +1 -0
  5. package/dist/actions/blueprints/stacks.js +1 -0
  6. package/dist/actions/functions/dev.d.ts +2 -1
  7. package/dist/actions/functions/dev.js +2 -2
  8. package/dist/commands/blueprints/doctor.d.ts +10 -0
  9. package/dist/commands/blueprints/doctor.js +28 -0
  10. package/dist/commands/functions/dev.d.ts +1 -0
  11. package/dist/commands/functions/dev.js +5 -0
  12. package/dist/cores/blueprints/doctor.d.ts +9 -0
  13. package/dist/cores/blueprints/doctor.js +188 -0
  14. package/dist/cores/functions/dev.d.ts +1 -0
  15. package/dist/cores/functions/dev.js +6 -2
  16. package/dist/cores/index.d.ts +4 -1
  17. package/dist/server/app.d.ts +2 -1
  18. package/dist/server/app.js +3 -3
  19. package/dist/server/handlers/invoke.d.ts +2 -2
  20. package/dist/server/handlers/invoke.js +3 -3
  21. package/dist/utils/get-headers.js +1 -0
  22. package/oclif.manifest.json +46 -1
  23. package/package.json +2 -1
  24. package/dist/server/static/api.d.ts +0 -24
  25. package/dist/server/static/components/api-base.d.ts +0 -20
  26. package/dist/server/static/components/clear-button.d.ts +0 -6
  27. package/dist/server/static/components/codemirror-theme.d.ts +0 -6
  28. package/dist/server/static/components/console-panel.d.ts +0 -1
  29. package/dist/server/static/components/fetch-button.d.ts +0 -7
  30. package/dist/server/static/components/filters.d.ts +0 -1
  31. package/dist/server/static/components/function-list.d.ts +0 -1
  32. package/dist/server/static/components/help-button.d.ts +0 -3
  33. package/dist/server/static/components/network-spinner.d.ts +0 -1
  34. package/dist/server/static/components/payload-panel.d.ts +0 -1
  35. package/dist/server/static/components/response-panel.d.ts +0 -1
  36. package/dist/server/static/components/rule-panel.d.ts +0 -1
  37. package/dist/server/static/components/run-panel.d.ts +0 -1
  38. package/dist/server/static/components/select-dropdown.d.ts +0 -1
  39. package/dist/server/static/components/toggle-switch.d.ts +0 -11
  40. package/dist/server/static/hot-reload.d.ts +0 -1
  41. package/dist/server/static/vendor/vendor.bundle.d.ts +0 -2008
  42. package/dist/utils/child-process-wrapper.d.ts +0 -1
@@ -1,2008 +0,0 @@
1
- /**
2
- The editor state class is a persistent (immutable) data structure.
3
- To update a state, you [create](https://codemirror.net/6/docs/ref/#state.EditorState.update) a
4
- [transaction](https://codemirror.net/6/docs/ref/#state.Transaction), which produces a _new_ state
5
- instance, without modifying the original object.
6
-
7
- As such, _never_ mutate properties of a state directly. That'll
8
- just break things.
9
- */
10
- export class EditorState {
11
- /**
12
- Deserialize a state from its JSON representation. When custom
13
- fields should be deserialized, pass the same object you passed
14
- to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as
15
- third argument.
16
- */
17
- static fromJSON(json: any, config: {} | undefined, fields: any): EditorState;
18
- /**
19
- Create a new state. You'll usually only need this when
20
- initializing an editor—updated states are created by applying
21
- transactions.
22
- */
23
- static create(config?: {}): EditorState;
24
- constructor(config: any, doc: any, selection: any, values: any, computeSlot: any, tr: any);
25
- config: any;
26
- doc: any;
27
- selection: any;
28
- values: any;
29
- status: any;
30
- computeSlot: any;
31
- field(field: any, require?: boolean): any;
32
- /**
33
- Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this
34
- state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec)
35
- can be passed. Unless
36
- [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the
37
- [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec
38
- are assumed to start in the _current_ document (not the document
39
- produced by previous specs), and its
40
- [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and
41
- [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer
42
- to the document created by its _own_ changes. The resulting
43
- transaction contains the combined effect of all the different
44
- specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later
45
- specs take precedence over earlier ones.
46
- */
47
- update(...specs: any[]): any;
48
- /**
49
- @internal
50
- */
51
- applyTransaction(tr: any): void;
52
- /**
53
- Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that
54
- replaces every selection range with the given content.
55
- */
56
- replaceSelection(text: any): {
57
- changes: (any[] & ChangeSet) | null;
58
- selection: EditorSelection;
59
- effects: any[];
60
- };
61
- /**
62
- Create a set of changes and a new selection by running the given
63
- function for each range in the active selection. The function
64
- can return an optional set of changes (in the coordinate space
65
- of the start document), plus an updated range (in the coordinate
66
- space of the document produced by the call's own changes). This
67
- method will merge all the changes and ranges into a single
68
- changeset and selection, and return it as a [transaction
69
- spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to
70
- [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update).
71
- */
72
- changeByRange(f: any): {
73
- changes: (any[] & ChangeSet) | null;
74
- selection: EditorSelection;
75
- effects: any[];
76
- };
77
- /**
78
- Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change
79
- description, taking the state's document length and line
80
- separator into account.
81
- */
82
- changes(spec?: any[]): (any[] & ChangeSet) | null;
83
- /**
84
- Using the state's [line
85
- separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a
86
- [`Text`](https://codemirror.net/6/docs/ref/#state.Text) instance from the given string.
87
- */
88
- toText(string: any): any;
89
- /**
90
- Return the given range of the document as a string.
91
- */
92
- sliceDoc(from?: number, to?: any): any;
93
- /**
94
- Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet).
95
- */
96
- facet(facet: any): any;
97
- /**
98
- Convert this state to a JSON-serializable object. When custom
99
- fields should be serialized, you can pass them in as an object
100
- mapping property names (in the resulting object, which should
101
- not use `doc` or `selection`) to fields.
102
- */
103
- toJSON(fields: any): {
104
- doc: any;
105
- selection: any;
106
- };
107
- /**
108
- The size (in columns) of a tab in the document, determined by
109
- the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet.
110
- */
111
- get tabSize(): any;
112
- /**
113
- Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator)
114
- string for this state.
115
- */
116
- get lineBreak(): any;
117
- /**
118
- Returns true when the editor is
119
- [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only.
120
- */
121
- get readOnly(): any;
122
- /**
123
- Look up a translation for the given phrase (via the
124
- [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the
125
- original string if no translation is found.
126
-
127
- If additional arguments are passed, they will be inserted in
128
- place of markers like `$1` (for the first value) and `$2`, etc.
129
- A single `$` is equivalent to `$1`, and `$$` will produce a
130
- literal dollar sign.
131
- */
132
- phrase(phrase: any, ...insert: any[]): any;
133
- /**
134
- Find the values for a given language data field, provided by the
135
- the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet.
136
-
137
- Examples of language data fields are...
138
-
139
- - [`"commentTokens"`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) for specifying
140
- comment syntax.
141
- - [`"autocomplete"`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.override)
142
- for providing language-specific completion sources.
143
- - [`"wordChars"`](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) for adding
144
- characters that should be considered part of words in this
145
- language.
146
- - [`"closeBrackets"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls
147
- bracket closing behavior.
148
- */
149
- languageDataAt(name: any, pos: any, side?: number): any[];
150
- /**
151
- Return a function that can categorize strings (expected to
152
- represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak))
153
- into one of:
154
-
155
- - Word (contains an alphanumeric character or a character
156
- explicitly listed in the local language's `"wordChars"`
157
- language data, which should be a string)
158
- - Space (contains only whitespace)
159
- - Other (anything else)
160
- */
161
- charCategorizer(at: any): (char: any) => any;
162
- /**
163
- Find the word at the given position, meaning the range
164
- containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters
165
- around it. If no word characters are adjacent to the position,
166
- this returns null.
167
- */
168
- wordAt(pos: any): SelectionRange | null;
169
- }
170
- export namespace EditorState {
171
- export { allowMultipleSelections };
172
- export let tabSize: Facet;
173
- export { lineSeparator };
174
- export { readOnly };
175
- export let phrases: Facet;
176
- export { languageData };
177
- export { changeFilter };
178
- export { transactionFilter };
179
- export { transactionExtender };
180
- }
181
- /**
182
- An editor view represents the editor's user interface. It holds
183
- the editable DOM surface, and possibly other elements such as the
184
- line number gutter. It handles events and dispatches state
185
- transactions for editing actions.
186
- */
187
- export class EditorView {
188
- /**
189
- Returns an effect that can be
190
- [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
191
- cause it to scroll the given position or range into view.
192
- */
193
- static scrollIntoView(pos: any, options?: {}): StateEffect;
194
- /**
195
- Returns an extension that can be used to add DOM event handlers.
196
- The value should be an object mapping event names to handler
197
- functions. For any given event, such functions are ordered by
198
- extension precedence, and the first handler to return true will
199
- be assumed to have handled that event, and no other handlers or
200
- built-in behavior will be activated for it. These are registered
201
- on the [content element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except
202
- for `scroll` handlers, which will be called any time the
203
- editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of
204
- its parent nodes is scrolled.
205
- */
206
- static domEventHandlers(handlers: any): ViewPlugin;
207
- /**
208
- Create an extension that registers DOM event observers. Contrary
209
- to event [handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers),
210
- observers can't be prevented from running by a higher-precedence
211
- handler returning true. They also don't prevent other handlers
212
- and observers from running when they return true, and should not
213
- call `preventDefault`.
214
- */
215
- static domEventObservers(observers: any): ViewPlugin;
216
- /**
217
- Create a theme extension. The first argument can be a
218
- [`style-mod`](https://github.com/marijnh/style-mod#documentation)
219
- style spec providing the styles for the theme. These will be
220
- prefixed with a generated class for the style.
221
-
222
- Because the selectors will be prefixed with a scope class, rule
223
- that directly match the editor's [wrapper
224
- element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)—to which the scope class will be
225
- added—need to be explicitly differentiated by adding an `&` to
226
- the selector for that element—for example
227
- `&.cm-focused`.
228
-
229
- When `dark` is set to true, the theme will be marked as dark,
230
- which will cause the `&dark` rules from [base
231
- themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to
232
- `&light` when a light theme is active).
233
- */
234
- static theme(spec: any, options: any): FacetProvider[];
235
- /**
236
- Create an extension that adds styles to the base theme. Like
237
- with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the
238
- place of the editor wrapper element when directly targeting
239
- that. You can also use `&dark` or `&light` instead to only
240
- target editors with a dark or light theme.
241
- */
242
- static baseTheme(spec: any): PrecExtension;
243
- /**
244
- Retrieve an editor view instance from the view's DOM
245
- representation.
246
- */
247
- static findFromDOM(dom: any): any;
248
- /**
249
- Construct a new view. You'll want to either provide a `parent`
250
- option, or put `view.dom` into your document after creating a
251
- view, so that the user can see the editor.
252
- */
253
- constructor(config?: {});
254
- /**
255
- The current editor state.
256
- */
257
- get state(): any;
258
- /**
259
- To be able to display large documents without consuming too much
260
- memory or overloading the browser, CodeMirror only draws the
261
- code that is visible (plus a margin around it) to the DOM. This
262
- property tells you the extent of the current drawn viewport, in
263
- document positions.
264
- */
265
- get viewport(): Viewport | undefined;
266
- /**
267
- When there are, for example, large collapsed ranges in the
268
- viewport, its size can be a lot bigger than the actual visible
269
- content. Thus, if you are doing something like styling the
270
- content in the viewport, it is preferable to only do so for
271
- these ranges, which are the subset of the viewport that is
272
- actually drawn.
273
- */
274
- get visibleRanges(): any[];
275
- /**
276
- Returns false when the editor is entirely scrolled out of view
277
- or otherwise hidden.
278
- */
279
- get inView(): boolean;
280
- /**
281
- Indicates whether the user is currently composing text via
282
- [IME](https://en.wikipedia.org/wiki/Input_method), and at least
283
- one change has been made in the current composition.
284
- */
285
- get composing(): boolean;
286
- /**
287
- Indicates whether the user is currently in composing state. Note
288
- that on some platforms, like Android, this will be the case a
289
- lot, since just putting the cursor on a word starts a
290
- composition there.
291
- */
292
- get compositionStarted(): boolean;
293
- /**
294
- The document or shadow root that the view lives in.
295
- */
296
- get root(): any;
297
- /**
298
- @internal
299
- */
300
- get win(): Window & typeof globalThis;
301
- plugins: any;
302
- pluginMap: Map<any, any>;
303
- editorAttrs: {};
304
- contentAttrs: {};
305
- bidiCache: any[];
306
- destroyed: boolean;
307
- /**
308
- @internal
309
- */
310
- updateState: number;
311
- /**
312
- @internal
313
- */
314
- measureScheduled: number;
315
- /**
316
- @internal
317
- */
318
- measureRequests: any[];
319
- contentDOM: HTMLDivElement;
320
- scrollDOM: HTMLDivElement;
321
- announceDOM: HTMLDivElement;
322
- dom: HTMLDivElement;
323
- dispatchTransactions: any;
324
- dispatch(...input: any[]): void;
325
- _root: any;
326
- viewState: ViewState;
327
- observer: DOMObserver;
328
- inputState: InputState;
329
- docView: DocView;
330
- /**
331
- Update the view for the given array of transactions. This will
332
- update the visible document and selection to match the state
333
- produced by the transactions, and notify view plugins of the
334
- change. You should usually call
335
- [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this
336
- as a primitive.
337
- */
338
- update(transactions: any): void;
339
- /**
340
- Reset the view to the given state. (This will cause the entire
341
- document to be redrawn and all view plugins to be reinitialized,
342
- so you should probably only use it when the new state isn't
343
- derived from the old state. Otherwise, use
344
- [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.)
345
- */
346
- setState(newState: any): void;
347
- updatePlugins(update: any): void;
348
- docViewUpdate(): void;
349
- /**
350
- @internal
351
- */
352
- measure(flush?: boolean): void;
353
- /**
354
- Get the CSS classes for the currently active editor themes.
355
- */
356
- get themeClasses(): string;
357
- updateAttrs(): any;
358
- showAnnouncements(trs: any): void;
359
- mountStyles(): void;
360
- styleModules: any;
361
- readMeasured(): void;
362
- /**
363
- Schedule a layout measurement, optionally providing callbacks to
364
- do custom DOM measuring followed by a DOM write phase. Using
365
- this is preferable reading DOM layout directly from, for
366
- example, an event handler, because it'll make sure measuring and
367
- drawing done by other components is synchronized, avoiding
368
- unnecessary DOM layout computations.
369
- */
370
- requestMeasure(request: any): void;
371
- /**
372
- Get the value of a specific plugin, if present. Note that
373
- plugins that crash can be dropped from a view, so even when you
374
- know you registered a given plugin, it is recommended to check
375
- the return value of this method.
376
- */
377
- plugin(plugin: any): any;
378
- /**
379
- The top position of the document, in screen coordinates. This
380
- may be negative when the editor is scrolled down. Points
381
- directly to the top of the first line, not above the padding.
382
- */
383
- get documentTop(): number;
384
- /**
385
- Reports the padding above and below the document.
386
- */
387
- get documentPadding(): {
388
- top: number;
389
- bottom: number;
390
- };
391
- /**
392
- If the editor is transformed with CSS, this provides the scale
393
- along the X axis. Otherwise, it will just be 1. Note that
394
- transforms other than translation and scaling are not supported.
395
- */
396
- get scaleX(): number;
397
- /**
398
- Provide the CSS transformed scale along the Y axis.
399
- */
400
- get scaleY(): number;
401
- /**
402
- Find the text line or block widget at the given vertical
403
- position (which is interpreted as relative to the [top of the
404
- document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)).
405
- */
406
- elementAtHeight(height: any): any;
407
- /**
408
- Find the line block (see
409
- [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given
410
- height, again interpreted relative to the [top of the
411
- document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop).
412
- */
413
- lineBlockAtHeight(height: any): any;
414
- /**
415
- Get the extent and vertical position of all [line
416
- blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions
417
- are relative to the [top of the
418
- document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);
419
- */
420
- get viewportLineBlocks(): any[] | undefined;
421
- /**
422
- Find the line block around the given document position. A line
423
- block is a range delimited on both sides by either a
424
- non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^replace) line break, or the
425
- start/end of the document. It will usually just hold a line of
426
- text, but may be broken into multiple textblocks by block
427
- widgets.
428
- */
429
- lineBlockAt(pos: any): any;
430
- /**
431
- The editor's total content height.
432
- */
433
- get contentHeight(): any;
434
- /**
435
- Move a cursor position by [grapheme
436
- cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak). `forward` determines whether
437
- the motion is away from the line start, or towards it. In
438
- bidirectional text, the line is traversed in visual order, using
439
- the editor's [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
440
- When the start position was the last one on the line, the
441
- returned position will be across the line break. If there is no
442
- further line, the original position is returned.
443
-
444
- By default, this method moves over a single cluster. The
445
- optional `by` argument can be used to move across more. It will
446
- be called with the first cluster as argument, and should return
447
- a predicate that determines, for each subsequent cluster,
448
- whether it should also be moved over.
449
- */
450
- moveByChar(start: any, forward: any, by: any): any;
451
- /**
452
- Move a cursor position across the next group of either
453
- [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter
454
- non-whitespace characters.
455
- */
456
- moveByGroup(start: any, forward: any): any;
457
- /**
458
- Get the cursor position visually at the start or end of a line.
459
- Note that this may differ from the _logical_ position at its
460
- start or end (which is simply at `line.from`/`line.to`) if text
461
- at the start or end goes against the line's base text direction.
462
- */
463
- visualLineSide(line: any, end: any): SelectionRange;
464
- /**
465
- Move to the next line boundary in the given direction. If
466
- `includeWrap` is true, line wrapping is on, and there is a
467
- further wrap point on the current line, the wrap point will be
468
- returned. Otherwise this function will return the start or end
469
- of the line.
470
- */
471
- moveToLineBoundary(start: any, forward: any, includeWrap?: boolean): SelectionRange;
472
- /**
473
- Move a cursor position vertically. When `distance` isn't given,
474
- it defaults to moving to the next line (including wrapped
475
- lines). Otherwise, `distance` should provide a positive distance
476
- in pixels.
477
-
478
- When `start` has a
479
- [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical
480
- motion will use that as a target horizontal position. Otherwise,
481
- the cursor's own horizontal position is used. The returned
482
- cursor will have its goal column set to whichever column was
483
- used.
484
- */
485
- moveVertically(start: any, forward: any, distance: any): any;
486
- /**
487
- Find the DOM parent node and offset (child offset if `node` is
488
- an element, character offset when it is a text node) at the
489
- given document position.
490
-
491
- Note that for positions that aren't currently in
492
- `visibleRanges`, the resulting DOM position isn't necessarily
493
- meaningful (it may just point before or after a placeholder
494
- element).
495
- */
496
- domAtPos(pos: any): any;
497
- /**
498
- Find the document position at the given DOM node. Can be useful
499
- for associating positions with DOM events. Will raise an error
500
- when `node` isn't part of the editor content.
501
- */
502
- posAtDOM(node: any, offset?: number): any;
503
- posAtCoords(coords: any, precise?: boolean): any;
504
- /**
505
- Get the screen coordinates at the given document position.
506
- `side` determines whether the coordinates are based on the
507
- element before (-1) or after (1) the position (if no element is
508
- available on the given side, the method will transparently use
509
- another strategy to get reasonable coordinates).
510
- */
511
- coordsAtPos(pos: any, side?: number): any;
512
- /**
513
- Return the rectangle around a given character. If `pos` does not
514
- point in front of a character that is in the viewport and
515
- rendered (i.e. not replaced, not a line break), this will return
516
- null. For space characters that are a line wrap point, this will
517
- return the position before the line break.
518
- */
519
- coordsForChar(pos: any): any;
520
- /**
521
- The default width of a character in the editor. May not
522
- accurately reflect the width of all characters (given variable
523
- width fonts or styling of invididual ranges).
524
- */
525
- get defaultCharacterWidth(): number;
526
- /**
527
- The default height of a line in the editor. May not be accurate
528
- for all lines.
529
- */
530
- get defaultLineHeight(): number;
531
- /**
532
- The text direction
533
- ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)
534
- CSS property) of the editor's content element.
535
- */
536
- get textDirection(): any;
537
- /**
538
- Find the text direction of the block at the given position, as
539
- assigned by CSS. If
540
- [`perLineTextDirection`](https://codemirror.net/6/docs/ref/#view.EditorView^perLineTextDirection)
541
- isn't enabled, or the given position is outside of the viewport,
542
- this will always return the same as
543
- [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that
544
- this may trigger a DOM layout.
545
- */
546
- textDirectionAt(pos: any): any;
547
- /**
548
- Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)
549
- (as determined by the
550
- [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)
551
- CSS property of its content element).
552
- */
553
- get lineWrapping(): any;
554
- /**
555
- Returns the bidirectional text structure of the given line
556
- (which should be in the current document) as an array of span
557
- objects. The order of these spans matches the [text
558
- direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)—if that is
559
- left-to-right, the leftmost spans come first, otherwise the
560
- rightmost spans come first.
561
- */
562
- bidiSpans(line: any): any;
563
- /**
564
- Check whether the editor has focus.
565
- */
566
- get hasFocus(): boolean;
567
- /**
568
- Put focus on the editor.
569
- */
570
- focus(): void;
571
- /**
572
- Update the [root](https://codemirror.net/6/docs/ref/##view.EditorViewConfig.root) in which the editor lives. This is only
573
- necessary when moving the editor's existing DOM to a new window or shadow root.
574
- */
575
- setRoot(root: any): void;
576
- /**
577
- Clean up this editor view, removing its element from the
578
- document, unregistering event handlers, and notifying
579
- plugins. The view instance can no longer be used after
580
- calling this.
581
- */
582
- destroy(): void;
583
- /**
584
- Return an effect that resets the editor to its current (at the
585
- time this method was called) scroll position. Note that this
586
- only affects the editor's own scrollable element, not parents.
587
- See also
588
- [`EditorViewConfig.scrollTo`](https://codemirror.net/6/docs/ref/#view.EditorViewConfig.scrollTo).
589
-
590
- The effect should be used with a document identical to the one
591
- it was created for. Failing to do so is not an error, but may
592
- not scroll to the expected position. You can
593
- [map](https://codemirror.net/6/docs/ref/#state.StateEffect.map) the effect to account for changes.
594
- */
595
- scrollSnapshot(): StateEffect;
596
- /**
597
- Enable or disable tab-focus mode, which disables key bindings
598
- for Tab and Shift-Tab, letting the browser's default
599
- focus-changing behavior go through instead. This is useful to
600
- prevent trapping keyboard users in your editor.
601
-
602
- Without argument, this toggles the mode. With a boolean, it
603
- enables (true) or disables it (false). Given a number, it
604
- temporarily enables the mode until that number of milliseconds
605
- have passed or another non-Tab key is pressed.
606
- */
607
- setTabFocusMode(to: any): void;
608
- }
609
- export namespace EditorView {
610
- export { styleModule };
611
- export { inputHandler$1 as inputHandler };
612
- export { clipboardInputFilter };
613
- export { clipboardOutputFilter };
614
- export { scrollHandler };
615
- export { focusChangeEffect };
616
- export { perLineTextDirection };
617
- export { exceptionSink };
618
- export { updateListener };
619
- export { editable };
620
- export { mouseSelectionStyle };
621
- export { dragMovesSelection$1 as dragMovesSelection };
622
- export { clickAddsSelectionRange };
623
- export { decorations };
624
- export { outerDecorations };
625
- export { atomicRanges };
626
- export { bidiIsolatedRanges };
627
- export { scrollMargins };
628
- export { darkTheme };
629
- export let cspNonce: Facet;
630
- export { contentAttributes };
631
- export { editorAttributes };
632
- export let lineWrapping: FacetProvider;
633
- export let announce: StateEffectType;
634
- }
635
- /**
636
- A highlight style associates CSS styles with higlighting
637
- [tags](https://lezer.codemirror.net/docs/ref#highlight.Tag).
638
- */
639
- export class HighlightStyle {
640
- /**
641
- Create a highlighter style that associates the given styles to
642
- the given tags. The specs must be objects that hold a style tag
643
- or array of tags in their `tag` property, and either a single
644
- `class` property providing a static CSS class (for highlighter
645
- that rely on external styling), or a
646
- [`style-mod`](https://github.com/marijnh/style-mod#documentation)-style
647
- set of CSS properties (which define the styling for those tags).
648
-
649
- The CSS rules created for a highlighter will be emitted in the
650
- order of the spec's properties. That means that for elements that
651
- have multiple tags associated with them, styles defined further
652
- down in the list will have a higher CSS precedence than styles
653
- defined earlier.
654
- */
655
- static define(specs: any, options: any): HighlightStyle;
656
- constructor(specs: any, options: any);
657
- specs: any;
658
- scope: ((type: any) => boolean) | undefined;
659
- style: (tags: any) => any;
660
- module: StyleModule | null;
661
- themeType: any;
662
- }
663
- export function Store(initialState: any): any;
664
- /**
665
- This is an extension value that just pulls together a number of
666
- extensions that you might want in a basic editor. It is meant as a
667
- convenient helper to quickly set up CodeMirror without installing
668
- and importing a lot of separate packages.
669
-
670
- Specifically, it includes...
671
-
672
- - [the default command bindings](https://codemirror.net/6/docs/ref/#commands.defaultKeymap)
673
- - [line numbers](https://codemirror.net/6/docs/ref/#view.lineNumbers)
674
- - [special character highlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars)
675
- - [the undo history](https://codemirror.net/6/docs/ref/#commands.history)
676
- - [a fold gutter](https://codemirror.net/6/docs/ref/#language.foldGutter)
677
- - [custom selection drawing](https://codemirror.net/6/docs/ref/#view.drawSelection)
678
- - [drop cursor](https://codemirror.net/6/docs/ref/#view.dropCursor)
679
- - [multiple selections](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)
680
- - [reindentation on input](https://codemirror.net/6/docs/ref/#language.indentOnInput)
681
- - [the default highlight style](https://codemirror.net/6/docs/ref/#language.defaultHighlightStyle) (as fallback)
682
- - [bracket matching](https://codemirror.net/6/docs/ref/#language.bracketMatching)
683
- - [bracket closing](https://codemirror.net/6/docs/ref/#autocomplete.closeBrackets)
684
- - [autocompletion](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion)
685
- - [rectangular selection](https://codemirror.net/6/docs/ref/#view.rectangularSelection) and [crosshair cursor](https://codemirror.net/6/docs/ref/#view.crosshairCursor)
686
- - [active line highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLine)
687
- - [active line gutter highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLineGutter)
688
- - [selection match highlighting](https://codemirror.net/6/docs/ref/#search.highlightSelectionMatches)
689
- - [search](https://codemirror.net/6/docs/ref/#search.searchKeymap)
690
- - [linting](https://codemirror.net/6/docs/ref/#lint.lintKeymap)
691
-
692
- (You'll probably want to add some language package to your setup
693
- too.)
694
-
695
- This extension does not allow customization. The idea is that,
696
- once you decide you want to configure your editor more precisely,
697
- you take this package's source (which is just a bunch of imports
698
- and an array literal), copy it into your own code, and adjust it
699
- as desired.
700
- */
701
- export const basicSetup: (any[] | FacetProvider | ViewPlugin)[];
702
- /**
703
- JSON language support.
704
- */
705
- export function json(): LanguageSupport;
706
- export function prettyBytes(number: any, options: any): any;
707
- export function prettyMilliseconds(milliseconds: any, options: any): string;
708
- /**
709
- Wrap a highlighter in an editor extension that uses it to apply
710
- syntax highlighting to the editor content.
711
-
712
- When multiple (non-fallback) styles are provided, the styling
713
- applied is the union of the classes they emit.
714
- */
715
- export function syntaxHighlighting(highlighter: any, options: any): PrecExtension[];
716
- export namespace tags {
717
- export { comment };
718
- export let lineComment: Tag;
719
- export let blockComment: Tag;
720
- export let docComment: Tag;
721
- export { name };
722
- export let variableName: Tag;
723
- export { typeName };
724
- export let tagName: Tag;
725
- export { propertyName };
726
- export let attributeName: Tag;
727
- export let className: Tag;
728
- export let labelName: Tag;
729
- export let namespace: Tag;
730
- export let macroName: Tag;
731
- export { literal };
732
- export { string };
733
- export let docString: Tag;
734
- export let character: Tag;
735
- export let attributeValue: Tag;
736
- export { number };
737
- export let integer: Tag;
738
- export let float: Tag;
739
- export let bool: Tag;
740
- export let regexp: Tag;
741
- export let escape: Tag;
742
- export let color: Tag;
743
- export let url: Tag;
744
- export { keyword };
745
- export let self: Tag;
746
- let _null: Tag;
747
- export { _null as null };
748
- export let atom: Tag;
749
- export let unit: Tag;
750
- export let modifier: Tag;
751
- export let operatorKeyword: Tag;
752
- export let controlKeyword: Tag;
753
- export let definitionKeyword: Tag;
754
- export let moduleKeyword: Tag;
755
- export { operator };
756
- export let derefOperator: Tag;
757
- export let arithmeticOperator: Tag;
758
- export let logicOperator: Tag;
759
- export let bitwiseOperator: Tag;
760
- export let compareOperator: Tag;
761
- export let updateOperator: Tag;
762
- export let definitionOperator: Tag;
763
- export let typeOperator: Tag;
764
- export let controlOperator: Tag;
765
- export { punctuation };
766
- export let separator: Tag;
767
- export { bracket };
768
- export let angleBracket: Tag;
769
- export let squareBracket: Tag;
770
- export let paren: Tag;
771
- export let brace: Tag;
772
- export { content };
773
- export { heading };
774
- export let heading1: Tag;
775
- export let heading2: Tag;
776
- export let heading3: Tag;
777
- export let heading4: Tag;
778
- export let heading5: Tag;
779
- export let heading6: Tag;
780
- export let contentSeparator: Tag;
781
- export let list: Tag;
782
- export let quote: Tag;
783
- export let emphasis: Tag;
784
- export let strong: Tag;
785
- export let link: Tag;
786
- export let monospace: Tag;
787
- export let strikethrough: Tag;
788
- export let inserted: Tag;
789
- export let deleted: Tag;
790
- export let changed: Tag;
791
- export let invalid: Tag;
792
- export { meta };
793
- export let documentMeta: Tag;
794
- export let annotation: Tag;
795
- export let processingInstruction: Tag;
796
- export function definition(tag: any): any;
797
- export function constant(tag: any): any;
798
- export function _function(tag: any): any;
799
- export { _function as function };
800
- export function standard(tag: any): any;
801
- export function local(tag: any): any;
802
- export function special(tag: any): any;
803
- }
804
- /**
805
- A change set represents a group of modifications to a document. It
806
- stores the document length, and can only be applied to documents
807
- with exactly that length.
808
- */
809
- declare class ChangeSet extends ChangeDesc {
810
- /**
811
- Create a change set for the given changes, for a document of the
812
- given length, using `lineSep` as line separator.
813
- */
814
- static of(changes: any, length: any, lineSep: any): null;
815
- /**
816
- Create an empty changeset of the given length.
817
- */
818
- static empty(length: any): ChangeSet;
819
- /**
820
- Create a changeset from its JSON representation (as produced by
821
- [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON).
822
- */
823
- static fromJSON(json: any): ChangeSet;
824
- /**
825
- @internal
826
- */
827
- static createSet(sections: any, inserted: any): ChangeSet;
828
- constructor(sections: any, inserted: any);
829
- inserted: any;
830
- /**
831
- Apply the changes to a document, returning the modified
832
- document.
833
- */
834
- apply(doc: any): any;
835
- /**
836
- Given the document as it existed _before_ the changes, return a
837
- change set that represents the inverse of this set, which could
838
- be used to go from the document created by the changes back to
839
- the document as it existed before the changes.
840
- */
841
- invert(doc: any): ChangeSet;
842
- /**
843
- Combine two subsequent change sets into a single set. `other`
844
- must start in the document produced by `this`. If `this` goes
845
- `docA` → `docB` and `other` represents `docB` → `docC`, the
846
- returned value will represent the change `docA` → `docC`.
847
- */
848
- compose(other: any): any;
849
- /**
850
- Given another change set starting in the same document, maps this
851
- change set over the other, producing a new change set that can be
852
- applied to the document produced by applying `other`. When
853
- `before` is `true`, order changes as if `this` comes before
854
- `other`, otherwise (the default) treat `other` as coming first.
855
-
856
- Given two changes `A` and `B`, `A.compose(B.map(A))` and
857
- `B.compose(A.map(B, true))` will produce the same document. This
858
- provides a basic form of [operational
859
- transformation](https://en.wikipedia.org/wiki/Operational_transformation),
860
- and can be used for collaborative editing.
861
- */
862
- map(other: any, before?: boolean): ChangeDesc;
863
- /**
864
- Iterate over the changed ranges in the document, calling `f` for
865
- each, with the range in the original document (`fromA`-`toA`)
866
- and the range that replaces it in the new document
867
- (`fromB`-`toB`).
868
-
869
- When `individual` is true, adjacent changes are reported
870
- separately.
871
- */
872
- iterChanges(f: any, individual?: boolean): void;
873
- /**
874
- Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change
875
- set.
876
- */
877
- get desc(): ChangeDesc;
878
- /**
879
- @internal
880
- */
881
- filter(ranges: any): {
882
- changes: ChangeSet;
883
- filtered: ChangeDesc;
884
- };
885
- /**
886
- Serialize this change set to a JSON-representable value.
887
- */
888
- toJSON(): any[];
889
- }
890
- /**
891
- An editor selection holds one or more selection ranges.
892
- */
893
- declare class EditorSelection {
894
- /**
895
- Create a selection from a JSON representation.
896
- */
897
- static fromJSON(json: any): EditorSelection;
898
- /**
899
- Create a selection holding a single range.
900
- */
901
- static single(anchor: any, head?: any): EditorSelection;
902
- /**
903
- Sort and merge the given set of ranges, creating a valid
904
- selection.
905
- */
906
- static create(ranges: any, mainIndex?: number): EditorSelection;
907
- /**
908
- Create a cursor selection range at the given position. You can
909
- safely ignore the optional arguments in most situations.
910
- */
911
- static cursor(pos: any, assoc: number | undefined, bidiLevel: any, goalColumn: any): SelectionRange;
912
- /**
913
- Create a selection range.
914
- */
915
- static range(anchor: any, head: any, goalColumn: any, bidiLevel: any): SelectionRange;
916
- /**
917
- @internal
918
- */
919
- static normalized(ranges: any, mainIndex?: number): EditorSelection;
920
- constructor(ranges: any, mainIndex: any);
921
- ranges: any;
922
- mainIndex: any;
923
- /**
924
- Map a selection through a change. Used to adjust the selection
925
- position for changes.
926
- */
927
- map(change: any, assoc?: number): EditorSelection;
928
- /**
929
- Compare this selection to another selection. By default, ranges
930
- are compared only by position. When `includeAssoc` is true,
931
- cursor ranges must also have the same
932
- [`assoc`](https://codemirror.net/6/docs/ref/#state.SelectionRange.assoc) value.
933
- */
934
- eq(other: any, includeAssoc?: boolean): boolean;
935
- /**
936
- Get the primary selection range. Usually, you should make sure
937
- your code applies to _all_ ranges, by using methods like
938
- [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange).
939
- */
940
- get main(): any;
941
- /**
942
- Make sure the selection only has one range. Returns a selection
943
- holding only the main range from this selection.
944
- */
945
- asSingle(): EditorSelection;
946
- /**
947
- Extend this selection with an extra range.
948
- */
949
- addRange(range: any, main?: boolean): EditorSelection;
950
- /**
951
- Replace a given range with another range, and then normalize the
952
- selection to merge and sort ranges if necessary.
953
- */
954
- replaceRange(range: any, which?: any): EditorSelection;
955
- /**
956
- Convert this selection to an object that can be serialized to
957
- JSON.
958
- */
959
- toJSON(): {
960
- ranges: any;
961
- main: any;
962
- };
963
- }
964
- /**
965
- A single selection range. When
966
- [`allowMultipleSelections`](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)
967
- is enabled, a [selection](https://codemirror.net/6/docs/ref/#state.EditorSelection) may hold
968
- multiple ranges. By default, selections hold exactly one range.
969
- */
970
- declare class SelectionRange {
971
- /**
972
- Convert a JSON representation of a range to a `SelectionRange`
973
- instance.
974
- */
975
- static fromJSON(json: any): SelectionRange;
976
- /**
977
- @internal
978
- */
979
- static create(from: any, to: any, flags: any): SelectionRange;
980
- constructor(from: any, to: any, flags: any);
981
- from: any;
982
- to: any;
983
- flags: any;
984
- /**
985
- The anchor of the range—the side that doesn't move when you
986
- extend it.
987
- */
988
- get anchor(): any;
989
- /**
990
- The head of the range, which is moved when the range is
991
- [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend).
992
- */
993
- get head(): any;
994
- /**
995
- True when `anchor` and `head` are at the same position.
996
- */
997
- get empty(): boolean;
998
- /**
999
- If this is a cursor that is explicitly associated with the
1000
- character on one of its sides, this returns the side. -1 means
1001
- the character before its position, 1 the character after, and 0
1002
- means no association.
1003
- */
1004
- get assoc(): 0 | 1 | -1;
1005
- /**
1006
- The bidirectional text level associated with this cursor, if
1007
- any.
1008
- */
1009
- get bidiLevel(): number | null;
1010
- /**
1011
- The goal column (stored vertical offset) associated with a
1012
- cursor. This is used to preserve the vertical position when
1013
- [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across
1014
- lines of different length.
1015
- */
1016
- get goalColumn(): number | undefined;
1017
- /**
1018
- Map this range through a change, producing a valid range in the
1019
- updated document.
1020
- */
1021
- map(change: any, assoc?: number): SelectionRange;
1022
- /**
1023
- Extend this range to cover at least `from` to `to`.
1024
- */
1025
- extend(from: any, to?: any): SelectionRange;
1026
- /**
1027
- Compare this range to another range.
1028
- */
1029
- eq(other: any, includeAssoc?: boolean): boolean;
1030
- /**
1031
- Return a JSON-serializable object representing the range.
1032
- */
1033
- toJSON(): {
1034
- anchor: any;
1035
- head: any;
1036
- };
1037
- }
1038
- declare const allowMultipleSelections: Facet;
1039
- /**
1040
- A facet is a labeled value that is associated with an editor
1041
- state. It takes inputs from any number of extensions, and combines
1042
- those into a single output value.
1043
-
1044
- Examples of uses of facets are the [tab
1045
- size](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize), [editor
1046
- attributes](https://codemirror.net/6/docs/ref/#view.EditorView^editorAttributes), and [update
1047
- listeners](https://codemirror.net/6/docs/ref/#view.EditorView^updateListener).
1048
-
1049
- Note that `Facet` instances can be used anywhere where
1050
- [`FacetReader`](https://codemirror.net/6/docs/ref/#state.FacetReader) is expected.
1051
- */
1052
- declare class Facet {
1053
- /**
1054
- Define a new facet.
1055
- */
1056
- static define(config?: {}): Facet;
1057
- constructor(combine: any, compareInput: any, compare: any, isStatic: any, enables: any);
1058
- combine: any;
1059
- compareInput: any;
1060
- compare: any;
1061
- isStatic: any;
1062
- /**
1063
- @internal
1064
- */
1065
- id: number;
1066
- default: any;
1067
- extensions: any;
1068
- /**
1069
- Returns a facet reader for this facet, which can be used to
1070
- [read](https://codemirror.net/6/docs/ref/#state.EditorState.facet) it but not to define values for it.
1071
- */
1072
- get reader(): this;
1073
- /**
1074
- Returns an extension that adds the given value to this facet.
1075
- */
1076
- of(value: any): FacetProvider;
1077
- /**
1078
- Create an extension that computes a value for the facet from a
1079
- state. You must take care to declare the parts of the state that
1080
- this value depends on, since your function is only called again
1081
- for a new state when one of those parts changed.
1082
-
1083
- In cases where your value depends only on a single field, you'll
1084
- want to use the [`from`](https://codemirror.net/6/docs/ref/#state.Facet.from) method instead.
1085
- */
1086
- compute(deps: any, get: any): FacetProvider;
1087
- /**
1088
- Create an extension that computes zero or more values for this
1089
- facet from a state.
1090
- */
1091
- computeN(deps: any, get: any): FacetProvider;
1092
- from(field: any, get: any): FacetProvider;
1093
- }
1094
- declare const lineSeparator: Facet;
1095
- declare const readOnly: Facet;
1096
- declare const languageData: Facet;
1097
- declare const changeFilter: Facet;
1098
- declare const transactionFilter: Facet;
1099
- declare const transactionExtender: Facet;
1100
- declare class Viewport {
1101
- constructor(from: any, to: any);
1102
- from: any;
1103
- to: any;
1104
- }
1105
- declare class ViewState {
1106
- constructor(state: any);
1107
- state: any;
1108
- pixelViewport: {
1109
- left: number;
1110
- right: number;
1111
- top: number;
1112
- bottom: number;
1113
- };
1114
- inView: boolean;
1115
- paddingTop: number;
1116
- paddingBottom: number;
1117
- contentDOMWidth: number;
1118
- contentDOMHeight: number;
1119
- editorHeight: number;
1120
- editorWidth: number;
1121
- scrollTop: number;
1122
- scrolledToBottom: boolean;
1123
- scaleX: number;
1124
- scaleY: number;
1125
- scrollAnchorPos: number;
1126
- scrollAnchorHeight: number;
1127
- scaler: {
1128
- toDOM(n: any): any;
1129
- fromDOM(n: any): any;
1130
- scale: number;
1131
- eq(other: any): boolean;
1132
- };
1133
- scrollTarget: any;
1134
- printing: boolean;
1135
- mustMeasureContent: boolean;
1136
- defaultTextDirection: any;
1137
- visibleRanges: any[];
1138
- mustEnforceCursorAssoc: boolean;
1139
- heightOracle: HeightOracle;
1140
- stateDeco: any;
1141
- heightMap: any;
1142
- viewport: Viewport | undefined;
1143
- lineGaps: any[];
1144
- lineGapDeco: any;
1145
- updateForViewport(): 0 | 2;
1146
- viewports: (Viewport | undefined)[] | undefined;
1147
- updateScaler(): 0 | 2;
1148
- updateViewportLines(): void;
1149
- viewportLines: any[] | undefined;
1150
- update(update: any, scrollTarget?: null): void;
1151
- measure(view: any): number;
1152
- get visibleTop(): any;
1153
- get visibleBottom(): any;
1154
- getViewport(bias: any, scrollTarget: any): Viewport;
1155
- mapViewport(viewport: any, changes: any): Viewport;
1156
- viewportIsAppropriate({ from, to }: {
1157
- from: any;
1158
- to: any;
1159
- }, bias?: number): boolean;
1160
- mapLineGaps(gaps: any, changes: any): any;
1161
- ensureLineGaps(current: any, mayMeasure: any): any[];
1162
- gapSize(line: any, from: any, to: any, structure: any): number;
1163
- updateLineGaps(gaps: any): void;
1164
- computeVisibleRanges(changes: any): number;
1165
- lineBlockAt(pos: any): any;
1166
- lineBlockAtHeight(height: any): any;
1167
- scrollAnchorAt(scrollTop: any): any;
1168
- elementAtHeight(height: any): any;
1169
- get docHeight(): any;
1170
- get contentHeight(): any;
1171
- }
1172
- declare class DOMObserver {
1173
- constructor(view: any);
1174
- view: any;
1175
- active: boolean;
1176
- editContext: EditContextManager | null;
1177
- selectionRange: DOMSelectionState;
1178
- selectionChanged: boolean;
1179
- delayedFlush: number;
1180
- resizeTimeout: number;
1181
- queue: any[];
1182
- delayedAndroidKey: any;
1183
- flushingAndroidKey: number;
1184
- lastChange: number;
1185
- scrollTargets: any[];
1186
- intersection: IntersectionObserver | null;
1187
- resizeScroll: ResizeObserver | null;
1188
- intersecting: boolean;
1189
- gapIntersection: IntersectionObserver | null;
1190
- gaps: any[];
1191
- printQuery: MediaQueryList | null;
1192
- parentCheck: number;
1193
- dom: any;
1194
- observer: MutationObserver;
1195
- onCharData: ((event: any) => void) | undefined;
1196
- onSelectionChange(event: any): void;
1197
- onResize(): void;
1198
- onPrint(event: any): void;
1199
- onScroll(e: any): void;
1200
- win: any;
1201
- onScrollChanged(e: any): void;
1202
- updateGaps(gaps: any): void;
1203
- readSelectionRange(): boolean;
1204
- setSelectionRange(anchor: any, head: any): void;
1205
- clearSelectionRange(): void;
1206
- listenForScroll(): void;
1207
- ignore(f: any): any;
1208
- start(): void;
1209
- stop(): void;
1210
- clear(): void;
1211
- delayAndroidKey(key: any, keyCode: any): void;
1212
- clearDelayedAndroidKey(): void;
1213
- flushSoon(): void;
1214
- forceFlush(): void;
1215
- pendingRecords(): any[];
1216
- processRecords(): {
1217
- from: number;
1218
- to: number;
1219
- typeOver: boolean;
1220
- };
1221
- readChange(): DOMChange | null;
1222
- flush(readSelection?: boolean): boolean;
1223
- readMutation(rec: any): {
1224
- from: any;
1225
- to: any;
1226
- typeOver: boolean;
1227
- } | null;
1228
- setWindow(win: any): void;
1229
- addWindowListeners(win: any): void;
1230
- removeWindowListeners(win: any): void;
1231
- update(update: any): void;
1232
- destroy(): void;
1233
- }
1234
- declare class InputState {
1235
- constructor(view: any);
1236
- setSelectionOrigin(origin: any): void;
1237
- lastSelectionOrigin: any;
1238
- lastSelectionTime: number;
1239
- view: any;
1240
- lastKeyCode: number;
1241
- lastKeyTime: number;
1242
- lastTouchTime: number;
1243
- lastFocusTime: number;
1244
- lastScrollTop: number;
1245
- lastScrollLeft: number;
1246
- pendingIOSKey: any;
1247
- /**
1248
- When enabled (>-1), tab presses are not given to key handlers,
1249
- leaving the browser's default behavior. If >0, the mode expires
1250
- at that timestamp, and any other keypress clears it.
1251
- Esc enables temporary tab focus mode for two seconds when not
1252
- otherwise handled.
1253
- */
1254
- tabFocusMode: number;
1255
- lastContextMenu: number;
1256
- scrollHandlers: any[];
1257
- handlers: any;
1258
- composing: number;
1259
- compositionFirstChange: any;
1260
- compositionEndedAt: number;
1261
- compositionPendingKey: boolean;
1262
- compositionPendingChange: boolean;
1263
- mouseSelection: any;
1264
- draggedContent: any;
1265
- handleEvent(event: any): void;
1266
- notifiedFocused: any;
1267
- runHandlers(type: any, event: any): void;
1268
- ensureHandlers(plugins: any): void;
1269
- keydown(event: any): boolean;
1270
- flushIOSKey(change: any): boolean;
1271
- ignoreDuringComposition(event: any): boolean;
1272
- startMouseSelection(mouseSelection: any): void;
1273
- update(update: any): void;
1274
- destroy(): void;
1275
- }
1276
- declare class DocView extends ContentView {
1277
- constructor(view: any);
1278
- get length(): any;
1279
- view: any;
1280
- decorations: any[];
1281
- dynamicDecorationMap: boolean[];
1282
- domChanged: any;
1283
- hasComposition: {
1284
- from: any;
1285
- to: any;
1286
- } | null;
1287
- markedForComposition: Set<any>;
1288
- editContextFormatting: RangeSet;
1289
- lastCompositionAfterCursor: boolean;
1290
- minWidth: number;
1291
- minWidthFrom: number;
1292
- minWidthTo: number;
1293
- impreciseAnchor: DOMPos | null;
1294
- impreciseHead: DOMPos | null;
1295
- forceSelection: boolean;
1296
- lastUpdate: number;
1297
- children: LineView[];
1298
- update(update: any): boolean;
1299
- updateInner(changes: any, oldLength: any, composition: any): void;
1300
- updateChildren(changes: any, oldLength: any, composition: any): void;
1301
- updateEditContextFormatting(update: any): void;
1302
- compositionView(composition: any): LineView;
1303
- fixCompositionDOM(composition: any): void;
1304
- updateSelection(mustRead?: boolean, fromPointer?: boolean): void;
1305
- suppressWidgetCursorChange(sel: any, cursor: any): any;
1306
- enforceCursorAssoc(): void;
1307
- moveToLine(pos: any): any;
1308
- nearest(dom: any): any;
1309
- posFromDOM(node: any, offset: any): any;
1310
- domAtPos(pos: any): any;
1311
- coordsAt(pos: any, side: any): any;
1312
- coordsForChar(pos: any): any;
1313
- measureVisibleLineHeights(viewport: any): any[];
1314
- textDirectionAt(pos: any): any;
1315
- measureTextSize(): {
1316
- lineHeight: any;
1317
- charWidth: number;
1318
- textHeight: any;
1319
- } | {
1320
- lineHeight: undefined;
1321
- charWidth: undefined;
1322
- textHeight: undefined;
1323
- };
1324
- computeBlockGapDeco(): any;
1325
- updateDeco(): any[];
1326
- scrollIntoView(target: any): true | undefined;
1327
- }
1328
- /**
1329
- State effects can be used to represent additional effects
1330
- associated with a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction.effects). They
1331
- are often useful to model changes to custom [state
1332
- fields](https://codemirror.net/6/docs/ref/#state.StateField), when those changes aren't implicit in
1333
- document or selection changes.
1334
- */
1335
- declare class StateEffect {
1336
- /**
1337
- Define a new effect type. The type parameter indicates the type
1338
- of values that his effect holds. It should be a type that
1339
- doesn't include `undefined`, since that is used in
1340
- [mapping](https://codemirror.net/6/docs/ref/#state.StateEffect.map) to indicate that an effect is
1341
- removed.
1342
- */
1343
- static define(spec?: {}): StateEffectType;
1344
- /**
1345
- Map an array of effects through a change set.
1346
- */
1347
- static mapEffects(effects: any, mapping: any): any;
1348
- /**
1349
- @internal
1350
- */
1351
- constructor(type: any, value: any);
1352
- type: any;
1353
- value: any;
1354
- /**
1355
- Map this effect through a position mapping. Will return
1356
- `undefined` when that ends up deleting the effect.
1357
- */
1358
- map(mapping: any): StateEffect | undefined;
1359
- /**
1360
- Tells you whether this effect object is of a given
1361
- [type](https://codemirror.net/6/docs/ref/#state.StateEffectType).
1362
- */
1363
- is(type: any): boolean;
1364
- }
1365
- declare namespace StateEffect {
1366
- let reconfigure: StateEffectType;
1367
- let appendConfig: StateEffectType;
1368
- }
1369
- /**
1370
- View plugins associate stateful values with a view. They can
1371
- influence the way the content is drawn, and are notified of things
1372
- that happen in the view.
1373
- */
1374
- declare class ViewPlugin {
1375
- /**
1376
- Define a plugin from a constructor function that creates the
1377
- plugin's value, given an editor view.
1378
- */
1379
- static define(create: any, spec: any): ViewPlugin;
1380
- /**
1381
- Create a plugin for a class whose constructor takes a single
1382
- editor view as argument.
1383
- */
1384
- static fromClass(cls: any, spec: any): ViewPlugin;
1385
- constructor(id: any, create: any, domEventHandlers: any, domEventObservers: any, buildExtensions: any);
1386
- id: any;
1387
- create: any;
1388
- domEventHandlers: any;
1389
- domEventObservers: any;
1390
- extension: any;
1391
- }
1392
- declare class FacetProvider {
1393
- constructor(dependencies: any, facet: any, type: any, value: any);
1394
- dependencies: any;
1395
- facet: any;
1396
- type: any;
1397
- value: any;
1398
- id: number;
1399
- dynamicSlot(addresses: any): {
1400
- create(state: any): number;
1401
- update(state: any, tr: any): 0 | 1;
1402
- reconfigure: (state: any, oldState: any) => 0 | 1;
1403
- };
1404
- }
1405
- declare class PrecExtension {
1406
- constructor(inner: any, prec: any);
1407
- inner: any;
1408
- prec: any;
1409
- }
1410
- declare const styleModule: Facet;
1411
- declare const inputHandler$1: Facet;
1412
- declare const clipboardInputFilter: Facet;
1413
- declare const clipboardOutputFilter: Facet;
1414
- declare const scrollHandler: Facet;
1415
- declare const focusChangeEffect: Facet;
1416
- declare const perLineTextDirection: Facet;
1417
- declare const exceptionSink: Facet;
1418
- declare const updateListener: Facet;
1419
- declare const editable: Facet;
1420
- declare const mouseSelectionStyle: Facet;
1421
- declare const dragMovesSelection$1: Facet;
1422
- declare const clickAddsSelectionRange: Facet;
1423
- declare const decorations: Facet;
1424
- declare const outerDecorations: Facet;
1425
- declare const atomicRanges: Facet;
1426
- declare const bidiIsolatedRanges: Facet;
1427
- declare const scrollMargins: Facet;
1428
- declare const darkTheme: Facet;
1429
- declare const contentAttributes: Facet;
1430
- declare const editorAttributes: Facet;
1431
- /**
1432
- Representation of a type of state effect. Defined with
1433
- [`StateEffect.define`](https://codemirror.net/6/docs/ref/#state.StateEffect^define).
1434
- */
1435
- declare class StateEffectType {
1436
- /**
1437
- @internal
1438
- */
1439
- constructor(map: any);
1440
- map: any;
1441
- /**
1442
- Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this
1443
- type.
1444
- */
1445
- of(value: any): StateEffect;
1446
- }
1447
- declare class StyleModule {
1448
- static newName(): string;
1449
- static mount(root: any, modules: any, options: any): void;
1450
- constructor(spec: any, options: any);
1451
- rules: any[];
1452
- getRules(): string;
1453
- }
1454
- /**
1455
- This class bundles a [language](https://codemirror.net/6/docs/ref/#language.Language) with an
1456
- optional set of supporting extensions. Language packages are
1457
- encouraged to export a function that optionally takes a
1458
- configuration object and returns a `LanguageSupport` instance, as
1459
- the main way for client code to use the package.
1460
- */
1461
- declare class LanguageSupport {
1462
- /**
1463
- Create a language support object.
1464
- */
1465
- constructor(language: any, support?: any[]);
1466
- language: any;
1467
- support: any[];
1468
- extension: any[];
1469
- }
1470
- declare const comment: Tag;
1471
- /**
1472
- Highlighting tags are markers that denote a highlighting category.
1473
- They are [associated](#highlight.styleTags) with parts of a syntax
1474
- tree by a language mode, and then mapped to an actual CSS style by
1475
- a [highlighter](#highlight.Highlighter).
1476
-
1477
- Because syntax tree node types and highlight styles have to be
1478
- able to talk the same language, CodeMirror uses a mostly _closed_
1479
- [vocabulary](#highlight.tags) of syntax tags (as opposed to
1480
- traditional open string-based systems, which make it hard for
1481
- highlighting themes to cover all the tokens produced by the
1482
- various languages).
1483
-
1484
- It _is_ possible to [define](#highlight.Tag^define) your own
1485
- highlighting tags for system-internal use (where you control both
1486
- the language package and the highlighter), but such tags will not
1487
- be picked up by regular highlighters (though you can derive them
1488
- from standard tags to allow highlighters to fall back to those).
1489
- */
1490
- declare class Tag {
1491
- static define(nameOrParent: any, parent: any): Tag;
1492
- /**
1493
- Define a tag _modifier_, which is a function that, given a tag,
1494
- will return a tag that is a subtag of the original. Applying the
1495
- same modifier to a twice tag will return the same value (`m1(t1)
1496
- == m1(t1)`) and applying multiple modifiers will, regardless or
1497
- order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
1498
-
1499
- When multiple modifiers are applied to a given base tag, each
1500
- smaller set of modifiers is registered as a parent, so that for
1501
- example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
1502
- `m1(m3(t1)`, and so on.
1503
- */
1504
- static defineModifier(name: any): (tag: any) => any;
1505
- /**
1506
- @internal
1507
- */
1508
- constructor(name: any, set: any, base: any, modified: any);
1509
- name: any;
1510
- set: any;
1511
- base: any;
1512
- modified: any;
1513
- /**
1514
- @internal
1515
- */
1516
- id: number;
1517
- toString(): any;
1518
- }
1519
- declare const name: Tag;
1520
- declare const typeName: Tag;
1521
- declare const propertyName: Tag;
1522
- declare const literal: Tag;
1523
- declare const string: Tag;
1524
- declare const number: Tag;
1525
- declare const keyword: Tag;
1526
- declare const operator: Tag;
1527
- declare const punctuation: Tag;
1528
- declare const bracket: Tag;
1529
- declare const content: Tag;
1530
- declare const heading: Tag;
1531
- declare const meta: Tag;
1532
- /**
1533
- A change description is a variant of [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet)
1534
- that doesn't store the inserted text. As such, it can't be
1535
- applied, but is cheaper to store and manipulate.
1536
- */
1537
- declare class ChangeDesc {
1538
- /**
1539
- Create a change desc from its JSON representation (as produced
1540
- by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON).
1541
- */
1542
- static fromJSON(json: any): ChangeDesc;
1543
- /**
1544
- @internal
1545
- */
1546
- static create(sections: any): ChangeDesc;
1547
- /**
1548
- @internal
1549
- */
1550
- constructor(sections: any);
1551
- sections: any;
1552
- /**
1553
- The length of the document before the change.
1554
- */
1555
- get length(): number;
1556
- /**
1557
- The length of the document after the change.
1558
- */
1559
- get newLength(): number;
1560
- /**
1561
- False when there are actual changes in this set.
1562
- */
1563
- get empty(): boolean;
1564
- /**
1565
- Iterate over the unchanged parts left by these changes. `posA`
1566
- provides the position of the range in the old document, `posB`
1567
- the new position in the changed document.
1568
- */
1569
- iterGaps(f: any): void;
1570
- /**
1571
- Iterate over the ranges changed by these changes. (See
1572
- [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a
1573
- variant that also provides you with the inserted text.)
1574
- `fromA`/`toA` provides the extent of the change in the starting
1575
- document, `fromB`/`toB` the extent of the replacement in the
1576
- changed document.
1577
-
1578
- When `individual` is true, adjacent changes (which are kept
1579
- separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are
1580
- reported separately.
1581
- */
1582
- iterChangedRanges(f: any, individual?: boolean): void;
1583
- /**
1584
- Get a description of the inverted form of these changes.
1585
- */
1586
- get invertedDesc(): ChangeDesc;
1587
- /**
1588
- Compute the combined effect of applying another set of changes
1589
- after this one. The length of the document after this set should
1590
- match the length before `other`.
1591
- */
1592
- composeDesc(other: any): any;
1593
- /**
1594
- Map this description, which should start with the same document
1595
- as `other`, over another set of changes, so that it can be
1596
- applied after it. When `before` is true, map as if the changes
1597
- in `this` happened before the ones in `other`.
1598
- */
1599
- mapDesc(other: any, before?: boolean): ChangeDesc;
1600
- mapPos(pos: any, assoc?: number, mode?: any): any;
1601
- /**
1602
- Check whether these changes touch a given range. When one of the
1603
- changes entirely covers the range, the string `"cover"` is
1604
- returned.
1605
- */
1606
- touchesRange(from: any, to?: any): boolean | "cover";
1607
- /**
1608
- @internal
1609
- */
1610
- toString(): string;
1611
- /**
1612
- Serialize this change desc to a JSON-representable value.
1613
- */
1614
- toJSON(): any;
1615
- }
1616
- declare class HeightOracle {
1617
- constructor(lineWrapping: any);
1618
- lineWrapping: any;
1619
- doc: TextLeaf;
1620
- heightSamples: {};
1621
- lineHeight: number;
1622
- charWidth: number;
1623
- textHeight: number;
1624
- lineLength: number;
1625
- heightForGap(from: any, to: any): number;
1626
- heightForLine(length: any): number;
1627
- setDoc(doc: any): this;
1628
- mustRefreshForWrapping(whiteSpace: any): boolean;
1629
- mustRefreshForHeights(lineHeights: any): boolean;
1630
- refresh(whiteSpace: any, lineHeight: any, charWidth: any, textHeight: any, lineLength: any, knownHeights: any): boolean;
1631
- }
1632
- declare class EditContextManager {
1633
- constructor(view: any);
1634
- from: number;
1635
- to: number;
1636
- pendingContextChange: {
1637
- from: any;
1638
- to: any;
1639
- insert: any;
1640
- } | null;
1641
- handlers: any;
1642
- composing: any;
1643
- editContext: any;
1644
- measureReq: {
1645
- read: (view: any) => void;
1646
- };
1647
- applyEdits(update: any): boolean;
1648
- update(update: any): void;
1649
- resetRange(state: any): void;
1650
- reset(state: any): void;
1651
- revertPending(state: any): void;
1652
- setSelection(state: any): void;
1653
- rangeIsValid(state: any): boolean;
1654
- toEditorPos(contextPos: any, clipLen?: number): any;
1655
- toContextPos(editorPos: any): any;
1656
- destroy(): void;
1657
- }
1658
- declare class DOMSelectionState {
1659
- anchorNode: any;
1660
- anchorOffset: number;
1661
- focusNode: any;
1662
- focusOffset: number;
1663
- eq(domSel: any): boolean;
1664
- setRange(range: any): void;
1665
- set(anchorNode: any, anchorOffset: any, focusNode: any, focusOffset: any): void;
1666
- }
1667
- declare class DOMChange {
1668
- constructor(view: any, start: any, end: any, typeOver: any);
1669
- typeOver: any;
1670
- bounds: any;
1671
- text: string;
1672
- domChanged: boolean;
1673
- newSel: EditorSelection | null;
1674
- }
1675
- declare class ContentView {
1676
- static get(node: any): any;
1677
- parent: any;
1678
- dom: any;
1679
- flags: number;
1680
- get overrideDOMText(): null;
1681
- get posAtStart(): any;
1682
- get posAtEnd(): any;
1683
- posBefore(view: any): any;
1684
- posAfter(view: any): any;
1685
- sync(view: any, track: any): void;
1686
- reuseDOM(_dom: any): void;
1687
- localPosFromDOM(node: any, offset: any): any;
1688
- domBoundsAround(from: any, to: any, offset?: number): any;
1689
- markDirty(andParent?: boolean): void;
1690
- markParentsDirty(childList: any): void;
1691
- setParent(parent: any): void;
1692
- setDOM(dom: any): void;
1693
- get rootView(): this;
1694
- replaceChildren(from: any, to: any, children?: any[]): void;
1695
- children: any;
1696
- ignoreMutation(_rec: any): boolean;
1697
- ignoreEvent(_event: any): boolean;
1698
- childCursor(pos?: any): ChildCursor;
1699
- childPos(pos: any, bias?: number): ChildCursor;
1700
- toString(): string;
1701
- get isEditable(): boolean;
1702
- get isWidget(): boolean;
1703
- get isHidden(): boolean;
1704
- merge(from: any, to: any, source: any, hasStart: any, openStart: any, openEnd: any): boolean;
1705
- become(other: any): boolean;
1706
- canReuseDOM(other: any): boolean;
1707
- getSide(): number;
1708
- destroy(): void;
1709
- breakAfter: number;
1710
- }
1711
- /**
1712
- A range set stores a collection of [ranges](https://codemirror.net/6/docs/ref/#state.Range) in a
1713
- way that makes them efficient to [map](https://codemirror.net/6/docs/ref/#state.RangeSet.map) and
1714
- [update](https://codemirror.net/6/docs/ref/#state.RangeSet.update). This is an immutable data
1715
- structure.
1716
- */
1717
- declare class RangeSet {
1718
- /**
1719
- @internal
1720
- */
1721
- static create(chunkPos: any, chunk: any, nextLayer: any, maxPoint: any): RangeSet;
1722
- /**
1723
- Iterate over the ranges in a collection of sets, in order,
1724
- starting from `from`.
1725
- */
1726
- static iter(sets: any, from?: number): LayerCursor | HeapCursor;
1727
- /**
1728
- Iterate over two groups of sets, calling methods on `comparator`
1729
- to notify it of possible differences.
1730
- */
1731
- static compare(oldSets: any, newSets: any, textDiff: any, comparator: any, minPointSize?: number): void;
1732
- /**
1733
- Compare the contents of two groups of range sets, returning true
1734
- if they are equivalent in the given range.
1735
- */
1736
- static eq(oldSets: any, newSets: any, from: number | undefined, to: any): boolean;
1737
- /**
1738
- Iterate over a group of range sets at the same time, notifying
1739
- the iterator about the ranges covering every given piece of
1740
- content. Returns the open count (see
1741
- [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end
1742
- of the iteration.
1743
- */
1744
- static spans(sets: any, from: any, to: any, iterator: any, minPointSize?: number): number;
1745
- /**
1746
- Create a range set for the given range or array of ranges. By
1747
- default, this expects the ranges to be _sorted_ (by start
1748
- position and, if two start at the same position,
1749
- `value.startSide`). You can pass `true` as second argument to
1750
- cause the method to sort them.
1751
- */
1752
- static of(ranges: any, sort?: boolean): any;
1753
- /**
1754
- Join an array of range sets into a single set.
1755
- */
1756
- static join(sets: any): any;
1757
- constructor(chunkPos: any, chunk: any, nextLayer: any, maxPoint: any);
1758
- chunkPos: any;
1759
- chunk: any;
1760
- nextLayer: any;
1761
- maxPoint: any;
1762
- /**
1763
- @internal
1764
- */
1765
- get length(): number;
1766
- /**
1767
- The number of ranges in the set.
1768
- */
1769
- get size(): any;
1770
- /**
1771
- @internal
1772
- */
1773
- chunkEnd(index: any): any;
1774
- /**
1775
- Update the range set, optionally adding new ranges or filtering
1776
- out existing ones.
1777
-
1778
- (Note: The type parameter is just there as a kludge to work
1779
- around TypeScript variance issues that prevented `RangeSet<X>`
1780
- from being a subtype of `RangeSet<Y>` when `X` is a subtype of
1781
- `Y`.)
1782
- */
1783
- update(updateSpec: any): any;
1784
- /**
1785
- Map this range set through a set of changes, return the new set.
1786
- */
1787
- map(changes: any): any;
1788
- /**
1789
- Iterate over the ranges that touch the region `from` to `to`,
1790
- calling `f` for each. There is no guarantee that the ranges will
1791
- be reported in any specific order. When the callback returns
1792
- `false`, iteration stops.
1793
- */
1794
- between(from: any, to: any, f: any): void;
1795
- /**
1796
- Iterate over the ranges in this set, in order, including all
1797
- ranges that end at or after `from`.
1798
- */
1799
- iter(from?: number): LayerCursor | HeapCursor;
1800
- /**
1801
- @internal
1802
- */
1803
- get isEmpty(): boolean;
1804
- }
1805
- declare namespace RangeSet {
1806
- let empty: RangeSet;
1807
- }
1808
- declare class DOMPos {
1809
- static before(dom: any, precise: any): DOMPos;
1810
- static after(dom: any, precise: any): DOMPos;
1811
- constructor(node: any, offset: any, precise?: boolean);
1812
- node: any;
1813
- offset: any;
1814
- precise: boolean;
1815
- }
1816
- declare class LineView extends ContentView {
1817
- static find(docView: any, pos: any): LineView | null;
1818
- constructor(...args: any[]);
1819
- children: any[];
1820
- length: number;
1821
- prevAttrs: any;
1822
- attrs: any;
1823
- split(at: any): LineView;
1824
- transferDOM(other: any): void;
1825
- setDeco(attrs: any): void;
1826
- append(child: any, openStart: any): void;
1827
- addLineDeco(deco: any): void;
1828
- domAtPos(pos: any): any;
1829
- measureTextSize(): {
1830
- lineHeight: any;
1831
- charWidth: number;
1832
- textHeight: any;
1833
- } | null;
1834
- coordsAt(pos: any, side: any): any;
1835
- covers(): boolean;
1836
- }
1837
- declare class TextLeaf extends Text {
1838
- static split(text: any, target: any): any;
1839
- constructor(text: any, length?: number);
1840
- text: any;
1841
- length: number;
1842
- get lines(): any;
1843
- get children(): null;
1844
- lineInner(target: any, isLine: any, line: any, offset: any): Line;
1845
- decompose(from: any, to: any, target: any, open: any): void;
1846
- sliceString(from: any, to?: number, lineSep?: string): string;
1847
- flatten(target: any): void;
1848
- scanIdentical(): number;
1849
- }
1850
- declare class ChildCursor {
1851
- constructor(children: any, pos: any, i: any);
1852
- children: any;
1853
- pos: any;
1854
- i: any;
1855
- off: number;
1856
- findPos(pos: any, bias?: number): this;
1857
- }
1858
- declare class LayerCursor {
1859
- constructor(layer: any, skip: any, minPoint: any, rank?: number);
1860
- layer: any;
1861
- skip: any;
1862
- minPoint: any;
1863
- rank: number;
1864
- get startSide(): any;
1865
- get endSide(): any;
1866
- goto(pos: any, side?: number): this;
1867
- chunkIndex: number | undefined;
1868
- rangeIndex: any;
1869
- gotoInner(pos: any, side: any, forward: any): void;
1870
- forward(pos: any, side: any): void;
1871
- next(): void;
1872
- from: any;
1873
- to: any;
1874
- value: any;
1875
- setRangeIndex(index: any): void;
1876
- nextChunk(): void;
1877
- compare(other: any): number;
1878
- }
1879
- declare class HeapCursor {
1880
- static from(sets: any, skip?: null, minPoint?: number): LayerCursor | HeapCursor;
1881
- constructor(heap: any);
1882
- heap: any;
1883
- get startSide(): any;
1884
- goto(pos: any, side?: number): this;
1885
- forward(pos: any, side: any): void;
1886
- next(): void;
1887
- from: any;
1888
- to: any;
1889
- value: any;
1890
- rank: any;
1891
- }
1892
- /**
1893
- The data structure for documents. @nonabstract
1894
- */
1895
- declare class Text {
1896
- /**
1897
- Create a `Text` instance for the given array of lines.
1898
- */
1899
- static of(text: any): any;
1900
- /**
1901
- Get the line description around the given position.
1902
- */
1903
- lineAt(pos: any): any;
1904
- /**
1905
- Get the description for the given (1-based) line number.
1906
- */
1907
- line(n: any): any;
1908
- /**
1909
- Replace a range of the text with the given content.
1910
- */
1911
- replace(from: any, to: any, text: any): any;
1912
- /**
1913
- Append another document to this one.
1914
- */
1915
- append(other: any): any;
1916
- /**
1917
- Retrieve the text between the given points.
1918
- */
1919
- slice(from: any, to?: any): any;
1920
- /**
1921
- Test whether this text is equal to another instance.
1922
- */
1923
- eq(other: any): boolean;
1924
- /**
1925
- Iterate over the text. When `dir` is `-1`, iteration happens
1926
- from end to start. This will return lines and the breaks between
1927
- them as separate strings.
1928
- */
1929
- iter(dir?: number): RawTextCursor;
1930
- /**
1931
- Iterate over a range of the text. When `from` > `to`, the
1932
- iterator will run in reverse.
1933
- */
1934
- iterRange(from: any, to?: any): PartialTextCursor;
1935
- /**
1936
- Return a cursor that iterates over the given range of lines,
1937
- _without_ returning the line breaks between, and yielding empty
1938
- strings for empty lines.
1939
-
1940
- When `from` and `to` are given, they should be 1-based line numbers.
1941
- */
1942
- iterLines(from: any, to: any): LineCursor;
1943
- /**
1944
- Return the document as a string, using newline characters to
1945
- separate lines.
1946
- */
1947
- toString(): any;
1948
- /**
1949
- Convert the document to an array of lines (which can be
1950
- deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#state.Text^of)).
1951
- */
1952
- toJSON(): any[];
1953
- }
1954
- declare namespace Text {
1955
- let empty_1: TextLeaf;
1956
- export { empty_1 as empty };
1957
- }
1958
- /**
1959
- This type describes a line in the document. It is created
1960
- on-demand when lines are [queried](https://codemirror.net/6/docs/ref/#state.Text.lineAt).
1961
- */
1962
- declare class Line {
1963
- /**
1964
- @internal
1965
- */
1966
- constructor(from: any, to: any, number: any, text: any);
1967
- from: any;
1968
- to: any;
1969
- number: any;
1970
- text: any;
1971
- /**
1972
- The length of the line (not including any line break after it).
1973
- */
1974
- get length(): number;
1975
- }
1976
- declare class RawTextCursor {
1977
- constructor(text: any, dir?: number);
1978
- dir: number;
1979
- done: boolean;
1980
- lineBreak: boolean;
1981
- value: string;
1982
- nodes: any[];
1983
- offsets: number[];
1984
- nextInner(skip: any, dir: any): this;
1985
- next(skip?: number): this;
1986
- }
1987
- declare class PartialTextCursor {
1988
- constructor(text: any, start: any, end: any);
1989
- value: string;
1990
- done: boolean;
1991
- cursor: RawTextCursor;
1992
- pos: any;
1993
- from: number;
1994
- to: number;
1995
- nextInner(skip: any, dir: any): this;
1996
- next(skip?: number): this;
1997
- get lineBreak(): boolean;
1998
- }
1999
- declare class LineCursor {
2000
- constructor(inner: any);
2001
- inner: any;
2002
- afterBreak: boolean;
2003
- value: string;
2004
- done: boolean;
2005
- next(skip?: number): this;
2006
- get lineBreak(): boolean;
2007
- }
2008
- export {};