@xyd-js/content 0.1.0-xyd.3 → 0.1.0-xyd.4
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/index.d.ts +782 -9
- package/dist/navigation.js +6 -6
- package/package.json +6 -3
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,98 @@ import * as remark_mdx_frontmatter from 'remark-mdx-frontmatter';
|
|
|
3
3
|
import * as unified from 'unified';
|
|
4
4
|
import remarkFrontmatter from 'remark-frontmatter';
|
|
5
5
|
import remarkGfm from 'remark-gfm';
|
|
6
|
-
import * as estree from 'estree';
|
|
7
6
|
|
|
8
7
|
declare function compileBySlug(slug: string, mdx: boolean): Promise<string>;
|
|
9
8
|
|
|
9
|
+
// ## Interfaces
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Info associated with nodes by the ecosystem.
|
|
13
|
+
*
|
|
14
|
+
* This space is guaranteed to never be specified by unist or specifications
|
|
15
|
+
* implementing unist.
|
|
16
|
+
* But you can use it in utilities and plugins to store data.
|
|
17
|
+
*
|
|
18
|
+
* This type can be augmented to register custom data.
|
|
19
|
+
* For example:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* declare module 'unist' {
|
|
23
|
+
* interface Data {
|
|
24
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
25
|
+
* myId?: number | undefined
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
interface Data {}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* One place in a source file.
|
|
34
|
+
*/
|
|
35
|
+
interface Point {
|
|
36
|
+
/**
|
|
37
|
+
* Line in a source file (1-indexed integer).
|
|
38
|
+
*/
|
|
39
|
+
line: number;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Column in a source file (1-indexed integer).
|
|
43
|
+
*/
|
|
44
|
+
column: number;
|
|
45
|
+
/**
|
|
46
|
+
* Character in a source file (0-indexed integer).
|
|
47
|
+
*/
|
|
48
|
+
offset?: number | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Position of a node in a source document.
|
|
53
|
+
*
|
|
54
|
+
* A position is a range between two points.
|
|
55
|
+
*/
|
|
56
|
+
interface Position$1 {
|
|
57
|
+
/**
|
|
58
|
+
* Place of the first character of the parsed source region.
|
|
59
|
+
*/
|
|
60
|
+
start: Point;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Place of the first character after the parsed source region.
|
|
64
|
+
*/
|
|
65
|
+
end: Point;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Abstract unist node.
|
|
70
|
+
*
|
|
71
|
+
* The syntactic unit in unist syntax trees are called nodes.
|
|
72
|
+
*
|
|
73
|
+
* This interface is supposed to be extended.
|
|
74
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
75
|
+
* But for example in markdown, a `thematicBreak` (`***`), is neither literal
|
|
76
|
+
* nor parent, but still a node.
|
|
77
|
+
*/
|
|
78
|
+
interface Node$1 {
|
|
79
|
+
/**
|
|
80
|
+
* Node type.
|
|
81
|
+
*/
|
|
82
|
+
type: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Info from the ecosystem.
|
|
86
|
+
*/
|
|
87
|
+
data?: Data | undefined;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Position of a node in a source document.
|
|
91
|
+
*
|
|
92
|
+
* Nodes that are generated (not in the original source document) must not
|
|
93
|
+
* have a position.
|
|
94
|
+
*/
|
|
95
|
+
position?: Position$1 | undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
10
98
|
type CustomTag = {
|
|
11
99
|
name: RegExp;
|
|
12
100
|
depth: (name: string) => number;
|
|
@@ -18,23 +106,708 @@ interface RemarkMdxTocOptions {
|
|
|
18
106
|
}
|
|
19
107
|
|
|
20
108
|
declare function mdxOptions(toc: RemarkMdxTocOptions): {
|
|
21
|
-
remarkPlugins: (unified.Plugin | typeof remarkFrontmatter | unified.Plugin<[(remark_mdx_frontmatter.RemarkMdxFrontmatterOptions | undefined)?], mdast.Root> | typeof remarkGfm)[];
|
|
109
|
+
remarkPlugins: (unified.Plugin<[], Node$1, Node$1> | typeof remarkFrontmatter | unified.Plugin<[(remark_mdx_frontmatter.RemarkMdxFrontmatterOptions | undefined)?], mdast.Root, mdast.Root> | typeof remarkGfm)[];
|
|
22
110
|
rehypePlugins: never[];
|
|
23
111
|
};
|
|
24
112
|
|
|
113
|
+
// This definition file follows a somewhat unusual format. ESTree allows
|
|
114
|
+
// runtime type checks based on the `type` parameter. In order to explain this
|
|
115
|
+
// to typescript we want to use discriminated union types:
|
|
116
|
+
// https://github.com/Microsoft/TypeScript/pull/9163
|
|
117
|
+
//
|
|
118
|
+
// For ESTree this is a bit tricky because the high level interfaces like
|
|
119
|
+
// Node or Function are pulling double duty. We want to pass common fields down
|
|
120
|
+
// to the interfaces that extend them (like Identifier or
|
|
121
|
+
// ArrowFunctionExpression), but you can't extend a type union or enforce
|
|
122
|
+
// common fields on them. So we've split the high level interfaces into two
|
|
123
|
+
// types, a base type which passes down inherited fields, and a type union of
|
|
124
|
+
// all types which extend the base type. Only the type union is exported, and
|
|
125
|
+
// the union is how other types refer to the collection of inheriting types.
|
|
126
|
+
//
|
|
127
|
+
// This makes the definitions file here somewhat more difficult to maintain,
|
|
128
|
+
// but it has the notable advantage of making ESTree much easier to use as
|
|
129
|
+
// an end user.
|
|
130
|
+
|
|
131
|
+
interface BaseNodeWithoutComments {
|
|
132
|
+
// Every leaf interface that extends BaseNode must specify a type property.
|
|
133
|
+
// The type property should be a string literal. For example, Identifier
|
|
134
|
+
// has: `type: "Identifier"`
|
|
135
|
+
type: string;
|
|
136
|
+
loc?: SourceLocation | null | undefined;
|
|
137
|
+
range?: [number, number] | undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface BaseNode extends BaseNodeWithoutComments {
|
|
141
|
+
leadingComments?: Comment[] | undefined;
|
|
142
|
+
trailingComments?: Comment[] | undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface NodeMap {
|
|
146
|
+
AssignmentProperty: AssignmentProperty;
|
|
147
|
+
CatchClause: CatchClause;
|
|
148
|
+
Class: Class;
|
|
149
|
+
ClassBody: ClassBody;
|
|
150
|
+
Expression: Expression;
|
|
151
|
+
Function: Function;
|
|
152
|
+
Identifier: Identifier;
|
|
153
|
+
Literal: Literal;
|
|
154
|
+
MethodDefinition: MethodDefinition;
|
|
155
|
+
ModuleDeclaration: ModuleDeclaration;
|
|
156
|
+
ModuleSpecifier: ModuleSpecifier;
|
|
157
|
+
Pattern: Pattern;
|
|
158
|
+
PrivateIdentifier: PrivateIdentifier;
|
|
159
|
+
Program: Program;
|
|
160
|
+
Property: Property;
|
|
161
|
+
PropertyDefinition: PropertyDefinition;
|
|
162
|
+
SpreadElement: SpreadElement;
|
|
163
|
+
Statement: Statement;
|
|
164
|
+
Super: Super;
|
|
165
|
+
SwitchCase: SwitchCase;
|
|
166
|
+
TemplateElement: TemplateElement;
|
|
167
|
+
VariableDeclarator: VariableDeclarator;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
type Node = NodeMap[keyof NodeMap];
|
|
171
|
+
|
|
172
|
+
interface Comment extends BaseNodeWithoutComments {
|
|
173
|
+
type: "Line" | "Block";
|
|
174
|
+
value: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface SourceLocation {
|
|
178
|
+
source?: string | null | undefined;
|
|
179
|
+
start: Position;
|
|
180
|
+
end: Position;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
interface Position {
|
|
184
|
+
/** >= 1 */
|
|
185
|
+
line: number;
|
|
186
|
+
/** >= 0 */
|
|
187
|
+
column: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface Program extends BaseNode {
|
|
191
|
+
type: "Program";
|
|
192
|
+
sourceType: "script" | "module";
|
|
193
|
+
body: Array<Directive | Statement | ModuleDeclaration>;
|
|
194
|
+
comments?: Comment[] | undefined;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface Directive extends BaseNode {
|
|
198
|
+
type: "ExpressionStatement";
|
|
199
|
+
expression: Literal;
|
|
200
|
+
directive: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
interface BaseFunction extends BaseNode {
|
|
204
|
+
params: Pattern[];
|
|
205
|
+
generator?: boolean | undefined;
|
|
206
|
+
async?: boolean | undefined;
|
|
207
|
+
// The body is either BlockStatement or Expression because arrow functions
|
|
208
|
+
// can have a body that's either. FunctionDeclarations and
|
|
209
|
+
// FunctionExpressions have only BlockStatement bodies.
|
|
210
|
+
body: BlockStatement | Expression;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
|
214
|
+
|
|
215
|
+
type Statement =
|
|
216
|
+
| ExpressionStatement
|
|
217
|
+
| BlockStatement
|
|
218
|
+
| StaticBlock
|
|
219
|
+
| EmptyStatement
|
|
220
|
+
| DebuggerStatement
|
|
221
|
+
| WithStatement
|
|
222
|
+
| ReturnStatement
|
|
223
|
+
| LabeledStatement
|
|
224
|
+
| BreakStatement
|
|
225
|
+
| ContinueStatement
|
|
226
|
+
| IfStatement
|
|
227
|
+
| SwitchStatement
|
|
228
|
+
| ThrowStatement
|
|
229
|
+
| TryStatement
|
|
230
|
+
| WhileStatement
|
|
231
|
+
| DoWhileStatement
|
|
232
|
+
| ForStatement
|
|
233
|
+
| ForInStatement
|
|
234
|
+
| ForOfStatement
|
|
235
|
+
| Declaration;
|
|
236
|
+
|
|
237
|
+
interface BaseStatement extends BaseNode {}
|
|
238
|
+
|
|
239
|
+
interface EmptyStatement extends BaseStatement {
|
|
240
|
+
type: "EmptyStatement";
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
interface BlockStatement extends BaseStatement {
|
|
244
|
+
type: "BlockStatement";
|
|
245
|
+
body: Statement[];
|
|
246
|
+
innerComments?: Comment[] | undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
interface StaticBlock extends Omit<BlockStatement, "type"> {
|
|
250
|
+
type: "StaticBlock";
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
interface ExpressionStatement extends BaseStatement {
|
|
254
|
+
type: "ExpressionStatement";
|
|
255
|
+
expression: Expression;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
interface IfStatement extends BaseStatement {
|
|
259
|
+
type: "IfStatement";
|
|
260
|
+
test: Expression;
|
|
261
|
+
consequent: Statement;
|
|
262
|
+
alternate?: Statement | null | undefined;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
interface LabeledStatement extends BaseStatement {
|
|
266
|
+
type: "LabeledStatement";
|
|
267
|
+
label: Identifier;
|
|
268
|
+
body: Statement;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
interface BreakStatement extends BaseStatement {
|
|
272
|
+
type: "BreakStatement";
|
|
273
|
+
label?: Identifier | null | undefined;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface ContinueStatement extends BaseStatement {
|
|
277
|
+
type: "ContinueStatement";
|
|
278
|
+
label?: Identifier | null | undefined;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
interface WithStatement extends BaseStatement {
|
|
282
|
+
type: "WithStatement";
|
|
283
|
+
object: Expression;
|
|
284
|
+
body: Statement;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
interface SwitchStatement extends BaseStatement {
|
|
288
|
+
type: "SwitchStatement";
|
|
289
|
+
discriminant: Expression;
|
|
290
|
+
cases: SwitchCase[];
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
interface ReturnStatement extends BaseStatement {
|
|
294
|
+
type: "ReturnStatement";
|
|
295
|
+
argument?: Expression | null | undefined;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface ThrowStatement extends BaseStatement {
|
|
299
|
+
type: "ThrowStatement";
|
|
300
|
+
argument: Expression;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
interface TryStatement extends BaseStatement {
|
|
304
|
+
type: "TryStatement";
|
|
305
|
+
block: BlockStatement;
|
|
306
|
+
handler?: CatchClause | null | undefined;
|
|
307
|
+
finalizer?: BlockStatement | null | undefined;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
interface WhileStatement extends BaseStatement {
|
|
311
|
+
type: "WhileStatement";
|
|
312
|
+
test: Expression;
|
|
313
|
+
body: Statement;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
interface DoWhileStatement extends BaseStatement {
|
|
317
|
+
type: "DoWhileStatement";
|
|
318
|
+
body: Statement;
|
|
319
|
+
test: Expression;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface ForStatement extends BaseStatement {
|
|
323
|
+
type: "ForStatement";
|
|
324
|
+
init?: VariableDeclaration | Expression | null | undefined;
|
|
325
|
+
test?: Expression | null | undefined;
|
|
326
|
+
update?: Expression | null | undefined;
|
|
327
|
+
body: Statement;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
interface BaseForXStatement extends BaseStatement {
|
|
331
|
+
left: VariableDeclaration | Pattern;
|
|
332
|
+
right: Expression;
|
|
333
|
+
body: Statement;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
interface ForInStatement extends BaseForXStatement {
|
|
337
|
+
type: "ForInStatement";
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
interface DebuggerStatement extends BaseStatement {
|
|
341
|
+
type: "DebuggerStatement";
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
|
|
345
|
+
|
|
346
|
+
interface BaseDeclaration extends BaseStatement {}
|
|
347
|
+
|
|
348
|
+
interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
|
|
349
|
+
type: "FunctionDeclaration";
|
|
350
|
+
/** It is null when a function declaration is a part of the `export default function` statement */
|
|
351
|
+
id: Identifier | null;
|
|
352
|
+
body: BlockStatement;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
|
|
356
|
+
id: Identifier;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
interface VariableDeclaration extends BaseDeclaration {
|
|
360
|
+
type: "VariableDeclaration";
|
|
361
|
+
declarations: VariableDeclarator[];
|
|
362
|
+
kind: "var" | "let" | "const";
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
interface VariableDeclarator extends BaseNode {
|
|
366
|
+
type: "VariableDeclarator";
|
|
367
|
+
id: Pattern;
|
|
368
|
+
init?: Expression | null | undefined;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
interface ExpressionMap {
|
|
372
|
+
ArrayExpression: ArrayExpression;
|
|
373
|
+
ArrowFunctionExpression: ArrowFunctionExpression;
|
|
374
|
+
AssignmentExpression: AssignmentExpression;
|
|
375
|
+
AwaitExpression: AwaitExpression;
|
|
376
|
+
BinaryExpression: BinaryExpression;
|
|
377
|
+
CallExpression: CallExpression;
|
|
378
|
+
ChainExpression: ChainExpression;
|
|
379
|
+
ClassExpression: ClassExpression;
|
|
380
|
+
ConditionalExpression: ConditionalExpression;
|
|
381
|
+
FunctionExpression: FunctionExpression;
|
|
382
|
+
Identifier: Identifier;
|
|
383
|
+
ImportExpression: ImportExpression;
|
|
384
|
+
Literal: Literal;
|
|
385
|
+
LogicalExpression: LogicalExpression;
|
|
386
|
+
MemberExpression: MemberExpression;
|
|
387
|
+
MetaProperty: MetaProperty;
|
|
388
|
+
NewExpression: NewExpression;
|
|
389
|
+
ObjectExpression: ObjectExpression;
|
|
390
|
+
SequenceExpression: SequenceExpression;
|
|
391
|
+
TaggedTemplateExpression: TaggedTemplateExpression;
|
|
392
|
+
TemplateLiteral: TemplateLiteral;
|
|
393
|
+
ThisExpression: ThisExpression;
|
|
394
|
+
UnaryExpression: UnaryExpression;
|
|
395
|
+
UpdateExpression: UpdateExpression;
|
|
396
|
+
YieldExpression: YieldExpression;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
type Expression = ExpressionMap[keyof ExpressionMap];
|
|
400
|
+
|
|
401
|
+
interface BaseExpression extends BaseNode {}
|
|
402
|
+
|
|
403
|
+
type ChainElement = SimpleCallExpression | MemberExpression;
|
|
404
|
+
|
|
405
|
+
interface ChainExpression extends BaseExpression {
|
|
406
|
+
type: "ChainExpression";
|
|
407
|
+
expression: ChainElement;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
interface ThisExpression extends BaseExpression {
|
|
411
|
+
type: "ThisExpression";
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
interface ArrayExpression extends BaseExpression {
|
|
415
|
+
type: "ArrayExpression";
|
|
416
|
+
elements: Array<Expression | SpreadElement | null>;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
interface ObjectExpression extends BaseExpression {
|
|
420
|
+
type: "ObjectExpression";
|
|
421
|
+
properties: Array<Property | SpreadElement>;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
interface PrivateIdentifier extends BaseNode {
|
|
425
|
+
type: "PrivateIdentifier";
|
|
426
|
+
name: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
interface Property extends BaseNode {
|
|
430
|
+
type: "Property";
|
|
431
|
+
key: Expression | PrivateIdentifier;
|
|
432
|
+
value: Expression | Pattern; // Could be an AssignmentProperty
|
|
433
|
+
kind: "init" | "get" | "set";
|
|
434
|
+
method: boolean;
|
|
435
|
+
shorthand: boolean;
|
|
436
|
+
computed: boolean;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
interface PropertyDefinition extends BaseNode {
|
|
440
|
+
type: "PropertyDefinition";
|
|
441
|
+
key: Expression | PrivateIdentifier;
|
|
442
|
+
value?: Expression | null | undefined;
|
|
443
|
+
computed: boolean;
|
|
444
|
+
static: boolean;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
interface FunctionExpression extends BaseFunction, BaseExpression {
|
|
448
|
+
id?: Identifier | null | undefined;
|
|
449
|
+
type: "FunctionExpression";
|
|
450
|
+
body: BlockStatement;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
interface SequenceExpression extends BaseExpression {
|
|
454
|
+
type: "SequenceExpression";
|
|
455
|
+
expressions: Expression[];
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
interface UnaryExpression extends BaseExpression {
|
|
459
|
+
type: "UnaryExpression";
|
|
460
|
+
operator: UnaryOperator;
|
|
461
|
+
prefix: true;
|
|
462
|
+
argument: Expression;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
interface BinaryExpression extends BaseExpression {
|
|
466
|
+
type: "BinaryExpression";
|
|
467
|
+
operator: BinaryOperator;
|
|
468
|
+
left: Expression | PrivateIdentifier;
|
|
469
|
+
right: Expression;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
interface AssignmentExpression extends BaseExpression {
|
|
473
|
+
type: "AssignmentExpression";
|
|
474
|
+
operator: AssignmentOperator;
|
|
475
|
+
left: Pattern | MemberExpression;
|
|
476
|
+
right: Expression;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
interface UpdateExpression extends BaseExpression {
|
|
480
|
+
type: "UpdateExpression";
|
|
481
|
+
operator: UpdateOperator;
|
|
482
|
+
argument: Expression;
|
|
483
|
+
prefix: boolean;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
interface LogicalExpression extends BaseExpression {
|
|
487
|
+
type: "LogicalExpression";
|
|
488
|
+
operator: LogicalOperator;
|
|
489
|
+
left: Expression;
|
|
490
|
+
right: Expression;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
interface ConditionalExpression extends BaseExpression {
|
|
494
|
+
type: "ConditionalExpression";
|
|
495
|
+
test: Expression;
|
|
496
|
+
alternate: Expression;
|
|
497
|
+
consequent: Expression;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
interface BaseCallExpression extends BaseExpression {
|
|
501
|
+
callee: Expression | Super;
|
|
502
|
+
arguments: Array<Expression | SpreadElement>;
|
|
503
|
+
}
|
|
504
|
+
type CallExpression = SimpleCallExpression | NewExpression;
|
|
505
|
+
|
|
506
|
+
interface SimpleCallExpression extends BaseCallExpression {
|
|
507
|
+
type: "CallExpression";
|
|
508
|
+
optional: boolean;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
interface NewExpression extends BaseCallExpression {
|
|
512
|
+
type: "NewExpression";
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
interface MemberExpression extends BaseExpression, BasePattern {
|
|
516
|
+
type: "MemberExpression";
|
|
517
|
+
object: Expression | Super;
|
|
518
|
+
property: Expression | PrivateIdentifier;
|
|
519
|
+
computed: boolean;
|
|
520
|
+
optional: boolean;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
|
|
524
|
+
|
|
525
|
+
interface BasePattern extends BaseNode {}
|
|
526
|
+
|
|
527
|
+
interface SwitchCase extends BaseNode {
|
|
528
|
+
type: "SwitchCase";
|
|
529
|
+
test?: Expression | null | undefined;
|
|
530
|
+
consequent: Statement[];
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
interface CatchClause extends BaseNode {
|
|
534
|
+
type: "CatchClause";
|
|
535
|
+
param: Pattern | null;
|
|
536
|
+
body: BlockStatement;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
interface Identifier extends BaseNode, BaseExpression, BasePattern {
|
|
540
|
+
type: "Identifier";
|
|
541
|
+
name: string;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
|
|
545
|
+
|
|
546
|
+
interface SimpleLiteral extends BaseNode, BaseExpression {
|
|
547
|
+
type: "Literal";
|
|
548
|
+
value: string | boolean | number | null;
|
|
549
|
+
raw?: string | undefined;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
interface RegExpLiteral extends BaseNode, BaseExpression {
|
|
553
|
+
type: "Literal";
|
|
554
|
+
value?: RegExp | null | undefined;
|
|
555
|
+
regex: {
|
|
556
|
+
pattern: string;
|
|
557
|
+
flags: string;
|
|
558
|
+
};
|
|
559
|
+
raw?: string | undefined;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
interface BigIntLiteral extends BaseNode, BaseExpression {
|
|
563
|
+
type: "Literal";
|
|
564
|
+
value?: bigint | null | undefined;
|
|
565
|
+
bigint: string;
|
|
566
|
+
raw?: string | undefined;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
|
570
|
+
|
|
571
|
+
type BinaryOperator =
|
|
572
|
+
| "=="
|
|
573
|
+
| "!="
|
|
574
|
+
| "==="
|
|
575
|
+
| "!=="
|
|
576
|
+
| "<"
|
|
577
|
+
| "<="
|
|
578
|
+
| ">"
|
|
579
|
+
| ">="
|
|
580
|
+
| "<<"
|
|
581
|
+
| ">>"
|
|
582
|
+
| ">>>"
|
|
583
|
+
| "+"
|
|
584
|
+
| "-"
|
|
585
|
+
| "*"
|
|
586
|
+
| "/"
|
|
587
|
+
| "%"
|
|
588
|
+
| "**"
|
|
589
|
+
| "|"
|
|
590
|
+
| "^"
|
|
591
|
+
| "&"
|
|
592
|
+
| "in"
|
|
593
|
+
| "instanceof";
|
|
594
|
+
|
|
595
|
+
type LogicalOperator = "||" | "&&" | "??";
|
|
596
|
+
|
|
597
|
+
type AssignmentOperator =
|
|
598
|
+
| "="
|
|
599
|
+
| "+="
|
|
600
|
+
| "-="
|
|
601
|
+
| "*="
|
|
602
|
+
| "/="
|
|
603
|
+
| "%="
|
|
604
|
+
| "**="
|
|
605
|
+
| "<<="
|
|
606
|
+
| ">>="
|
|
607
|
+
| ">>>="
|
|
608
|
+
| "|="
|
|
609
|
+
| "^="
|
|
610
|
+
| "&="
|
|
611
|
+
| "||="
|
|
612
|
+
| "&&="
|
|
613
|
+
| "??=";
|
|
614
|
+
|
|
615
|
+
type UpdateOperator = "++" | "--";
|
|
616
|
+
|
|
617
|
+
interface ForOfStatement extends BaseForXStatement {
|
|
618
|
+
type: "ForOfStatement";
|
|
619
|
+
await: boolean;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
interface Super extends BaseNode {
|
|
623
|
+
type: "Super";
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
interface SpreadElement extends BaseNode {
|
|
627
|
+
type: "SpreadElement";
|
|
628
|
+
argument: Expression;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
|
|
632
|
+
type: "ArrowFunctionExpression";
|
|
633
|
+
expression: boolean;
|
|
634
|
+
body: BlockStatement | Expression;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
interface YieldExpression extends BaseExpression {
|
|
638
|
+
type: "YieldExpression";
|
|
639
|
+
argument?: Expression | null | undefined;
|
|
640
|
+
delegate: boolean;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
interface TemplateLiteral extends BaseExpression {
|
|
644
|
+
type: "TemplateLiteral";
|
|
645
|
+
quasis: TemplateElement[];
|
|
646
|
+
expressions: Expression[];
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
interface TaggedTemplateExpression extends BaseExpression {
|
|
650
|
+
type: "TaggedTemplateExpression";
|
|
651
|
+
tag: Expression;
|
|
652
|
+
quasi: TemplateLiteral;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
interface TemplateElement extends BaseNode {
|
|
656
|
+
type: "TemplateElement";
|
|
657
|
+
tail: boolean;
|
|
658
|
+
value: {
|
|
659
|
+
/** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
|
|
660
|
+
cooked?: string | null | undefined;
|
|
661
|
+
raw: string;
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
interface AssignmentProperty extends Property {
|
|
666
|
+
value: Pattern;
|
|
667
|
+
kind: "init";
|
|
668
|
+
method: boolean; // false
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
interface ObjectPattern extends BasePattern {
|
|
672
|
+
type: "ObjectPattern";
|
|
673
|
+
properties: Array<AssignmentProperty | RestElement>;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
interface ArrayPattern extends BasePattern {
|
|
677
|
+
type: "ArrayPattern";
|
|
678
|
+
elements: Array<Pattern | null>;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
interface RestElement extends BasePattern {
|
|
682
|
+
type: "RestElement";
|
|
683
|
+
argument: Pattern;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
interface AssignmentPattern extends BasePattern {
|
|
687
|
+
type: "AssignmentPattern";
|
|
688
|
+
left: Pattern;
|
|
689
|
+
right: Expression;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
type Class = ClassDeclaration | ClassExpression;
|
|
693
|
+
interface BaseClass extends BaseNode {
|
|
694
|
+
superClass?: Expression | null | undefined;
|
|
695
|
+
body: ClassBody;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
interface ClassBody extends BaseNode {
|
|
699
|
+
type: "ClassBody";
|
|
700
|
+
body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
interface MethodDefinition extends BaseNode {
|
|
704
|
+
type: "MethodDefinition";
|
|
705
|
+
key: Expression | PrivateIdentifier;
|
|
706
|
+
value: FunctionExpression;
|
|
707
|
+
kind: "constructor" | "method" | "get" | "set";
|
|
708
|
+
computed: boolean;
|
|
709
|
+
static: boolean;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
|
|
713
|
+
type: "ClassDeclaration";
|
|
714
|
+
/** It is null when a class declaration is a part of the `export default class` statement */
|
|
715
|
+
id: Identifier | null;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
interface ClassDeclaration extends MaybeNamedClassDeclaration {
|
|
719
|
+
id: Identifier;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
interface ClassExpression extends BaseClass, BaseExpression {
|
|
723
|
+
type: "ClassExpression";
|
|
724
|
+
id?: Identifier | null | undefined;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
interface MetaProperty extends BaseExpression {
|
|
728
|
+
type: "MetaProperty";
|
|
729
|
+
meta: Identifier;
|
|
730
|
+
property: Identifier;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
type ModuleDeclaration =
|
|
734
|
+
| ImportDeclaration
|
|
735
|
+
| ExportNamedDeclaration
|
|
736
|
+
| ExportDefaultDeclaration
|
|
737
|
+
| ExportAllDeclaration;
|
|
738
|
+
interface BaseModuleDeclaration extends BaseNode {}
|
|
739
|
+
|
|
740
|
+
type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
|
|
741
|
+
interface BaseModuleSpecifier extends BaseNode {
|
|
742
|
+
local: Identifier;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
interface ImportDeclaration extends BaseModuleDeclaration {
|
|
746
|
+
type: "ImportDeclaration";
|
|
747
|
+
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
|
748
|
+
source: Literal;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
interface ImportSpecifier extends BaseModuleSpecifier {
|
|
752
|
+
type: "ImportSpecifier";
|
|
753
|
+
imported: Identifier | Literal;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
interface ImportExpression extends BaseExpression {
|
|
757
|
+
type: "ImportExpression";
|
|
758
|
+
source: Expression;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
interface ImportDefaultSpecifier extends BaseModuleSpecifier {
|
|
762
|
+
type: "ImportDefaultSpecifier";
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
|
|
766
|
+
type: "ImportNamespaceSpecifier";
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
interface ExportNamedDeclaration extends BaseModuleDeclaration {
|
|
770
|
+
type: "ExportNamedDeclaration";
|
|
771
|
+
declaration?: Declaration | null | undefined;
|
|
772
|
+
specifiers: ExportSpecifier[];
|
|
773
|
+
source?: Literal | null | undefined;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
|
|
777
|
+
type: "ExportSpecifier";
|
|
778
|
+
local: Identifier | Literal;
|
|
779
|
+
exported: Identifier | Literal;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
interface ExportDefaultDeclaration extends BaseModuleDeclaration {
|
|
783
|
+
type: "ExportDefaultDeclaration";
|
|
784
|
+
declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
interface ExportAllDeclaration extends BaseModuleDeclaration {
|
|
788
|
+
type: "ExportAllDeclaration";
|
|
789
|
+
exported: Identifier | Literal | null;
|
|
790
|
+
source: Literal;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
interface AwaitExpression extends BaseExpression {
|
|
794
|
+
type: "AwaitExpression";
|
|
795
|
+
argument: Expression;
|
|
796
|
+
}
|
|
797
|
+
|
|
25
798
|
declare module 'estree' {
|
|
26
|
-
export interface Decorator extends
|
|
799
|
+
export interface Decorator extends BaseNode {
|
|
27
800
|
type: 'Decorator';
|
|
28
|
-
expression:
|
|
801
|
+
expression: Expression;
|
|
29
802
|
}
|
|
30
803
|
interface PropertyDefinition {
|
|
31
|
-
decorators:
|
|
804
|
+
decorators: undefined[];
|
|
32
805
|
}
|
|
33
806
|
interface MethodDefinition {
|
|
34
|
-
decorators:
|
|
807
|
+
decorators: undefined[];
|
|
35
808
|
}
|
|
36
809
|
interface BaseClass {
|
|
37
|
-
decorators:
|
|
810
|
+
decorators: undefined[];
|
|
38
811
|
}
|
|
39
812
|
}
|
|
40
813
|
|
|
@@ -949,8 +1722,8 @@ type OmittedEstreeKeys =
|
|
|
949
1722
|
| 'comments';
|
|
950
1723
|
type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
|
|
951
1724
|
|
|
952
|
-
type ProgramNode = RollupAstNode<
|
|
953
|
-
type AstNode = RollupAstNode<
|
|
1725
|
+
type ProgramNode = RollupAstNode<Program>;
|
|
1726
|
+
type AstNode = RollupAstNode<Node>;
|
|
954
1727
|
|
|
955
1728
|
interface VitePluginInterface {
|
|
956
1729
|
toc: RemarkMdxTocOptions;
|
package/dist/navigation.js
CHANGED
|
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
mod
|
|
25
25
|
));
|
|
26
26
|
|
|
27
|
-
//
|
|
27
|
+
// ../../../../../node_modules/react/cjs/react.production.min.js
|
|
28
28
|
var require_react_production_min = __commonJS({
|
|
29
|
-
"
|
|
29
|
+
"../../../../../node_modules/react/cjs/react.production.min.js"(exports) {
|
|
30
30
|
"use strict";
|
|
31
31
|
var l = Symbol.for("react.element");
|
|
32
32
|
var n = Symbol.for("react.portal");
|
|
@@ -297,9 +297,9 @@ var require_react_production_min = __commonJS({
|
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
299
|
|
|
300
|
-
//
|
|
300
|
+
// ../../../../../node_modules/react/cjs/react.development.js
|
|
301
301
|
var require_react_development = __commonJS({
|
|
302
|
-
"
|
|
302
|
+
"../../../../../node_modules/react/cjs/react.development.js"(exports, module) {
|
|
303
303
|
"use strict";
|
|
304
304
|
if (process.env.NODE_ENV !== "production") {
|
|
305
305
|
(function() {
|
|
@@ -2171,9 +2171,9 @@ var require_react_development = __commonJS({
|
|
|
2171
2171
|
}
|
|
2172
2172
|
});
|
|
2173
2173
|
|
|
2174
|
-
//
|
|
2174
|
+
// ../../../../../node_modules/react/index.js
|
|
2175
2175
|
var require_react = __commonJS({
|
|
2176
|
-
"
|
|
2176
|
+
"../../../../../node_modules/react/index.js"(exports, module) {
|
|
2177
2177
|
"use strict";
|
|
2178
2178
|
if (process.env.NODE_ENV === "production") {
|
|
2179
2179
|
module.exports = require_react_production_min();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyd-js/content",
|
|
3
|
-
"version": "0.1.0-xyd.
|
|
3
|
+
"version": "0.1.0-xyd.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,11 +25,14 @@
|
|
|
25
25
|
"unified": "^11.0.5",
|
|
26
26
|
"unist-util-visit": "^5.0.0",
|
|
27
27
|
"vfile": "^6.0.3",
|
|
28
|
-
"@xyd-js/core": "0.1.0-xyd.
|
|
28
|
+
"@xyd-js/core": "0.1.0-xyd.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.7.8",
|
|
32
|
-
"
|
|
32
|
+
"rimraf": "^3.0.2",
|
|
33
|
+
"tsup": "^8.3.0",
|
|
34
|
+
"typescript": "^4.5.5",
|
|
35
|
+
"vite": "^6.0.7"
|
|
33
36
|
},
|
|
34
37
|
"scripts": {
|
|
35
38
|
"clean": "rimraf build",
|