* Add support for declare export * Do not allow declare module inside declare module * Reallow module exports outside module * Add handling of `declare export default` Add check for multiple module.export declarations * Disallow export let/const/type Refactor parsing object properties to share more code and add support for getters and setters * Rename tests * Update test fixtures * Optimize for performance * disallow declare export interface outside of module * Refactor code to be more readable and less lookahead * Add comments * Add test for export star as * Test for number literal getter/setter * Add more tests * Fix tests * Allow union types and correctly eat semi after type * Use non computed keys * Fix tests
256 lines
5.9 KiB
JSON
256 lines
5.9 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 45,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 45
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 45,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 45
|
|
}
|
|
},
|
|
"sourceType": "module",
|
|
"body": [
|
|
{
|
|
"type": "DeclareClass",
|
|
"start": 0,
|
|
"end": 45,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 45
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 14,
|
|
"end": 15,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 14
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 15
|
|
},
|
|
"identifierName": "A"
|
|
},
|
|
"name": "A"
|
|
},
|
|
"typeParameters": {
|
|
"type": "TypeParameterDeclaration",
|
|
"start": 15,
|
|
"end": 18,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 15
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 18
|
|
}
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TypeParameter",
|
|
"start": 16,
|
|
"end": 17,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 16
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 17
|
|
}
|
|
},
|
|
"name": "T",
|
|
"variance": null
|
|
}
|
|
]
|
|
},
|
|
"extends": [
|
|
{
|
|
"type": "InterfaceExtends",
|
|
"start": 27,
|
|
"end": 31,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 27
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 31
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 27,
|
|
"end": 28,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 27
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 28
|
|
},
|
|
"identifierName": "B"
|
|
},
|
|
"name": "B"
|
|
},
|
|
"typeParameters": {
|
|
"type": "TypeParameterInstantiation",
|
|
"start": 28,
|
|
"end": 31,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 28
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 31
|
|
}
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "GenericTypeAnnotation",
|
|
"start": 29,
|
|
"end": 30,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 29
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 30
|
|
}
|
|
},
|
|
"typeParameters": null,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 29,
|
|
"end": 30,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 29
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 30
|
|
},
|
|
"identifierName": "T"
|
|
},
|
|
"name": "T"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"mixins": [],
|
|
"body": {
|
|
"type": "ObjectTypeAnnotation",
|
|
"start": 32,
|
|
"end": 45,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 32
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 45
|
|
}
|
|
},
|
|
"callProperties": [],
|
|
"properties": [
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 34,
|
|
"end": 43,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 34
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 43
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start": 34,
|
|
"end": 35,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 34
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 35
|
|
},
|
|
"identifierName": "x"
|
|
},
|
|
"name": "x"
|
|
},
|
|
"static": false,
|
|
"kind": "init",
|
|
"value": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 37,
|
|
"end": 43,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 37
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 43
|
|
}
|
|
}
|
|
},
|
|
"variance": null,
|
|
"optional": false
|
|
}
|
|
],
|
|
"indexers": [],
|
|
"exact": false
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |