* 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
132 lines
2.8 KiB
JSON
132 lines
2.8 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 43,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 43
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 43,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 43
|
|
}
|
|
},
|
|
"sourceType": "module",
|
|
"body": [
|
|
{
|
|
"type": "DeclareExportDeclaration",
|
|
"start": 0,
|
|
"end": 43,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 43
|
|
}
|
|
},
|
|
"declaration": {
|
|
"type": "FunctionTypeAnnotation",
|
|
"start": 23,
|
|
"end": 43,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 23
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 43
|
|
}
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "FunctionTypeParam",
|
|
"start": 24,
|
|
"end": 32,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 24
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 32
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"start": 24,
|
|
"end": 25,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 24
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 25
|
|
},
|
|
"identifierName": "a"
|
|
},
|
|
"name": "a"
|
|
},
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 26,
|
|
"end": 32,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 26
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 32
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"rest": null,
|
|
"returnType": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 37,
|
|
"end": 43,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 37
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 43
|
|
}
|
|
}
|
|
},
|
|
"typeParameters": null
|
|
},
|
|
"default": true
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |