Skip to content

Commit

Permalink
[] => never[], as empty tuple is invalid in TS@2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackson Kearl committed Aug 22, 2019
1 parent c10a670 commit 01c1fc3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tstypes/language/visitor.d.ts
Expand Up @@ -51,8 +51,11 @@ export type VisitFn<TAnyNode, TVisitedNode = TAnyNode> = (
*/
export type VisitorKeyMap<T> = { [P in keyof T]: ReadonlyArray<keyof T[P]> };

// TODO: Should be `[]`, but that requires TypeScript@3
type EmptyTuple = never[];

export const QueryDocumentKeys: {
Name: [];
Name: EmptyTuple;

Document: ['definitions'];
// Prettier forces trailing commas, but TS pre 3.2 doesn't allow them.
Expand Down Expand Up @@ -82,12 +85,12 @@ export const QueryDocumentKeys: {
'selectionSet'
];

IntValue: [];
FloatValue: [];
StringValue: [];
BooleanValue: [];
NullValue: [];
EnumValue: [];
IntValue: EmptyTuple;
FloatValue: EmptyTuple;
StringValue: EmptyTuple;
BooleanValue: EmptyTuple;
NullValue: EmptyTuple;
EnumValue: EmptyTuple;
ListValue: ['values'];
ObjectValue: ['fields'];
ObjectField: ['name', 'value'];
Expand Down

0 comments on commit 01c1fc3

Please sign in to comment.