forked from typescript-eslint/typescript-eslint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExportDeclaration.ts
50 lines (47 loc) · 2.03 KB
/
ExportDeclaration.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import type {
ClassDeclarationWithName,
ClassDeclarationWithOptionalName,
} from '../declaration/ClassDeclaration/spec';
import type {
FunctionDeclarationWithName,
FunctionDeclarationWithOptionalName,
} from '../declaration/FunctionDeclaration/spec';
import type { TSDeclareFunction } from '../declaration/TSDeclareFunction/spec';
import type { TSEnumDeclaration } from '../declaration/TSEnumDeclaration/spec';
import type { TSImportEqualsDeclaration } from '../declaration/TSImportEqualsDeclaration/spec';
import type { TSInterfaceDeclaration } from '../declaration/TSInterfaceDeclaration/spec';
import type { TSModuleDeclaration } from '../declaration/TSModuleDeclaration/spec';
import type { TSTypeAliasDeclaration } from '../declaration/TSTypeAliasDeclaration/spec';
import type { VariableDeclaration } from '../declaration/VariableDeclaration/spec';
import type { Expression } from './Expression';
// TODO(#1852) - the following are disallowed syntactically, but allowed by TS error recovery:
// TSEnumDeclaration, TSModuleDeclaration, TSTypeAliasDeclaration, VariableDeclaration
export type DefaultExportDeclarations =
| ClassDeclarationWithOptionalName
| Expression
| FunctionDeclarationWithName
| FunctionDeclarationWithOptionalName
| TSDeclareFunction
| TSEnumDeclaration
| TSInterfaceDeclaration
| TSModuleDeclaration
| TSTypeAliasDeclaration
| VariableDeclaration;
// TODO(#1852) - the following are disallowed syntactically, but allowed by TS error recovery:
// ClassDeclarationWithOptionalName, FunctionDeclarationWithOptionalName
export type NamedExportDeclarations =
| ClassDeclarationWithName
| ClassDeclarationWithOptionalName
| FunctionDeclarationWithName
| FunctionDeclarationWithOptionalName
| TSDeclareFunction
| TSEnumDeclaration
| TSImportEqualsDeclaration
| TSInterfaceDeclaration
| TSModuleDeclaration
| TSTypeAliasDeclaration
| VariableDeclaration;
// TODO - breaking change remove this in the next major
export type ExportDeclaration =
| DefaultExportDeclarations
| NamedExportDeclarations;