@the_dissidents/libemmm 0.0.8 → 0.0.9
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/README.md +204 -62
- package/dist/chunk-Bp6m_JJh.js +13 -0
- package/dist/index.cjs +3311 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +727 -0
- package/dist/index.d.ts +598 -506
- package/dist/index.js +3078 -3246
- package/dist/index.js.map +1 -1
- package/package.json +25 -17
- package/dist/index.d.mts +0 -634
- package/dist/index.mjs +0 -3366
- package/dist/index.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the_dissidents/libemmm",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"test": "vitest",
|
|
10
|
-
"build": "tsup"
|
|
11
|
-
},
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"description": "Parser and language server for the emmm markup language",
|
|
5
|
+
"author": "the_dissidents",
|
|
6
|
+
"license": "GPL-2.0-only",
|
|
12
7
|
"files": [
|
|
13
8
|
"dist"
|
|
14
9
|
],
|
|
15
|
-
"
|
|
16
|
-
"
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.cjs",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./dist/index.js"
|
|
16
|
+
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"minimal-jsx-runtime": "
|
|
18
|
+
"minimal-jsx-runtime": "npm:@the_dissidents/minimal-jsx-runtime@0.0.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
21
|
+
"@happy-dom/global-registrator": "^19.0.2",
|
|
22
|
+
"@vitest/coverage-istanbul": "^4.0.14",
|
|
23
|
+
"@vitest/ui": "^4.0.14",
|
|
24
|
+
"happy-dom": "^19.0.2",
|
|
25
|
+
"tsdown": "^0.15.10",
|
|
26
|
+
"typescript": "^5.9.3",
|
|
27
|
+
"vitest": "^4.0.14"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "pnpm vitest",
|
|
31
|
+
"build": "tsdown",
|
|
32
|
+
"dev": "tsdown --watch"
|
|
25
33
|
}
|
|
26
|
-
}
|
|
34
|
+
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,634 +0,0 @@
|
|
|
1
|
-
import * as minimal_jsx_runtime from 'minimal-jsx-runtime';
|
|
2
|
-
|
|
3
|
-
declare enum DebugLevel {
|
|
4
|
-
Trace = 0,
|
|
5
|
-
Info = 1,
|
|
6
|
-
Warning = 2,
|
|
7
|
-
Error = 3,
|
|
8
|
-
None = 4
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
type SourceDescriptor = {
|
|
12
|
-
readonly name: string;
|
|
13
|
-
};
|
|
14
|
-
interface Source extends SourceDescriptor {
|
|
15
|
-
readonly nLines: number;
|
|
16
|
-
/**
|
|
17
|
-
* Return the row- and column-index corresponding to a given location. The indices are zero-based.
|
|
18
|
-
*/
|
|
19
|
-
getRowCol(loc: number): [row: number, col: number];
|
|
20
|
-
/**
|
|
21
|
-
* Returns the position of the start of row `n` (zero-based). If `n` is zero, returns zero. If the source contains less than `n` rows, returns `Infinity`.
|
|
22
|
-
*/
|
|
23
|
-
getRowStart(n: number): number;
|
|
24
|
-
/**
|
|
25
|
-
* Returns the content of the row `n` (zero-based). If the source contains less than `n` rows, returns `undefined`.
|
|
26
|
-
*/
|
|
27
|
-
getRow(n: number): string | undefined;
|
|
28
|
-
}
|
|
29
|
-
declare class StringSource implements Source {
|
|
30
|
-
private readonly src;
|
|
31
|
-
readonly name: string;
|
|
32
|
-
readonly nLines: number;
|
|
33
|
-
private readonly lineMap;
|
|
34
|
-
constructor(d: SourceDescriptor, src: string);
|
|
35
|
-
getRowCol(pos: number): [row: number, col: number];
|
|
36
|
-
getRowStart(n: number): number;
|
|
37
|
-
getRow(n: number): string | undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
declare class NameManager<T extends {
|
|
41
|
-
name: string;
|
|
42
|
-
}> {
|
|
43
|
-
private array;
|
|
44
|
-
private data;
|
|
45
|
-
constructor(from?: ReadonlyNameManager<T> | readonly T[] | ReadonlySet<T>);
|
|
46
|
-
toArray(): T[];
|
|
47
|
-
toSet(): Set<T>;
|
|
48
|
-
get(name: string): T | undefined;
|
|
49
|
-
has(name: string): boolean;
|
|
50
|
-
remove(name: string): void;
|
|
51
|
-
add(...elems: T[]): void;
|
|
52
|
-
find(predicate: (x: T) => boolean): T | undefined;
|
|
53
|
-
}
|
|
54
|
-
type ReadonlyNameManager<T extends {
|
|
55
|
-
name: string;
|
|
56
|
-
}> = Omit<NameManager<T>, 'add' | 'remove'>;
|
|
57
|
-
|
|
58
|
-
interface ParseContextStoreDefinitions {
|
|
59
|
-
}
|
|
60
|
-
type ParseContextStoreKey = keyof ParseContextStoreDefinitions;
|
|
61
|
-
type ParseContextStoreEntry<S extends ParseContextStoreKey> = ParseContextStoreDefinitions[S];
|
|
62
|
-
declare class ParseContext {
|
|
63
|
-
config: Configuration;
|
|
64
|
-
variables: Map<string, string>;
|
|
65
|
-
private data;
|
|
66
|
-
constructor(config: Configuration, variables?: Map<string, string>);
|
|
67
|
-
init<S extends ParseContextStoreKey>(key: S, obj: ParseContextStoreEntry<S>): void;
|
|
68
|
-
set<S extends ParseContextStoreKey>(key: S, obj: ParseContextStoreEntry<S>): void;
|
|
69
|
-
get<S extends ParseContextStoreKey>(key: S): ParseContextStoreEntry<S>;
|
|
70
|
-
}
|
|
71
|
-
declare class Document$1 {
|
|
72
|
-
readonly root: RootNode;
|
|
73
|
-
readonly context: ParseContext;
|
|
74
|
-
readonly messages: readonly Message[];
|
|
75
|
-
constructor(root: RootNode, context: ParseContext, messages: readonly Message[]);
|
|
76
|
-
toStripped(): Document$1;
|
|
77
|
-
/**
|
|
78
|
-
* Performs a depth-first walk of the node tree.
|
|
79
|
-
*/
|
|
80
|
-
walk(callback: (node: BlockEntity | InlineEntity | ArgumentEntity) => 'skip' | 'break' | 'continue'): void;
|
|
81
|
-
/**
|
|
82
|
-
* Gets all nodes that covers the given position, from outermost to innermost (essentially a path).
|
|
83
|
-
*/
|
|
84
|
-
resolvePosition(pos: number): (BlockEntity | InlineEntity | ArgumentEntity)[];
|
|
85
|
-
}
|
|
86
|
-
interface ReadonlyConfiguration {
|
|
87
|
-
readonly initializers: readonly ((cxt: ParseContext) => void)[];
|
|
88
|
-
readonly blockModifiers: ReadonlyNameManager<BlockModifierDefinition<any>>;
|
|
89
|
-
readonly inlineModifiers: ReadonlyNameManager<InlineModifierDefinition<any>>;
|
|
90
|
-
readonly systemModifiers: ReadonlyNameManager<SystemModifierDefinition<any>>;
|
|
91
|
-
readonly argumentInterpolators: ReadonlyNameManager<ArgumentInterpolatorDefinition>;
|
|
92
|
-
readonly blockShorthands: ReadonlyNameManager<BlockShorthand<any>>;
|
|
93
|
-
readonly inlineShorthands: ReadonlyNameManager<InlineShorthand<any>>;
|
|
94
|
-
readonly reparseDepthLimit: number;
|
|
95
|
-
}
|
|
96
|
-
declare class Configuration implements ReadonlyConfiguration {
|
|
97
|
-
initializers: ((cxt: ParseContext) => void)[];
|
|
98
|
-
blockModifiers: NameManager<BlockModifierDefinition<any>>;
|
|
99
|
-
inlineModifiers: NameManager<InlineModifierDefinition<any>>;
|
|
100
|
-
systemModifiers: NameManager<SystemModifierDefinition<any>>;
|
|
101
|
-
argumentInterpolators: NameManager<ArgumentInterpolatorDefinition>;
|
|
102
|
-
blockShorthands: NameManager<BlockShorthand<any>>;
|
|
103
|
-
inlineShorthands: NameManager<InlineShorthand<any>>;
|
|
104
|
-
reparseDepthLimit: number;
|
|
105
|
-
static from(from: ReadonlyConfiguration): Configuration;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare enum MessageSeverity {
|
|
109
|
-
Info = 0,
|
|
110
|
-
Warning = 1,
|
|
111
|
-
Error = 2
|
|
112
|
-
}
|
|
113
|
-
type Message = {
|
|
114
|
-
readonly severity: MessageSeverity;
|
|
115
|
-
readonly location: LocationRange;
|
|
116
|
-
readonly info: string;
|
|
117
|
-
readonly code: number;
|
|
118
|
-
};
|
|
119
|
-
type LocationRange = {
|
|
120
|
-
original?: LocationRange;
|
|
121
|
-
source: Source;
|
|
122
|
-
start: number;
|
|
123
|
-
end: number;
|
|
124
|
-
actualEnd?: number;
|
|
125
|
-
};
|
|
126
|
-
declare enum NodeType {
|
|
127
|
-
Root = 0,
|
|
128
|
-
Paragraph = 1,
|
|
129
|
-
Preformatted = 2,
|
|
130
|
-
Text = 3,
|
|
131
|
-
Escaped = 4,
|
|
132
|
-
SystemModifier = 5,
|
|
133
|
-
InlineModifier = 6,
|
|
134
|
-
BlockModifier = 7,
|
|
135
|
-
Interpolation = 8
|
|
136
|
-
}
|
|
137
|
-
type ParagraphNode = {
|
|
138
|
-
location: LocationRange;
|
|
139
|
-
type: NodeType.Paragraph;
|
|
140
|
-
content: InlineEntity[];
|
|
141
|
-
};
|
|
142
|
-
type PreNode = {
|
|
143
|
-
location: LocationRange;
|
|
144
|
-
type: NodeType.Preformatted;
|
|
145
|
-
content: {
|
|
146
|
-
start: number;
|
|
147
|
-
end: number;
|
|
148
|
-
text: string;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
type TextNode = {
|
|
152
|
-
location: LocationRange;
|
|
153
|
-
type: NodeType.Text;
|
|
154
|
-
content: string;
|
|
155
|
-
};
|
|
156
|
-
type EscapedNode = {
|
|
157
|
-
location: LocationRange;
|
|
158
|
-
type: NodeType.Escaped;
|
|
159
|
-
content: string;
|
|
160
|
-
};
|
|
161
|
-
type SystemModifierNode<TState> = {
|
|
162
|
-
location: LocationRange;
|
|
163
|
-
type: NodeType.SystemModifier;
|
|
164
|
-
mod: SystemModifierDefinition<TState>;
|
|
165
|
-
state?: TState;
|
|
166
|
-
head: LocationRange;
|
|
167
|
-
arguments: ModifierArgument[];
|
|
168
|
-
content: BlockEntity[];
|
|
169
|
-
expansion?: never[];
|
|
170
|
-
};
|
|
171
|
-
type BlockModifierNode<TState> = {
|
|
172
|
-
location: LocationRange;
|
|
173
|
-
type: NodeType.BlockModifier;
|
|
174
|
-
mod: BlockModifierDefinition<TState>;
|
|
175
|
-
state?: TState;
|
|
176
|
-
head: LocationRange;
|
|
177
|
-
arguments: ModifierArgument[];
|
|
178
|
-
content: BlockEntity[];
|
|
179
|
-
expansion?: BlockEntity[];
|
|
180
|
-
};
|
|
181
|
-
type InlineModifierNode<TState> = {
|
|
182
|
-
location: LocationRange;
|
|
183
|
-
type: NodeType.InlineModifier;
|
|
184
|
-
mod: InlineModifierDefinition<TState>;
|
|
185
|
-
state?: TState;
|
|
186
|
-
head: LocationRange;
|
|
187
|
-
arguments: ModifierArgument[];
|
|
188
|
-
content: InlineEntity[];
|
|
189
|
-
expansion?: InlineEntity[];
|
|
190
|
-
};
|
|
191
|
-
type RootNode = {
|
|
192
|
-
type: NodeType.Root;
|
|
193
|
-
content: BlockEntity[];
|
|
194
|
-
source: Source;
|
|
195
|
-
};
|
|
196
|
-
type ModifierNode<T = any> = BlockModifierNode<T> | InlineModifierNode<T> | SystemModifierNode<T>;
|
|
197
|
-
type BlockEntity = ParagraphNode | PreNode | BlockModifierNode<any> | SystemModifierNode<any>;
|
|
198
|
-
type InlineEntity = TextNode | EscapedNode | InlineModifierNode<any> | SystemModifierNode<any>;
|
|
199
|
-
type DocumentNode = BlockEntity | InlineEntity | RootNode;
|
|
200
|
-
type InterpolationNode = {
|
|
201
|
-
location: LocationRange;
|
|
202
|
-
type: NodeType.Interpolation;
|
|
203
|
-
definition: ArgumentInterpolatorDefinition;
|
|
204
|
-
argument: ModifierArgument;
|
|
205
|
-
expansion?: string;
|
|
206
|
-
};
|
|
207
|
-
type ModifierArgument = {
|
|
208
|
-
location: LocationRange;
|
|
209
|
-
content: ArgumentEntity[];
|
|
210
|
-
expansion?: string;
|
|
211
|
-
};
|
|
212
|
-
type ArgumentEntity = TextNode | EscapedNode | InterpolationNode;
|
|
213
|
-
declare enum ModifierSlotType {
|
|
214
|
-
Normal = 0,
|
|
215
|
-
/** Content is preformatted: no escaping, no inner tags */
|
|
216
|
-
Preformatted = 1,
|
|
217
|
-
/** No content slot */
|
|
218
|
-
None = 2
|
|
219
|
-
}
|
|
220
|
-
declare class ModifierBase<TNode, TEntity> {
|
|
221
|
-
readonly name: string;
|
|
222
|
-
readonly slotType: ModifierSlotType;
|
|
223
|
-
constructor(name: string, slotType?: ModifierSlotType, args?: Partial<ModifierBase<TNode, TEntity>>);
|
|
224
|
-
/**
|
|
225
|
-
* Common values: heading, emphasis, keyword, highlight, commentary, comment, link, quote
|
|
226
|
-
*/
|
|
227
|
-
roleHint?: string;
|
|
228
|
-
/**
|
|
229
|
-
* If true, any modifier encountered inside it will *not* be expanded *during parse-content*,
|
|
230
|
-
* *unless* that modifier is `alwaysTryExpand`. In the vast majority of cases, you shouldn't
|
|
231
|
-
* be using this.
|
|
232
|
-
*/
|
|
233
|
-
delayContentExpansion: boolean;
|
|
234
|
-
/**
|
|
235
|
-
* If true, such a modifier will always be expanded whenever it is encountered, *even if*
|
|
236
|
-
* it is contained in a modifier with `delayContentExpansion`. In the vast majority of cases,
|
|
237
|
-
* you shouldn't be using this.
|
|
238
|
-
*/
|
|
239
|
-
alwaysTryExpand: boolean;
|
|
240
|
-
/** Called before the modifier's content is parsed.
|
|
241
|
-
* @param immediate False when the node is inside a `delayContentExpansion` modifier, but it is `alwaysTryExpand`; otherwise true.
|
|
242
|
-
*/
|
|
243
|
-
beforeParseContent?: (node: TNode, cxt: ParseContext, immediate: boolean) => Message[];
|
|
244
|
-
/** Called after the modifier's content is parsed.
|
|
245
|
-
* @param immediate False when the node is inside a `delayContentExpansion` modifier, but it is `alwaysTryExpand`; otherwise true.
|
|
246
|
-
*/
|
|
247
|
-
afterParseContent?: (node: TNode, cxt: ParseContext, immediate: boolean) => Message[];
|
|
248
|
-
/** Called before reparsing of the expansion.
|
|
249
|
-
* @param immediate False when the node is inside a `delayContentExpansion` modifier, but it is `alwaysTryExpand`; otherwise true.*/
|
|
250
|
-
beforeProcessExpansion?: (node: TNode, cxt: ParseContext, immediate: boolean) => Message[];
|
|
251
|
-
/** Called before reparsing of the expansion.
|
|
252
|
-
* @param immediate False when the node is inside a `delayContentExpansion` modifier, but it is `alwaysTryExpand`; otherwise true.*/
|
|
253
|
-
afterProcessExpansion?: (node: TNode, cxt: ParseContext, immediate: boolean) => Message[];
|
|
254
|
-
/**
|
|
255
|
-
* @param immediate False when the node is inside a `delayContentExpansion` modifier, but it is `alwaysTryExpand`; otherwise true.
|
|
256
|
-
*/
|
|
257
|
-
prepareExpand?: (node: TNode, cxt: ParseContext, immediate: boolean) => Message[];
|
|
258
|
-
/**
|
|
259
|
-
* @param immediate False when the node is inside a `delayContentExpansion` modifier, but it is `alwaysTryExpand`; otherwise true.
|
|
260
|
-
*/
|
|
261
|
-
expand?: (node: TNode, cxt: ParseContext, immediate: boolean) => TEntity[] | undefined;
|
|
262
|
-
}
|
|
263
|
-
declare class BlockModifierDefinition<TState> extends ModifierBase<BlockModifierNode<TState>, BlockEntity> {
|
|
264
|
-
}
|
|
265
|
-
declare class InlineModifierDefinition<TState> extends ModifierBase<InlineModifierNode<TState>, InlineEntity> {
|
|
266
|
-
}
|
|
267
|
-
declare class SystemModifierDefinition<TState> extends ModifierBase<SystemModifierNode<TState>, never> {
|
|
268
|
-
}
|
|
269
|
-
declare class ArgumentInterpolatorDefinition {
|
|
270
|
-
readonly name: string;
|
|
271
|
-
readonly postfix: string;
|
|
272
|
-
constructor(name: string, postfix: string, args?: Partial<ArgumentInterpolatorDefinition>);
|
|
273
|
-
alwaysTryExpand: boolean;
|
|
274
|
-
expand?: (content: string, cxt: ParseContext, immediate: boolean) => string | undefined;
|
|
275
|
-
}
|
|
276
|
-
type Shorthand<TMod> = {
|
|
277
|
-
name: string;
|
|
278
|
-
parts: readonly string[];
|
|
279
|
-
postfix: string | undefined;
|
|
280
|
-
mod: TMod;
|
|
281
|
-
};
|
|
282
|
-
type BlockShorthand<TState> = Shorthand<BlockModifierDefinition<TState>>;
|
|
283
|
-
type InlineShorthand<TState> = Shorthand<InlineModifierDefinition<TState>>;
|
|
284
|
-
|
|
285
|
-
declare class SimpleScanner implements Scanner {
|
|
286
|
-
private src;
|
|
287
|
-
readonly source: Source;
|
|
288
|
-
private pos;
|
|
289
|
-
constructor(src: string, sourceDesc?: SourceDescriptor);
|
|
290
|
-
position(): number;
|
|
291
|
-
isEOF(): boolean;
|
|
292
|
-
peek(str: string): boolean;
|
|
293
|
-
acceptChar(): string;
|
|
294
|
-
accept(str: string): boolean;
|
|
295
|
-
acceptWhitespaceChar(): string | null;
|
|
296
|
-
}
|
|
297
|
-
interface Scanner {
|
|
298
|
-
readonly source: Source;
|
|
299
|
-
position(): number;
|
|
300
|
-
isEOF(): boolean;
|
|
301
|
-
peek(str: string): boolean;
|
|
302
|
-
accept(str: string): boolean;
|
|
303
|
-
acceptChar(): string;
|
|
304
|
-
acceptWhitespaceChar(): string | null;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
declare function parse(scanner: Scanner, cxt: ParseContext): Document$1;
|
|
308
|
-
|
|
309
|
-
type RendererType<TState, TReturn, TDocument, TOptions = undefined> = {
|
|
310
|
-
state: TState;
|
|
311
|
-
return: TReturn;
|
|
312
|
-
document: TDocument;
|
|
313
|
-
options: TOptions;
|
|
314
|
-
};
|
|
315
|
-
type AnyRendererType = RendererType<any, any, any, any>;
|
|
316
|
-
type getState<Type> = Type extends RendererType<infer T, any, any, any> ? T : never;
|
|
317
|
-
type getReturn<Type> = Type extends RendererType<any, infer T, any, any> ? T : never;
|
|
318
|
-
type getDocument<Type> = Type extends RendererType<any, any, infer T, any> ? T : never;
|
|
319
|
-
type getOptions<Type> = Type extends RendererType<any, any, any, infer T> ? T : never;
|
|
320
|
-
type NodeRenderer<Type extends AnyRendererType, TNode> = (node: TNode, cxt: RenderContext<Type>) => getReturn<Type>;
|
|
321
|
-
type NodeRendererDefinition<Type extends AnyRendererType, TNode, TDef> = [
|
|
322
|
-
def: TDef,
|
|
323
|
-
renderer: NodeRenderer<Type, TNode>
|
|
324
|
-
];
|
|
325
|
-
declare class RenderContext<Type extends AnyRendererType> {
|
|
326
|
-
readonly config: RenderConfiguration<Type>;
|
|
327
|
-
readonly parsedDocument: Document$1;
|
|
328
|
-
state: getState<Type>;
|
|
329
|
-
renderEntity(node: BlockEntity | InlineEntity): getReturn<Type> | undefined;
|
|
330
|
-
constructor(config: RenderConfiguration<Type>, parsedDocument: Document$1, state: getState<Type>);
|
|
331
|
-
}
|
|
332
|
-
interface ReadonlyRenderConfiguration<Type extends AnyRendererType> {
|
|
333
|
-
readonly options: getOptions<Type>;
|
|
334
|
-
readonly paragraphRenderer?: NodeRenderer<Type, ParagraphNode>;
|
|
335
|
-
readonly textRenderer?: NodeRenderer<Type, TextNode | PreNode | EscapedNode>;
|
|
336
|
-
readonly undefinedBlockRenderer?: NodeRenderer<Type, BlockModifierNode<any>>;
|
|
337
|
-
readonly undefinedInlineRenderer?: NodeRenderer<Type, InlineModifierNode<any>>;
|
|
338
|
-
readonly blockRenderers: ReadonlyMap<BlockModifierDefinition<any>, NodeRenderer<Type, BlockModifierNode<any>>>;
|
|
339
|
-
readonly inlineRenderers: ReadonlyMap<InlineModifierDefinition<any>, NodeRenderer<Type, InlineModifierNode<any>>>;
|
|
340
|
-
readonly postprocessor: (results: getReturn<Type>[], cxt: RenderContext<Type>) => getDocument<Type>;
|
|
341
|
-
render(doc: Document$1, state: getState<Type>): getDocument<Type>;
|
|
342
|
-
}
|
|
343
|
-
type BlockRendererDefiniton<Type extends AnyRendererType, ModState = any> = NodeRendererDefinition<Type, BlockModifierNode<ModState>, BlockModifierDefinition<ModState>>;
|
|
344
|
-
type InlineRendererDefiniton<Type extends AnyRendererType, ModState = any> = NodeRendererDefinition<Type, InlineModifierNode<ModState>, InlineModifierDefinition<ModState>>;
|
|
345
|
-
declare class RenderConfiguration<Type extends AnyRendererType> implements ReadonlyRenderConfiguration<Type> {
|
|
346
|
-
options: getOptions<Type>;
|
|
347
|
-
postprocessor: (results: getReturn<Type>[], cxt: RenderContext<Type>) => getDocument<Type>;
|
|
348
|
-
paragraphRenderer?: NodeRenderer<Type, ParagraphNode>;
|
|
349
|
-
textRenderer?: NodeRenderer<Type, TextNode | PreNode | EscapedNode>;
|
|
350
|
-
undefinedBlockRenderer?: NodeRenderer<Type, BlockModifierNode<any>>;
|
|
351
|
-
undefinedInlineRenderer?: NodeRenderer<Type, InlineModifierNode<any>>;
|
|
352
|
-
blockRenderers: Map<BlockModifierDefinition<any>, NodeRenderer<Type, BlockModifierNode<any>>>;
|
|
353
|
-
inlineRenderers: Map<InlineModifierDefinition<any>, NodeRenderer<Type, InlineModifierNode<any>>>;
|
|
354
|
-
constructor(options: getOptions<Type>, postprocessor: (results: getReturn<Type>[], cxt: RenderContext<Type>) => getDocument<Type>);
|
|
355
|
-
render(doc: Document$1, state: getState<Type>): getDocument<Type>;
|
|
356
|
-
addBlockRenderer(...rs: BlockRendererDefiniton<Type>[]): void;
|
|
357
|
-
addInlineRenderer(...rs: InlineRendererDefiniton<Type>[]): void;
|
|
358
|
-
static from<Type extends AnyRendererType>(from: ReadonlyRenderConfiguration<Type>): RenderConfiguration<Type>;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
declare class AddThingMessage implements Message {
|
|
362
|
-
readonly code: number;
|
|
363
|
-
readonly severity: MessageSeverity;
|
|
364
|
-
readonly location: LocationRange;
|
|
365
|
-
readonly info: string;
|
|
366
|
-
constructor(code: number, severity: MessageSeverity, location: LocationRange, info: string);
|
|
367
|
-
}
|
|
368
|
-
declare class RemoveThingMessage implements Message {
|
|
369
|
-
readonly code: number;
|
|
370
|
-
readonly severity: MessageSeverity;
|
|
371
|
-
readonly location: LocationRange;
|
|
372
|
-
readonly info: string;
|
|
373
|
-
constructor(code: number, severity: MessageSeverity, location: LocationRange, info: string);
|
|
374
|
-
}
|
|
375
|
-
declare class ExpectedMessage implements Message {
|
|
376
|
-
readonly location: LocationRange;
|
|
377
|
-
private what;
|
|
378
|
-
constructor(location: LocationRange, what: string);
|
|
379
|
-
readonly code = 1;
|
|
380
|
-
readonly severity = MessageSeverity.Error;
|
|
381
|
-
get info(): string;
|
|
382
|
-
}
|
|
383
|
-
declare class UnknownModifierMessage implements Message {
|
|
384
|
-
readonly location: LocationRange;
|
|
385
|
-
private what;
|
|
386
|
-
constructor(location: LocationRange, what: string);
|
|
387
|
-
readonly code = 2;
|
|
388
|
-
readonly severity = MessageSeverity.Error;
|
|
389
|
-
get info(): string;
|
|
390
|
-
}
|
|
391
|
-
declare class UnclosedInlineModifierMessage implements Message {
|
|
392
|
-
readonly location: LocationRange;
|
|
393
|
-
private what;
|
|
394
|
-
constructor(location: LocationRange, what: string);
|
|
395
|
-
readonly code = 3;
|
|
396
|
-
readonly severity = MessageSeverity.Error;
|
|
397
|
-
get info(): string;
|
|
398
|
-
}
|
|
399
|
-
declare class ArgumentCountMismatchMessage implements Message {
|
|
400
|
-
readonly location: LocationRange;
|
|
401
|
-
constructor(location: LocationRange, min?: number, max?: number);
|
|
402
|
-
private msg;
|
|
403
|
-
readonly code = 4;
|
|
404
|
-
readonly severity = MessageSeverity.Error;
|
|
405
|
-
get info(): string;
|
|
406
|
-
}
|
|
407
|
-
declare class CannotExpandArgumentMessage implements Message {
|
|
408
|
-
readonly location: LocationRange;
|
|
409
|
-
private what?;
|
|
410
|
-
constructor(location: LocationRange, what?: string | undefined);
|
|
411
|
-
readonly code = 5;
|
|
412
|
-
readonly severity = MessageSeverity.Error;
|
|
413
|
-
get info(): string;
|
|
414
|
-
}
|
|
415
|
-
declare class InvalidArgumentMessage implements Message {
|
|
416
|
-
readonly location: LocationRange;
|
|
417
|
-
private what?;
|
|
418
|
-
constructor(location: LocationRange, what?: string | undefined);
|
|
419
|
-
readonly code = 6;
|
|
420
|
-
readonly severity = MessageSeverity.Error;
|
|
421
|
-
get info(): string;
|
|
422
|
-
}
|
|
423
|
-
declare class EntityNotAllowedMessage implements Message {
|
|
424
|
-
readonly location: LocationRange;
|
|
425
|
-
private what?;
|
|
426
|
-
constructor(location: LocationRange, what?: string | undefined);
|
|
427
|
-
readonly code = 7;
|
|
428
|
-
readonly severity = MessageSeverity.Error;
|
|
429
|
-
get info(): string;
|
|
430
|
-
}
|
|
431
|
-
declare class ReachedRecursionLimitMessage implements Message {
|
|
432
|
-
readonly location: LocationRange;
|
|
433
|
-
private limit;
|
|
434
|
-
private what;
|
|
435
|
-
constructor(location: LocationRange, limit: number, what: string);
|
|
436
|
-
readonly code = 8;
|
|
437
|
-
readonly severity = MessageSeverity.Error;
|
|
438
|
-
get info(): string;
|
|
439
|
-
}
|
|
440
|
-
declare class SlotUsedOutsideDefinitionMessage implements Message {
|
|
441
|
-
readonly location: LocationRange;
|
|
442
|
-
constructor(location: LocationRange);
|
|
443
|
-
readonly code = 9;
|
|
444
|
-
readonly severity = MessageSeverity.Error;
|
|
445
|
-
get info(): string;
|
|
446
|
-
}
|
|
447
|
-
declare class NoNestedModuleMessage implements Message {
|
|
448
|
-
readonly location: LocationRange;
|
|
449
|
-
constructor(location: LocationRange);
|
|
450
|
-
readonly code = 10;
|
|
451
|
-
readonly severity = MessageSeverity.Error;
|
|
452
|
-
get info(): string;
|
|
453
|
-
}
|
|
454
|
-
declare class CannotUseModuleInSelfMessage implements Message {
|
|
455
|
-
readonly location: LocationRange;
|
|
456
|
-
constructor(location: LocationRange);
|
|
457
|
-
readonly code = 11;
|
|
458
|
-
readonly severity = MessageSeverity.Error;
|
|
459
|
-
get info(): string;
|
|
460
|
-
}
|
|
461
|
-
declare class EitherNormalOrPreMessage implements Message {
|
|
462
|
-
readonly location: LocationRange;
|
|
463
|
-
constructor(location: LocationRange);
|
|
464
|
-
readonly code = 12;
|
|
465
|
-
readonly severity = MessageSeverity.Error;
|
|
466
|
-
get info(): string;
|
|
467
|
-
}
|
|
468
|
-
declare class MultipleBlocksNotPermittedMessage implements Message {
|
|
469
|
-
readonly location: LocationRange;
|
|
470
|
-
constructor(location: LocationRange);
|
|
471
|
-
readonly code = 13;
|
|
472
|
-
readonly severity = MessageSeverity.Error;
|
|
473
|
-
get info(): string;
|
|
474
|
-
}
|
|
475
|
-
declare class OnlySimpleParagraphsPermittedMessage implements Message {
|
|
476
|
-
readonly location: LocationRange;
|
|
477
|
-
constructor(location: LocationRange);
|
|
478
|
-
readonly code = 14;
|
|
479
|
-
readonly severity = MessageSeverity.Error;
|
|
480
|
-
get info(): string;
|
|
481
|
-
}
|
|
482
|
-
declare class UnnecessaryNewlineMessage extends RemoveThingMessage {
|
|
483
|
-
constructor(location: LocationRange);
|
|
484
|
-
}
|
|
485
|
-
declare class NewBlockShouldBeOnNewlineMessage extends AddThingMessage {
|
|
486
|
-
constructor(location: LocationRange);
|
|
487
|
-
}
|
|
488
|
-
declare class ShouldBeOnNewlineMessage extends AddThingMessage {
|
|
489
|
-
constructor(location: LocationRange);
|
|
490
|
-
}
|
|
491
|
-
declare class NameAlreadyDefinedMessage implements Message {
|
|
492
|
-
readonly location: LocationRange;
|
|
493
|
-
private what;
|
|
494
|
-
constructor(location: LocationRange, what: string);
|
|
495
|
-
readonly code = 4;
|
|
496
|
-
readonly severity = MessageSeverity.Warning;
|
|
497
|
-
get info(): string;
|
|
498
|
-
}
|
|
499
|
-
declare class UndefinedVariableMessage implements Message {
|
|
500
|
-
readonly location: LocationRange;
|
|
501
|
-
private what;
|
|
502
|
-
constructor(location: LocationRange, what: string);
|
|
503
|
-
readonly code = 5;
|
|
504
|
-
readonly severity = MessageSeverity.Warning;
|
|
505
|
-
get info(): string;
|
|
506
|
-
}
|
|
507
|
-
declare class OverwriteDefinitionsMessage implements Message {
|
|
508
|
-
readonly location: LocationRange;
|
|
509
|
-
private what;
|
|
510
|
-
constructor(location: LocationRange, what: string);
|
|
511
|
-
readonly code = 6;
|
|
512
|
-
readonly severity = MessageSeverity.Warning;
|
|
513
|
-
get info(): string;
|
|
514
|
-
}
|
|
515
|
-
declare class OverwriteSpecialVariableMessage implements Message {
|
|
516
|
-
readonly location: LocationRange;
|
|
517
|
-
private varname;
|
|
518
|
-
private previous;
|
|
519
|
-
constructor(location: LocationRange, varname: string, previous: string);
|
|
520
|
-
readonly code = 6;
|
|
521
|
-
readonly severity = MessageSeverity.Warning;
|
|
522
|
-
get info(): string;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
type messages_ArgumentCountMismatchMessage = ArgumentCountMismatchMessage;
|
|
526
|
-
declare const messages_ArgumentCountMismatchMessage: typeof ArgumentCountMismatchMessage;
|
|
527
|
-
type messages_CannotExpandArgumentMessage = CannotExpandArgumentMessage;
|
|
528
|
-
declare const messages_CannotExpandArgumentMessage: typeof CannotExpandArgumentMessage;
|
|
529
|
-
type messages_CannotUseModuleInSelfMessage = CannotUseModuleInSelfMessage;
|
|
530
|
-
declare const messages_CannotUseModuleInSelfMessage: typeof CannotUseModuleInSelfMessage;
|
|
531
|
-
type messages_EitherNormalOrPreMessage = EitherNormalOrPreMessage;
|
|
532
|
-
declare const messages_EitherNormalOrPreMessage: typeof EitherNormalOrPreMessage;
|
|
533
|
-
type messages_EntityNotAllowedMessage = EntityNotAllowedMessage;
|
|
534
|
-
declare const messages_EntityNotAllowedMessage: typeof EntityNotAllowedMessage;
|
|
535
|
-
type messages_ExpectedMessage = ExpectedMessage;
|
|
536
|
-
declare const messages_ExpectedMessage: typeof ExpectedMessage;
|
|
537
|
-
type messages_InvalidArgumentMessage = InvalidArgumentMessage;
|
|
538
|
-
declare const messages_InvalidArgumentMessage: typeof InvalidArgumentMessage;
|
|
539
|
-
type messages_MultipleBlocksNotPermittedMessage = MultipleBlocksNotPermittedMessage;
|
|
540
|
-
declare const messages_MultipleBlocksNotPermittedMessage: typeof MultipleBlocksNotPermittedMessage;
|
|
541
|
-
type messages_NameAlreadyDefinedMessage = NameAlreadyDefinedMessage;
|
|
542
|
-
declare const messages_NameAlreadyDefinedMessage: typeof NameAlreadyDefinedMessage;
|
|
543
|
-
type messages_NewBlockShouldBeOnNewlineMessage = NewBlockShouldBeOnNewlineMessage;
|
|
544
|
-
declare const messages_NewBlockShouldBeOnNewlineMessage: typeof NewBlockShouldBeOnNewlineMessage;
|
|
545
|
-
type messages_NoNestedModuleMessage = NoNestedModuleMessage;
|
|
546
|
-
declare const messages_NoNestedModuleMessage: typeof NoNestedModuleMessage;
|
|
547
|
-
type messages_OnlySimpleParagraphsPermittedMessage = OnlySimpleParagraphsPermittedMessage;
|
|
548
|
-
declare const messages_OnlySimpleParagraphsPermittedMessage: typeof OnlySimpleParagraphsPermittedMessage;
|
|
549
|
-
type messages_OverwriteDefinitionsMessage = OverwriteDefinitionsMessage;
|
|
550
|
-
declare const messages_OverwriteDefinitionsMessage: typeof OverwriteDefinitionsMessage;
|
|
551
|
-
type messages_OverwriteSpecialVariableMessage = OverwriteSpecialVariableMessage;
|
|
552
|
-
declare const messages_OverwriteSpecialVariableMessage: typeof OverwriteSpecialVariableMessage;
|
|
553
|
-
type messages_ReachedRecursionLimitMessage = ReachedRecursionLimitMessage;
|
|
554
|
-
declare const messages_ReachedRecursionLimitMessage: typeof ReachedRecursionLimitMessage;
|
|
555
|
-
type messages_ShouldBeOnNewlineMessage = ShouldBeOnNewlineMessage;
|
|
556
|
-
declare const messages_ShouldBeOnNewlineMessage: typeof ShouldBeOnNewlineMessage;
|
|
557
|
-
type messages_SlotUsedOutsideDefinitionMessage = SlotUsedOutsideDefinitionMessage;
|
|
558
|
-
declare const messages_SlotUsedOutsideDefinitionMessage: typeof SlotUsedOutsideDefinitionMessage;
|
|
559
|
-
type messages_UnclosedInlineModifierMessage = UnclosedInlineModifierMessage;
|
|
560
|
-
declare const messages_UnclosedInlineModifierMessage: typeof UnclosedInlineModifierMessage;
|
|
561
|
-
type messages_UndefinedVariableMessage = UndefinedVariableMessage;
|
|
562
|
-
declare const messages_UndefinedVariableMessage: typeof UndefinedVariableMessage;
|
|
563
|
-
type messages_UnknownModifierMessage = UnknownModifierMessage;
|
|
564
|
-
declare const messages_UnknownModifierMessage: typeof UnknownModifierMessage;
|
|
565
|
-
type messages_UnnecessaryNewlineMessage = UnnecessaryNewlineMessage;
|
|
566
|
-
declare const messages_UnnecessaryNewlineMessage: typeof UnnecessaryNewlineMessage;
|
|
567
|
-
declare namespace messages {
|
|
568
|
-
export { messages_ArgumentCountMismatchMessage as ArgumentCountMismatchMessage, messages_CannotExpandArgumentMessage as CannotExpandArgumentMessage, messages_CannotUseModuleInSelfMessage as CannotUseModuleInSelfMessage, messages_EitherNormalOrPreMessage as EitherNormalOrPreMessage, messages_EntityNotAllowedMessage as EntityNotAllowedMessage, messages_ExpectedMessage as ExpectedMessage, messages_InvalidArgumentMessage as InvalidArgumentMessage, messages_MultipleBlocksNotPermittedMessage as MultipleBlocksNotPermittedMessage, messages_NameAlreadyDefinedMessage as NameAlreadyDefinedMessage, messages_NewBlockShouldBeOnNewlineMessage as NewBlockShouldBeOnNewlineMessage, messages_NoNestedModuleMessage as NoNestedModuleMessage, messages_OnlySimpleParagraphsPermittedMessage as OnlySimpleParagraphsPermittedMessage, messages_OverwriteDefinitionsMessage as OverwriteDefinitionsMessage, messages_OverwriteSpecialVariableMessage as OverwriteSpecialVariableMessage, messages_ReachedRecursionLimitMessage as ReachedRecursionLimitMessage, messages_ShouldBeOnNewlineMessage as ShouldBeOnNewlineMessage, messages_SlotUsedOutsideDefinitionMessage as SlotUsedOutsideDefinitionMessage, messages_UnclosedInlineModifierMessage as UnclosedInlineModifierMessage, messages_UndefinedVariableMessage as UndefinedVariableMessage, messages_UnknownModifierMessage as UnknownModifierMessage, messages_UnnecessaryNewlineMessage as UnnecessaryNewlineMessage };
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
declare function checkArgumentLength(node: ModifierNode, min?: number, max?: number | undefined): Message[] | null;
|
|
572
|
-
declare function checkArguments(node: ModifierNode, min?: number, max?: number | undefined): Message[] | null;
|
|
573
|
-
declare function onlyPermitPlaintextParagraph(node: BlockModifierNode<any> | SystemModifierNode<any>): Message[] | string;
|
|
574
|
-
declare function onlyPermitSimpleParagraphs(node: BlockModifierNode<any> | SystemModifierNode<any>): Message[] | null;
|
|
575
|
-
declare function onlyPermitSingleBlock(node: BlockModifierNode<any> | SystemModifierNode<any>): Message[] | null;
|
|
576
|
-
|
|
577
|
-
declare const modifierHelper_checkArgumentLength: typeof checkArgumentLength;
|
|
578
|
-
declare const modifierHelper_checkArguments: typeof checkArguments;
|
|
579
|
-
declare const modifierHelper_onlyPermitPlaintextParagraph: typeof onlyPermitPlaintextParagraph;
|
|
580
|
-
declare const modifierHelper_onlyPermitSimpleParagraphs: typeof onlyPermitSimpleParagraphs;
|
|
581
|
-
declare const modifierHelper_onlyPermitSingleBlock: typeof onlyPermitSingleBlock;
|
|
582
|
-
declare namespace modifierHelper {
|
|
583
|
-
export { modifierHelper_checkArgumentLength as checkArgumentLength, modifierHelper_checkArguments as checkArguments, modifierHelper_onlyPermitPlaintextParagraph as onlyPermitPlaintextParagraph, modifierHelper_onlyPermitSimpleParagraphs as onlyPermitSimpleParagraphs, modifierHelper_onlyPermitSingleBlock as onlyPermitSingleBlock };
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
declare const BuiltinConfiguration: ReadonlyConfiguration;
|
|
587
|
-
|
|
588
|
-
declare const DefaultConfiguration: ReadonlyConfiguration;
|
|
589
|
-
|
|
590
|
-
type HTMLRendererOptions = {
|
|
591
|
-
headPlugins: HTMLComponentPlugin[];
|
|
592
|
-
headerPlugins: HTMLComponentPlugin[];
|
|
593
|
-
footerPlugins: HTMLComponentPlugin[];
|
|
594
|
-
postprocessPlugins: HTMLPostprocessPlugin[];
|
|
595
|
-
transformAsset: (id: string) => string | undefined;
|
|
596
|
-
};
|
|
597
|
-
type HTMLRenderType = {
|
|
598
|
-
state: HTMLRenderState;
|
|
599
|
-
options: HTMLRendererOptions;
|
|
600
|
-
document: Document;
|
|
601
|
-
return: Node | Node[];
|
|
602
|
-
};
|
|
603
|
-
type HTMLRenderPlugin = (elem: BlockEntity | InlineEntity, cxt: RenderContext<HTMLRenderType>) => string | undefined;
|
|
604
|
-
type HTMLComponentPlugin = (cxt: RenderContext<HTMLRenderType>) => Node | Node[] | undefined;
|
|
605
|
-
type HTMLPostprocessPlugin = (cxt: RenderContext<HTMLRenderType>, output: Document) => void;
|
|
606
|
-
declare class HTMLRenderState {
|
|
607
|
-
title: string;
|
|
608
|
-
stylesheet: string;
|
|
609
|
-
cssVariables: Map<string, string>;
|
|
610
|
-
invalidBlock(node: BlockEntity, msg: string): minimal_jsx_runtime.JSX.Element;
|
|
611
|
-
invalidInline(node: InlineEntity, msg: string): minimal_jsx_runtime.JSX.Element;
|
|
612
|
-
render(elems: (BlockEntity | InlineEntity)[], cxt: RenderContext<HTMLRenderType>): DocumentFragment;
|
|
613
|
-
}
|
|
614
|
-
declare const HTMLRenderConfiguration: ReadonlyRenderConfiguration<HTMLRenderType>;
|
|
615
|
-
|
|
616
|
-
declare const debugPrint: {
|
|
617
|
-
blockModifier: (x: BlockModifierDefinition<any>) => string;
|
|
618
|
-
inlineModifier: (x: InlineModifierDefinition<any>) => string;
|
|
619
|
-
inlineShorthand: (x: InlineShorthand<any>) => string;
|
|
620
|
-
blockShorthand: (x: BlockShorthand<any>) => string;
|
|
621
|
-
argument: (arg: ModifierArgument) => string;
|
|
622
|
-
node: (...nodes: (BlockEntity | InlineEntity)[]) => string;
|
|
623
|
-
message: typeof debugPrintMsg;
|
|
624
|
-
range: typeof debugPrintRange;
|
|
625
|
-
document: typeof debugDumpDocument;
|
|
626
|
-
};
|
|
627
|
-
declare function debugPrintRange(loc: LocationRange, context?: number): string;
|
|
628
|
-
declare function debugPrintMsg(m: Message): string;
|
|
629
|
-
declare function debugDumpDocument(doc: Document$1): string;
|
|
630
|
-
|
|
631
|
-
declare const emmmVersion = "0.0.6";
|
|
632
|
-
declare function setDebugLevel(level: DebugLevel): void;
|
|
633
|
-
|
|
634
|
-
export { type ArgumentEntity, ArgumentInterpolatorDefinition, type BlockEntity, BlockModifierDefinition, type BlockModifierNode, type BlockRendererDefiniton, type BlockShorthand, BuiltinConfiguration, Configuration, DebugLevel, DefaultConfiguration, Document$1 as Document, type DocumentNode, type EscapedNode, type HTMLComponentPlugin, type HTMLPostprocessPlugin, HTMLRenderConfiguration, type HTMLRenderPlugin, HTMLRenderState, type HTMLRenderType, type HTMLRendererOptions, type InlineEntity, InlineModifierDefinition, type InlineModifierNode, type InlineRendererDefiniton, type InlineShorthand, type InterpolationNode, type LocationRange, type Message, MessageSeverity, type ModifierArgument, type ModifierNode, ModifierSlotType, type NodeRenderer, type NodeRendererDefinition, NodeType, type ParagraphNode, ParseContext, type ParseContextStoreDefinitions, type ParseContextStoreKey, type PreNode, type ReadonlyConfiguration, type ReadonlyRenderConfiguration, RenderConfiguration, RenderContext, type RendererType, type RootNode, type Scanner, SimpleScanner, type Source, type SourceDescriptor, StringSource, SystemModifierDefinition, type SystemModifierNode, type TextNode, debugPrint, emmmVersion, modifierHelper as helper, messages, parse, setDebugLevel };
|