espolar 0.2.0 → 0.2.1

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/src/types.ts ADDED
@@ -0,0 +1,61 @@
1
+ declare module "@typescript-eslint/types" {
2
+ export namespace TSESTree {
3
+ export interface NodeOrTokenData {
4
+ start?: number;
5
+ end?: number;
6
+ }
7
+
8
+ // https://github.com/sveltejs/acorn-typescript/issues/7
9
+ // @sveltejs/acorn-typescript have slightly different AST structure
10
+ // for TSFunctionType and TSMethodSignature. Augment them.
11
+ interface BabelTSFunctionSignatureBase {
12
+ typeAnnotation?: TSTypeAnnotation;
13
+ parameters?: Parameter[];
14
+ }
15
+ export interface TSFunctionType extends BabelTSFunctionSignatureBase {}
16
+ export interface TSConstructorType extends BabelTSFunctionSignatureBase {}
17
+ export interface TSCallSignatureDeclaration extends BabelTSFunctionSignatureBase {}
18
+ export interface TSConstructSignatureDeclaration extends BabelTSFunctionSignatureBase {}
19
+ export interface TSIndexSignature extends BabelTSFunctionSignatureBase {}
20
+ export interface TSMethodSignatureComputedName extends BabelTSFunctionSignatureBase {}
21
+ export interface TSMethodSignatureNonComputedName extends BabelTSFunctionSignatureBase {}
22
+
23
+ interface BabelTSAbstractBase {
24
+ abstract?: boolean;
25
+ accessor?: boolean;
26
+ }
27
+ export interface MethodDefinitionComputedName extends BabelTSAbstractBase {}
28
+ export interface MethodDefinitionNonComputedName extends BabelTSAbstractBase {}
29
+ export interface PropertyDefinitionComputedName extends BabelTSAbstractBase {}
30
+ export interface PropertyDefinitionNonComputedName extends BabelTSAbstractBase {}
31
+
32
+ interface BabelClassBase {
33
+ superTypeParameters?: TSTypeParameterInstantiation;
34
+ }
35
+ export interface ClassDeclarationWithName extends BabelClassBase {}
36
+ export interface ClassDeclarationWithOptionalName extends BabelClassBase {}
37
+ export interface ClassExpression extends BabelClassBase {}
38
+ }
39
+ }
40
+
41
+ import { TSESTree as AST } from "@typescript-eslint/types";
42
+
43
+ export interface NodeLike {
44
+ type: string;
45
+ loc?: AST.SourceLocation | null;
46
+ start?: number;
47
+ end?: number;
48
+ range?: [number, number];
49
+ }
50
+
51
+ export interface Comment {
52
+ type: "Line" | "Block";
53
+ value: string;
54
+ loc?: AST.SourceLocation | null;
55
+ start?: number;
56
+ end?: number;
57
+ range?: [number, number];
58
+ }
59
+
60
+ export type { AST };
61
+ export type { AST_NODE_TYPES } from "@typescript-eslint/types";