Skip to content

Commit b354666

Browse files
authored
Support UnicodeProperty in typings
1 parent 9abbfec commit b354666

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

index.d.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ declare module 'regexp-tree/ast' {
1111
'Group': Group;
1212
'Repetition': Repetition;
1313
'Quantifier': Quantifier;
14+
'UnicodeProperty': UnicodeProperty;
1415
}
1516

1617
export type AstClass = keyof AstClassMap;
@@ -54,7 +55,7 @@ declare module 'regexp-tree/ast' {
5455

5556
export interface CharacterClass extends Base<'CharacterClass'> {
5657
negative?: true;
57-
expressions: (Char | ClassRange)[];
58+
expressions: (Char | ClassRange | UnicodeProperty)[];
5859
}
5960

6061
export interface Alternative extends Base<'Alternative'> {
@@ -135,6 +136,16 @@ declare module 'regexp-tree/ast' {
135136
| SimpleAssertion
136137
| LookaroundAssertion;
137138

139+
export interface UnicodeProperty extends Base<'UnicodeProperty'> {
140+
name: string;
141+
value: string;
142+
negative?: true;
143+
shorthand?: true;
144+
binary?: true;
145+
canonicalName?: string;
146+
canonicalValue?: string;
147+
}
148+
138149
export type Expression =
139150
| Char
140151
| CharacterClass
@@ -143,7 +154,8 @@ declare module 'regexp-tree/ast' {
143154
| Group
144155
| Backreference
145156
| Repetition
146-
| Assertion;
157+
| Assertion
158+
| UnicodeProperty;
147159

148160
export interface AstRegExp extends Base<'RegExp'> {
149161
body: Expression | null;

0 commit comments

Comments
 (0)