Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/emmet/src/typings/EmmetNode.d.ts
4774 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
declare module 'EmmetNode' {
7
import { Position } from 'vscode';
8
9
export interface Node {
10
start: Position
11
end: Position
12
type: string
13
parent: Node
14
firstChild: Node
15
nextSibling: Node
16
previousSibling: Node
17
children: Node[]
18
}
19
20
export interface Token {
21
start: Position
22
end: Position
23
stream: BufferStream
24
toString(): string
25
}
26
27
export interface CssToken extends Token {
28
size: number
29
item(number: number): any
30
type: string
31
}
32
33
export interface HtmlToken extends Token {
34
value: string
35
}
36
37
export interface Attribute extends Token {
38
name: Token
39
value: Token
40
}
41
42
export interface HtmlNode extends Node {
43
name: string
44
open: Token
45
close: Token
46
parent: HtmlNode
47
firstChild: HtmlNode
48
nextSibling: HtmlNode
49
previousSibling: HtmlNode
50
children: HtmlNode[]
51
attributes: Attribute[]
52
}
53
54
export interface CssNode extends Node {
55
name: string
56
parent: CssNode
57
firstChild: CssNode
58
nextSibling: CssNode
59
previousSibling: CssNode
60
children: CssNode[]
61
}
62
63
export interface Rule extends CssNode {
64
selectorToken: Token
65
contentStartToken: Token
66
contentEndToken: Token
67
}
68
69
export interface Property extends CssNode {
70
valueToken: Token
71
separator: string
72
parent: Rule
73
terminatorToken: Token
74
separatorToken: Token
75
value: string
76
}
77
78
export interface Stylesheet extends Node {
79
comments: Token[]
80
}
81
82
export interface BufferStream {
83
peek(): number
84
next(): number
85
backUp(n: number): number
86
current(): string
87
substring(from: Position, to: Position): string
88
eat(match: any): boolean
89
eatWhile(match: any): boolean
90
}
91
}
92
93
94
95
96
97