Skip to content

Commit 3b4a55c

Browse files
Merge pull request DmitrySoshnikov#221 from tjenkinson/type-fixes
Type fixes
2 parents e833b70 + 66256da commit 3b4a55c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

index.d.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ declare module 'regexp-tree/ast' {
1515

1616
export type AstClass = keyof AstClassMap;
1717
export type AstNode = AstClassMap[AstClass];
18+
export type AstNodeLocation = {
19+
line: number;
20+
column: number;
21+
offset: number;
22+
};
1823

1924
export interface Base<T extends AstClass> {
2025
type: T;
2126
loc?: {
2227
source: string;
23-
start: number;
24-
end: number;
28+
start: AstNodeLocation;
29+
end: AstNodeLocation;
2530
};
2631
}
2732

@@ -57,8 +62,8 @@ declare module 'regexp-tree/ast' {
5762
}
5863

5964
export interface Disjunction extends Base<'Disjunction'> {
60-
left: Expression;
61-
right: Expression;
65+
left: Expression | null;
66+
right: Expression | null;
6267
}
6368

6469
export interface CapturingGroup extends Base<'Group'> {
@@ -156,6 +161,7 @@ declare module 'regexp-tree' {
156161

157162
export interface ParserOptions {
158163
captureLocations?: boolean;
164+
allowGroupNameDuplicates?: boolean;
159165
}
160166

161167
/**

0 commit comments

Comments
 (0)