Add support for declare export + fixes (#224)

* 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
This commit is contained in:
Daniel Tschinder
2017-04-21 14:41:59 +02:00
committed by GitHub
parent 28ccd05bab
commit d1a5220b89
117 changed files with 4857 additions and 708 deletions

View File

@@ -159,6 +159,8 @@
},
"name": "x"
},
"static": false,
"kind": "init",
"value": {
"type": "BooleanTypeAnnotation",
"start": 22,
@@ -174,9 +176,8 @@
}
}
},
"optional": false,
"static": false,
"variance": null
"variance": null,
"optional": false
},
{
"type": "ObjectTypeProperty",
@@ -209,6 +210,8 @@
},
"name": "y"
},
"static": true,
"kind": "init",
"value": {
"type": "BooleanTypeAnnotation",
"start": 62,
@@ -224,9 +227,8 @@
}
}
},
"optional": false,
"static": true,
"variance": null
"variance": null,
"optional": false
}
],
"indexers": [],

View File

@@ -109,6 +109,8 @@
},
"name": "foo"
},
"static": false,
"kind": "init",
"value": {
"type": "FunctionTypeAnnotation",
"start": 19,
@@ -142,9 +144,8 @@
},
"typeParameters": null
},
"optional": false,
"static": false,
"variance": null
"variance": null,
"optional": false
}
],
"indexers": [],

View File

@@ -109,6 +109,8 @@
},
"name": "length"
},
"static": false,
"kind": "init",
"value": {
"type": "NumberTypeAnnotation",
"start": 56,
@@ -124,9 +126,8 @@
}
}
},
"optional": false,
"static": false,
"variance": null
"variance": null,
"optional": false
}
],
"indexers": [