@vscode/markdown-editor 0.0.2-0 → 0.0.2-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_observables/assert.d.ts +2 -0
- package/dist/_observables/deps.d.ts +28 -0
- package/dist/_observables/disposables.d.ts +19 -0
- package/dist/_observables/equals.d.ts +32 -0
- package/dist/_observables/index.d.ts +2 -0
- package/dist/_observables/observableInternal/base.d.ts +172 -0
- package/dist/_observables/observableInternal/changeTracker.d.ts +44 -0
- package/dist/_observables/observableInternal/commonFacade/cancellation.d.ts +24 -0
- package/dist/_observables/observableInternal/commonFacade/deps.d.ts +24 -0
- package/dist/_observables/observableInternal/debugLocation.d.ts +21 -0
- package/dist/_observables/observableInternal/debugName.d.ts +33 -0
- package/dist/_observables/observableInternal/experimental/deferUnobserve.d.ts +16 -0
- package/dist/_observables/observableInternal/experimental/reducer.d.ts +37 -0
- package/dist/_observables/observableInternal/experimental/utils.d.ts +15 -0
- package/dist/_observables/observableInternal/index.d.ts +25 -0
- package/dist/_observables/observableInternal/logging/consoleObservableLogger.d.ts +40 -0
- package/dist/_observables/observableInternal/logging/debugGetDependencyGraph.d.ts +4 -0
- package/dist/_observables/observableInternal/logging/debugger/debuggerRpc.d.ts +4 -0
- package/dist/_observables/observableInternal/logging/debugger/devToolsLogger.d.ts +43 -0
- package/dist/_observables/observableInternal/logging/debugger/rpc.d.ts +41 -0
- package/dist/_observables/observableInternal/logging/debugger/utils.d.ts +13 -0
- package/dist/_observables/observableInternal/logging/logging.d.ts +30 -0
- package/dist/_observables/observableInternal/map.d.ts +18 -0
- package/dist/_observables/observableInternal/observables/baseObservable.d.ts +58 -0
- package/dist/_observables/observableInternal/observables/constObservable.d.ts +5 -0
- package/dist/_observables/observableInternal/observables/derived.d.ts +46 -0
- package/dist/_observables/observableInternal/observables/derivedImpl.d.ts +83 -0
- package/dist/_observables/observableInternal/observables/lazyObservableValue.d.ts +27 -0
- package/dist/_observables/observableInternal/observables/observableFromEvent.d.ts +37 -0
- package/dist/_observables/observableInternal/observables/observableSignal.d.ts +11 -0
- package/dist/_observables/observableInternal/observables/observableSignalFromEvent.d.ts +5 -0
- package/dist/_observables/observableInternal/observables/observableValue.d.ts +37 -0
- package/dist/_observables/observableInternal/observables/observableValueOpts.d.ts +8 -0
- package/dist/_observables/observableInternal/reactions/autorun.d.ts +56 -0
- package/dist/_observables/observableInternal/reactions/autorunImpl.d.ts +53 -0
- package/dist/_observables/observableInternal/set.d.ts +17 -0
- package/dist/_observables/observableInternal/transaction.d.ts +27 -0
- package/dist/_observables/observableInternal/utils/promise.d.ts +75 -0
- package/dist/_observables/observableInternal/utils/runOnChange.d.ts +7 -0
- package/dist/_observables/observableInternal/utils/utils.d.ts +43 -0
- package/dist/_observables/observableInternal/utils/utilsCancellation.d.ts +10 -0
- package/dist/_observables/observableInternal/utils/valueWithChangeEvent.d.ts +10 -0
- package/dist/_observables/utils.d.ts +15 -0
- package/dist/index.d.ts +2057 -6
- package/dist/index.js +1674 -1175
- package/dist/index.js.map +1 -1
- package/dist/observables.d.ts +4 -1
- package/dist/observables.js +90 -114
- package/dist/observables.js.map +1 -1
- package/dist/{runOnChange-owE1SMC0.js → runOnChange-C00UIwqQ.js} +130 -106
- package/dist/runOnChange-C00UIwqQ.js.map +1 -0
- package/package.json +14 -7
- package/src/view/editor.css +146 -19
- package/src/view/themes/github.css +0 -5
- package/src/view/themes/vscode.css +331 -0
- package/dist/commands/cursorCommands.d.ts +0 -13
- package/dist/commands/editCommands.d.ts +0 -14
- package/dist/commands/index.d.ts +0 -4
- package/dist/commands/selectionCommands.d.ts +0 -6
- package/dist/commands/types.d.ts +0 -26
- package/dist/core/geometry.d.ts +0 -37
- package/dist/core/index.d.ts +0 -8
- package/dist/core/lengthEdit.d.ts +0 -38
- package/dist/core/offsetRange.d.ts +0 -26
- package/dist/core/selection.d.ts +0 -13
- package/dist/core/sourceOffset.d.ts +0 -1
- package/dist/core/stringEdit.d.ts +0 -27
- package/dist/core/stringValue.d.ts +0 -8
- package/dist/core/wordUtils.d.ts +0 -6
- package/dist/highlighter/defaultMonacoSyntaxHighlighter.d.ts +0 -20
- package/dist/highlighter/index.d.ts +0 -3
- package/dist/highlighter/monacoSyntaxHighlighter.d.ts +0 -38
- package/dist/highlighter/syntaxHighlighter.d.ts +0 -67
- package/dist/model/cursorNavigation.d.ts +0 -7
- package/dist/model/editorModel.d.ts +0 -54
- package/dist/model/index.d.ts +0 -4
- package/dist/model/measuredLayoutModel.d.ts +0 -50
- package/dist/parser/_micromarkAdapter.d.ts +0 -7
- package/dist/parser/ast.d.ts +0 -274
- package/dist/parser/index.d.ts +0 -4
- package/dist/parser/parse.d.ts +0 -2
- package/dist/parser/parser.d.ts +0 -14
- package/dist/parser/reconcile.d.ts +0 -33
- package/dist/parser/test/getAnnotatedSource.d.ts +0 -2
- package/dist/parser/test/snapshot.d.ts +0 -9
- package/dist/parser/visualizeAst.d.ts +0 -33
- package/dist/runOnChange-owE1SMC0.js.map +0 -1
- package/dist/test/random.d.ts +0 -16
- package/dist/view/content/blockView.d.ts +0 -179
- package/dist/view/content/documentView.d.ts +0 -41
- package/dist/view/content/dom.d.ts +0 -16
- package/dist/view/content/katexEditableIdentifiers.d.ts +0 -36
- package/dist/view/content/viewNode.d.ts +0 -93
- package/dist/view/editorController.d.ts +0 -34
- package/dist/view/editorView.d.ts +0 -100
- package/dist/view/fixture/astViewerView.d.ts +0 -27
- package/dist/view/fixture/cyclingTsHighlighter.d.ts +0 -17
- package/dist/view/fixture/debugColors.d.ts +0 -26
- package/dist/view/fixture/monacoDebugPanel.d.ts +0 -7
- package/dist/view/index.d.ts +0 -9
- package/dist/view/measuredLayoutDebugView.d.ts +0 -70
- package/dist/view/parts/cursorView.d.ts +0 -29
- package/dist/view/parts/selectionView.d.ts +0 -57
- package/dist/view/viewData.d.ts +0 -251
- package/dist/view/visualLineMap.d.ts +0 -157
- package/dist/view/visualizeViewTree.d.ts +0 -5
package/dist/parser/ast.d.ts
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { OffsetRange } from '../core/offsetRange.js';
|
|
2
|
-
import { StringEdit } from '../core/stringEdit.js';
|
|
3
|
-
export declare function _resetNodeIds(): void;
|
|
4
|
-
export declare abstract class AstNode {
|
|
5
|
-
abstract readonly kind: string;
|
|
6
|
-
abstract get children(): readonly AstNode[];
|
|
7
|
-
/**
|
|
8
|
-
* A stable identity. Every node has one: it is minted on construction and
|
|
9
|
-
* carried across edits by reconciliation, so a node that survives an edit
|
|
10
|
-
* (even with changed content) keeps the same id.
|
|
11
|
-
*/
|
|
12
|
-
readonly id: number;
|
|
13
|
-
/** Rebuild this node with each child replaced by `map.get(child) ?? child`. */
|
|
14
|
-
abstract mapChildren(map: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
15
|
-
private _length;
|
|
16
|
-
get length(): number;
|
|
17
|
-
/**
|
|
18
|
-
* True when `other` has the same content. Containers compare children *by
|
|
19
|
-
* identity* (`===`): bottom-up reconciliation substitutes reused old
|
|
20
|
-
* instances into the fresh tree first, so equal children already share
|
|
21
|
-
* instances — keeping this O(children), not O(subtree). Leaves have no
|
|
22
|
-
* children, so {@link _localEquals} is their whole comparison.
|
|
23
|
-
*/
|
|
24
|
-
structurallyEqual(other: AstNode): boolean;
|
|
25
|
-
/** Compares only this node's own scalar fields (kind/length already match). */
|
|
26
|
-
protected _localEquals(_other: this): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* A copy of this node that adopts `id`. Reconciliation uses this to carry an
|
|
29
|
-
* old identity onto a node whose content changed. Nodes are immutable value
|
|
30
|
-
* holders, so a shallow prototype copy with `id` overridden is sound.
|
|
31
|
-
*/
|
|
32
|
-
cloneWithId(id: number): this;
|
|
33
|
-
}
|
|
34
|
-
declare abstract class LeafAstNode extends AstNode {
|
|
35
|
-
abstract readonly content: string;
|
|
36
|
-
get children(): readonly AstNode[];
|
|
37
|
-
get length(): number;
|
|
38
|
-
mapChildren(): AstNode;
|
|
39
|
-
}
|
|
40
|
-
/** Real document text (an {@link InlineAstNode}). */
|
|
41
|
-
export declare class TextAstNode extends LeafAstNode {
|
|
42
|
-
readonly content: string;
|
|
43
|
-
readonly kind = "text";
|
|
44
|
-
constructor(content: string);
|
|
45
|
-
protected _localEquals(o: this): boolean;
|
|
46
|
-
}
|
|
47
|
-
/** A semantic syntax marker (heading `#`, fences, brackets, list bullet, …). */
|
|
48
|
-
export declare class MarkerAstNode extends LeafAstNode {
|
|
49
|
-
readonly markerKind: string;
|
|
50
|
-
readonly content: string;
|
|
51
|
-
readonly kind = "marker";
|
|
52
|
-
constructor(markerKind: string, content: string);
|
|
53
|
-
protected _localEquals(o: this): boolean;
|
|
54
|
-
}
|
|
55
|
-
/** Non-semantic syntactic glue: whitespace, padding, table pipes. */
|
|
56
|
-
export declare class GlueAstNode extends LeafAstNode {
|
|
57
|
-
readonly content: string;
|
|
58
|
-
readonly glueKind?: string | undefined;
|
|
59
|
-
readonly kind = "glue";
|
|
60
|
-
constructor(content: string, glueKind?: string | undefined);
|
|
61
|
-
protected _localEquals(o: this): boolean;
|
|
62
|
-
}
|
|
63
|
-
export declare class ThematicBreakAstNode extends AstNode {
|
|
64
|
-
readonly content: readonly (MarkerAstNode | GlueAstNode)[];
|
|
65
|
-
readonly kind = "thematicBreak";
|
|
66
|
-
constructor(content: readonly (MarkerAstNode | GlueAstNode)[]);
|
|
67
|
-
get children(): readonly AstNode[];
|
|
68
|
-
get marker(): MarkerAstNode | undefined;
|
|
69
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
70
|
-
}
|
|
71
|
-
export type InlineAstNode = TextAstNode | StrongAstNode | EmphasisAstNode | StrikethroughAstNode | InlineCodeAstNode | InlineMathAstNode | LinkAstNode | ImageAstNode;
|
|
72
|
-
export declare class StrongAstNode extends AstNode {
|
|
73
|
-
readonly openMarker: MarkerAstNode;
|
|
74
|
-
readonly content: readonly (InlineAstNode | GlueAstNode)[];
|
|
75
|
-
readonly closeMarker: MarkerAstNode;
|
|
76
|
-
readonly kind = "strong";
|
|
77
|
-
constructor(openMarker: MarkerAstNode, content: readonly (InlineAstNode | GlueAstNode)[], closeMarker: MarkerAstNode);
|
|
78
|
-
get children(): readonly AstNode[];
|
|
79
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
80
|
-
}
|
|
81
|
-
export declare class EmphasisAstNode extends AstNode {
|
|
82
|
-
readonly openMarker: MarkerAstNode;
|
|
83
|
-
readonly content: readonly (InlineAstNode | GlueAstNode)[];
|
|
84
|
-
readonly closeMarker: MarkerAstNode;
|
|
85
|
-
readonly kind = "emphasis";
|
|
86
|
-
constructor(openMarker: MarkerAstNode, content: readonly (InlineAstNode | GlueAstNode)[], closeMarker: MarkerAstNode);
|
|
87
|
-
get children(): readonly AstNode[];
|
|
88
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
89
|
-
}
|
|
90
|
-
export declare class StrikethroughAstNode extends AstNode {
|
|
91
|
-
readonly openMarker: MarkerAstNode;
|
|
92
|
-
readonly content: readonly (InlineAstNode | GlueAstNode)[];
|
|
93
|
-
readonly closeMarker: MarkerAstNode;
|
|
94
|
-
readonly kind = "strikethrough";
|
|
95
|
-
constructor(openMarker: MarkerAstNode, content: readonly (InlineAstNode | GlueAstNode)[], closeMarker: MarkerAstNode);
|
|
96
|
-
get children(): readonly AstNode[];
|
|
97
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
98
|
-
}
|
|
99
|
-
export declare class InlineCodeAstNode extends AstNode {
|
|
100
|
-
readonly content: readonly (MarkerAstNode | GlueAstNode)[];
|
|
101
|
-
readonly kind = "inlineCode";
|
|
102
|
-
constructor(content: readonly (MarkerAstNode | GlueAstNode)[]);
|
|
103
|
-
get children(): readonly AstNode[];
|
|
104
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
105
|
-
}
|
|
106
|
-
export declare class InlineMathAstNode extends AstNode {
|
|
107
|
-
readonly content: readonly (MarkerAstNode | GlueAstNode)[];
|
|
108
|
-
readonly kind = "inlineMath";
|
|
109
|
-
constructor(content: readonly (MarkerAstNode | GlueAstNode)[]);
|
|
110
|
-
get children(): readonly AstNode[];
|
|
111
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
112
|
-
}
|
|
113
|
-
export declare class LinkAstNode extends AstNode {
|
|
114
|
-
readonly url: string;
|
|
115
|
-
readonly content: readonly (MarkerAstNode | InlineAstNode | GlueAstNode)[];
|
|
116
|
-
readonly kind = "link";
|
|
117
|
-
constructor(url: string, content: readonly (MarkerAstNode | InlineAstNode | GlueAstNode)[]);
|
|
118
|
-
get children(): readonly AstNode[];
|
|
119
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
120
|
-
protected _localEquals(o: this): boolean;
|
|
121
|
-
}
|
|
122
|
-
export declare class ImageAstNode extends AstNode {
|
|
123
|
-
readonly alt: string;
|
|
124
|
-
readonly url: string;
|
|
125
|
-
readonly content: readonly (MarkerAstNode | GlueAstNode)[];
|
|
126
|
-
readonly kind = "image";
|
|
127
|
-
constructor(alt: string, url: string, content: readonly (MarkerAstNode | GlueAstNode)[]);
|
|
128
|
-
get children(): readonly AstNode[];
|
|
129
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
130
|
-
protected _localEquals(o: this): boolean;
|
|
131
|
-
}
|
|
132
|
-
export type BlockAstNode = HeadingAstNode | ParagraphAstNode | CodeBlockAstNode | MathBlockAstNode | ThematicBreakAstNode | BlockQuoteAstNode | ListAstNode | TableAstNode;
|
|
133
|
-
export declare class HeadingAstNode extends AstNode {
|
|
134
|
-
readonly level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
135
|
-
readonly marker: MarkerAstNode;
|
|
136
|
-
readonly content: readonly (InlineAstNode | GlueAstNode)[];
|
|
137
|
-
readonly kind = "heading";
|
|
138
|
-
constructor(level: 1 | 2 | 3 | 4 | 5 | 6, marker: MarkerAstNode, content: readonly (InlineAstNode | GlueAstNode)[]);
|
|
139
|
-
get children(): readonly AstNode[];
|
|
140
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
141
|
-
protected _localEquals(o: this): boolean;
|
|
142
|
-
}
|
|
143
|
-
export declare class ParagraphAstNode extends AstNode {
|
|
144
|
-
readonly content: readonly (InlineAstNode | GlueAstNode)[];
|
|
145
|
-
readonly kind = "paragraph";
|
|
146
|
-
constructor(content: readonly (InlineAstNode | GlueAstNode)[]);
|
|
147
|
-
get children(): readonly AstNode[];
|
|
148
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
149
|
-
}
|
|
150
|
-
export declare class CodeBlockAstNode extends AstNode {
|
|
151
|
-
readonly language: string;
|
|
152
|
-
readonly content: readonly (MarkerAstNode | GlueAstNode)[];
|
|
153
|
-
readonly kind = "codeBlock";
|
|
154
|
-
private _previous?;
|
|
155
|
-
private _contentEdit?;
|
|
156
|
-
constructor(language: string, content: readonly (MarkerAstNode | GlueAstNode)[]);
|
|
157
|
-
get children(): readonly AstNode[];
|
|
158
|
-
get openFence(): MarkerAstNode | undefined;
|
|
159
|
-
get closeFence(): MarkerAstNode | undefined;
|
|
160
|
-
get code(): MarkerAstNode | undefined;
|
|
161
|
-
/** Relative start offset of the {@link code} marker within this block. */
|
|
162
|
-
get codeOffset(): number;
|
|
163
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
164
|
-
protected _localEquals(o: this): boolean;
|
|
165
|
-
/**
|
|
166
|
-
* A copy of this block carrying an incremental link to `previous`:
|
|
167
|
-
* `contentEdit` (in the block's *content* coordinates) turns `previous`'s
|
|
168
|
-
* content into this one. Uses a weak reference so the previous tree can be
|
|
169
|
-
* garbage-collected.
|
|
170
|
-
*/
|
|
171
|
-
withCodeDiff(previous: CodeBlockAstNode, contentEdit: StringEdit): CodeBlockAstNode;
|
|
172
|
-
/**
|
|
173
|
-
* When this block was incrementally derived from `previous` (same
|
|
174
|
-
* fences/language, edit entirely within the content), returns the
|
|
175
|
-
* content-coordinate edit; otherwise `undefined`.
|
|
176
|
-
*/
|
|
177
|
-
getDiff(previous: CodeBlockAstNode): CodeBlockDiff | undefined;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Describes how a {@link CodeBlockAstNode} was incrementally derived from a previous
|
|
181
|
-
* one: {@link stringEdit} (in the block's *content* coordinates) turns the
|
|
182
|
-
* previous content into this one.
|
|
183
|
-
*/
|
|
184
|
-
export interface CodeBlockDiff {
|
|
185
|
-
readonly stringEdit: StringEdit;
|
|
186
|
-
}
|
|
187
|
-
export declare class MathBlockAstNode extends AstNode {
|
|
188
|
-
readonly content: readonly (MarkerAstNode | GlueAstNode)[];
|
|
189
|
-
readonly kind = "mathBlock";
|
|
190
|
-
constructor(content: readonly (MarkerAstNode | GlueAstNode)[]);
|
|
191
|
-
get children(): readonly AstNode[];
|
|
192
|
-
get code(): MarkerAstNode | undefined;
|
|
193
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
194
|
-
}
|
|
195
|
-
export declare class BlockQuoteAstNode extends AstNode {
|
|
196
|
-
readonly content: readonly (MarkerAstNode | BlockAstNode | GlueAstNode)[];
|
|
197
|
-
readonly kind = "blockQuote";
|
|
198
|
-
constructor(content: readonly (MarkerAstNode | BlockAstNode | GlueAstNode)[]);
|
|
199
|
-
get children(): readonly AstNode[];
|
|
200
|
-
get blocks(): readonly BlockAstNode[];
|
|
201
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
202
|
-
}
|
|
203
|
-
export declare class ListAstNode extends AstNode {
|
|
204
|
-
readonly ordered: boolean;
|
|
205
|
-
readonly content: readonly (ListItemAstNode | GlueAstNode)[];
|
|
206
|
-
readonly kind = "list";
|
|
207
|
-
constructor(ordered: boolean, content: readonly (ListItemAstNode | GlueAstNode)[]);
|
|
208
|
-
get children(): readonly AstNode[];
|
|
209
|
-
get items(): readonly ListItemAstNode[];
|
|
210
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
211
|
-
protected _localEquals(o: this): boolean;
|
|
212
|
-
}
|
|
213
|
-
export declare class ListItemAstNode extends AstNode {
|
|
214
|
-
readonly marker: MarkerAstNode;
|
|
215
|
-
readonly content: readonly (BlockAstNode | GlueAstNode)[];
|
|
216
|
-
readonly checked?: boolean | undefined;
|
|
217
|
-
readonly leadingTrivia?: GlueAstNode | undefined;
|
|
218
|
-
readonly kind = "listItem";
|
|
219
|
-
constructor(marker: MarkerAstNode, content: readonly (BlockAstNode | GlueAstNode)[], checked?: boolean | undefined, leadingTrivia?: GlueAstNode | undefined);
|
|
220
|
-
get children(): readonly AstNode[];
|
|
221
|
-
get blocks(): readonly BlockAstNode[];
|
|
222
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
223
|
-
protected _localEquals(o: this): boolean;
|
|
224
|
-
}
|
|
225
|
-
export declare class TableAstNode extends AstNode {
|
|
226
|
-
readonly content: readonly (TableRowAstNode | GlueAstNode)[];
|
|
227
|
-
readonly kind = "table";
|
|
228
|
-
constructor(content: readonly (TableRowAstNode | GlueAstNode)[]);
|
|
229
|
-
get children(): readonly AstNode[];
|
|
230
|
-
private get _rows();
|
|
231
|
-
get headerRow(): TableRowAstNode | undefined;
|
|
232
|
-
get delimiterRow(): TableRowAstNode | undefined;
|
|
233
|
-
get bodyRows(): readonly TableRowAstNode[];
|
|
234
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
235
|
-
}
|
|
236
|
-
export declare class TableRowAstNode extends AstNode {
|
|
237
|
-
readonly content: readonly (TableCellAstNode | GlueAstNode)[];
|
|
238
|
-
readonly kind = "tableRow";
|
|
239
|
-
constructor(content: readonly (TableCellAstNode | GlueAstNode)[]);
|
|
240
|
-
get children(): readonly AstNode[];
|
|
241
|
-
get cells(): readonly TableCellAstNode[];
|
|
242
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
243
|
-
}
|
|
244
|
-
export declare class TableCellAstNode extends AstNode {
|
|
245
|
-
readonly content: readonly (InlineAstNode | MarkerAstNode | GlueAstNode)[];
|
|
246
|
-
readonly kind = "tableCell";
|
|
247
|
-
constructor(content: readonly (InlineAstNode | MarkerAstNode | GlueAstNode)[]);
|
|
248
|
-
get children(): readonly AstNode[];
|
|
249
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
250
|
-
}
|
|
251
|
-
export declare class DocumentAstNode extends AstNode {
|
|
252
|
-
readonly content: readonly (BlockAstNode | GlueAstNode)[];
|
|
253
|
-
readonly kind = "document";
|
|
254
|
-
constructor(content: readonly (BlockAstNode | GlueAstNode)[]);
|
|
255
|
-
get children(): readonly AstNode[];
|
|
256
|
-
get blocks(): readonly BlockAstNode[];
|
|
257
|
-
mapChildren(m: ReadonlyMap<AstNode, AstNode>): AstNode;
|
|
258
|
-
}
|
|
259
|
-
/** Every concrete node kind, for exhaustive consumer-side dispatch. */
|
|
260
|
-
export type AnyAstNode = TextAstNode | MarkerAstNode | GlueAstNode | ThematicBreakAstNode | StrongAstNode | EmphasisAstNode | StrikethroughAstNode | InlineCodeAstNode | InlineMathAstNode | LinkAstNode | ImageAstNode | HeadingAstNode | ParagraphAstNode | CodeBlockAstNode | MathBlockAstNode | BlockQuoteAstNode | ListAstNode | ListItemAstNode | TableAstNode | TableRowAstNode | TableCellAstNode | DocumentAstNode;
|
|
261
|
-
/**
|
|
262
|
-
* Source offset (relative to `root`) of the node with `target`'s id, or
|
|
263
|
-
* `undefined` when it is not in the tree. Ids are stable across edits, so this
|
|
264
|
-
* locates a node even after reconciliation has rebuilt the tree around it.
|
|
265
|
-
*/
|
|
266
|
-
export declare function findNodeOffsetById(root: AstNode, target: AstNode): number | undefined;
|
|
267
|
-
/**
|
|
268
|
-
* Source range (relative to `item`) of a task list item's `[x]`/`[ ]`
|
|
269
|
-
* checkbox, or `undefined` when the item is not a task item. The checkbox is
|
|
270
|
-
* plain glue in the AST, so a host that wants to toggle it locates the literal
|
|
271
|
-
* `[x]`/`[ ]` token here.
|
|
272
|
-
*/
|
|
273
|
-
export declare function taskCheckboxRange(item: ListItemAstNode): OffsetRange | undefined;
|
|
274
|
-
export {};
|
package/dist/parser/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { MarkdownParser } from './parser.js';
|
|
2
|
-
export { getAnnotatedSource } from './test/getAnnotatedSource.js';
|
|
3
|
-
export { visualizeAst, type AstVisualization } from './visualizeAst.js';
|
|
4
|
-
export { BlockQuoteAstNode, CodeBlockAstNode, DocumentAstNode, EmphasisAstNode, GlueAstNode, HeadingAstNode, ImageAstNode, InlineCodeAstNode, InlineMathAstNode, LinkAstNode, ListAstNode, ListItemAstNode, MarkerAstNode, MathBlockAstNode, AstNode, findNodeOffsetById, taskCheckboxRange, ParagraphAstNode, StrikethroughAstNode, StrongAstNode, TableAstNode, TableCellAstNode, TableRowAstNode, TextAstNode, ThematicBreakAstNode, type AnyAstNode, type BlockAstNode, type InlineAstNode, } from './ast.js';
|
package/dist/parser/parse.d.ts
DELETED
package/dist/parser/parser.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { StringValue } from '../core/stringValue.js';
|
|
2
|
-
import { StringEdit } from '../core/stringEdit.js';
|
|
3
|
-
import { DocumentAstNode } from './ast.js';
|
|
4
|
-
/**
|
|
5
|
-
* Parses markdown into a {@link DocumentAstNode}.
|
|
6
|
-
*
|
|
7
|
-
* When given the `previous` document and the `edit` that produced the new
|
|
8
|
-
* text, it reuses unchanged subtrees and carries node identities across the
|
|
9
|
-
* edit (see {@link parseIncremental}), so views can diff cheaply and code
|
|
10
|
-
* blocks keep their incremental highlighting sessions.
|
|
11
|
-
*/
|
|
12
|
-
export declare class MarkdownParser {
|
|
13
|
-
parse(text: StringValue, previous?: DocumentAstNode, edit?: StringEdit): DocumentAstNode;
|
|
14
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { OffsetRange } from '../core/offsetRange.js';
|
|
2
|
-
import { StringEdit } from '../core/stringEdit.js';
|
|
3
|
-
import { DocumentAstNode, AstNode } from './ast.js';
|
|
4
|
-
/** Maps offsets/ranges from modified (new) coordinates back to original (previous). */
|
|
5
|
-
export declare class EditMapper {
|
|
6
|
-
private readonly _edit;
|
|
7
|
-
constructor(_edit: StringEdit);
|
|
8
|
-
/**
|
|
9
|
-
* The original range corresponding to `mod`, or `undefined` if `mod`
|
|
10
|
-
* overlaps any replaced/inserted text (i.e. is not provably unchanged).
|
|
11
|
-
*/
|
|
12
|
-
getOriginalRange(mod: OffsetRange): OffsetRange | undefined;
|
|
13
|
-
/** The original offset for `mod`, or `undefined` if it falls inside inserted text. */
|
|
14
|
-
getOriginalOffset(mod: number): number | undefined;
|
|
15
|
-
}
|
|
16
|
-
/** Indexes the previous tree for O(1) lookup by exact range or by stable id. */
|
|
17
|
-
export declare class OldTreeIndex {
|
|
18
|
-
private readonly _byRange;
|
|
19
|
-
private readonly _byId;
|
|
20
|
-
constructor(root: AstNode);
|
|
21
|
-
private _walk;
|
|
22
|
-
/** The old node spanning exactly `range` with the given `kind`, if any. */
|
|
23
|
-
lookupExact(range: OffsetRange, kind: string): AstNode | undefined;
|
|
24
|
-
/** The old node that began at `originalStart` with the given `kind`. */
|
|
25
|
-
lookupId(originalStart: number, kind: string): AstNode | undefined;
|
|
26
|
-
}
|
|
27
|
-
export declare function reconcile(fresh: AstNode, previous: AstNode, edit: StringEdit): AstNode;
|
|
28
|
-
/**
|
|
29
|
-
* Parses `text`; when `previous` and `edit` are given, reconciles the fresh
|
|
30
|
-
* tree against `previous` so unchanged subtrees keep their old instances and
|
|
31
|
-
* edited id-bearing nodes keep their old ids.
|
|
32
|
-
*/
|
|
33
|
-
export declare function parseIncremental(text: string, previous?: DocumentAstNode, edit?: StringEdit): DocumentAstNode;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DocumentAstNode, AstNode } from '../ast.js';
|
|
2
|
-
/** Assigns a small stable number to each distinct object instance, in first-seen order. */
|
|
3
|
-
export declare class InstanceIds {
|
|
4
|
-
private readonly _map;
|
|
5
|
-
private _next;
|
|
6
|
-
get(n: AstNode): number;
|
|
7
|
-
}
|
|
8
|
-
export declare function snapshot(root: AstNode, ids: InstanceIds): string;
|
|
9
|
-
export declare function snapshotDoc(doc: DocumentAstNode, ids: InstanceIds): string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { AstNode } from './ast.js';
|
|
2
|
-
export interface AstVisualizationNode {
|
|
3
|
-
label: string;
|
|
4
|
-
range: [start: number, endExclusive: number];
|
|
5
|
-
children?: AstVisualizationNode[];
|
|
6
|
-
}
|
|
7
|
-
export interface AstVisualization {
|
|
8
|
-
$fileExtension: 'ast.w';
|
|
9
|
-
source: string;
|
|
10
|
-
root: AstVisualizationNode;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Globally-stable per-object-instance id, assigned in first-seen order across
|
|
14
|
-
* every visualization (AST, view-data, view-node). A single registry — not one
|
|
15
|
-
* per tree — is the whole point: the same object always renders the same `#N`,
|
|
16
|
-
* so you can correlate instances across the different trees and across edits.
|
|
17
|
-
*/
|
|
18
|
-
export declare function objectInstanceId(n: object): number;
|
|
19
|
-
export declare function visualizeAst(root: AstNode, source: string): AstVisualization;
|
|
20
|
-
/**
|
|
21
|
-
* Adapts the raw micromark token stream into the same `ast.w` visualization
|
|
22
|
-
* payload, as a flat list (no nesting): one child per event, in document order.
|
|
23
|
-
* This is the input the {@link visualizeAst} tree is built from, so showing both
|
|
24
|
-
* side by side makes the parser's tokens → AST step inspectable.
|
|
25
|
-
*
|
|
26
|
-
* Both `enter` and `exit` events are emitted — the open/close structure is the
|
|
27
|
-
* one piece of micromark's information that is NOT derivable from a flat list of
|
|
28
|
-
* ranges (tokens can share a range, and ranges alone don't disambiguate nesting
|
|
29
|
-
* order). Everything else a token carries is here too: its type, its
|
|
30
|
-
* `[start, end)` range, and the source slice that range covers (so the length,
|
|
31
|
-
* which the AST view derives, is visible directly).
|
|
32
|
-
*/
|
|
33
|
-
export declare function visualizeTokens(source: string): AstVisualization;
|