forked from typescript-eslint/typescript-eslint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
spec.ts
51 lines (49 loc) · 1.47 KB
/
spec.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
51
import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { BaseNode } from '../../base/BaseNode';
import type { Identifier } from '../../expression/Identifier/spec';
import type { TSModuleBlock } from '../../special/TSModuleBlock/spec';
import type { Literal } from '../../unions/Literal';
export interface TSModuleDeclaration extends BaseNode {
type: AST_NODE_TYPES.TSModuleDeclaration;
/**
* The name of the module
* ```
* namespace A {}
* namespace A.B.C {}
* module 'a' {}
* ```
*/
id: Identifier | Literal;
/**
* The body of the module.
* This can only be `undefined` for the code `declare module 'mod';`
* This will be a `TSModuleDeclaration` if the name is "nested" (`Foo.Bar`).
*/
body?:
| TSModuleBlock
/*
TODO(#4966) - we currently emit this due to bad parser handling of nested modules
namespace Foo.Bar {}
^^^^^^^^^^^^^^^^^^^^ TSModuleDeclaration
^^^^^^ TSModuleDeclaration
^^ TSModuleBlock
This should instead emit a TSQualifiedName for the `id` and not emit an inner TSModuleDeclaration
*/
| TSModuleDeclaration;
/**
* Whether this is a global declaration
* ```
* declare global {}
* ```
*/
// TODO(#5020) - make this `false` if not `global`
global?: boolean;
/**
* Whether the module is `declare`d
* ```
* declare namespace F {}
* ```
*/
// TODO(#5020) - make this `false` if it is not `declare`d
declare?: boolean;
}