From 79da01a082d9f0cbeb1276e4776a2fce48779da8 Mon Sep 17 00:00:00 2001 From: Saihajpreet Singh Date: Thu, 19 Nov 2020 16:01:30 -0600 Subject: [PATCH] convert `$Values` (flow) to `keyof` (TS) --- src/language/directiveLocation.ts | 2 +- src/language/kinds.ts | 2 +- src/language/tokenKind.ts | 2 +- src/language/visitor.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/language/directiveLocation.ts b/src/language/directiveLocation.ts index 9fa1348cf8a..c7d3d87b1d8 100644 --- a/src/language/directiveLocation.ts +++ b/src/language/directiveLocation.ts @@ -28,4 +28,4 @@ export const DirectiveLocation = Object.freeze({ /** * The enum type representing the directive location values. */ -export type DirectiveLocationEnum = $Values; +export type DirectiveLocationEnum = typeof DirectiveLocation[keyof typeof DirectiveLocation]; diff --git a/src/language/kinds.ts b/src/language/kinds.ts index 99e3e4a9ead..7e181c7e7b7 100644 --- a/src/language/kinds.ts +++ b/src/language/kinds.ts @@ -71,4 +71,4 @@ export const Kind = Object.freeze({ /** * The enum type representing the possible kind values of AST nodes. */ -export type KindEnum = $Values; +export type KindEnum = typeof Kind[keyof typeof Kind]; diff --git a/src/language/tokenKind.ts b/src/language/tokenKind.ts index b4f5248c133..18efb8561cf 100644 --- a/src/language/tokenKind.ts +++ b/src/language/tokenKind.ts @@ -30,4 +30,4 @@ export const TokenKind = Object.freeze({ /** * The enum type representing the token kinds values. */ -export type TokenKindEnum = $Values; +export type TokenKindEnum = typeof TokenKind[keyof typeof TokenKind]; diff --git a/src/language/visitor.ts b/src/language/visitor.ts index c93775220f4..4c82839c574 100644 --- a/src/language/visitor.ts +++ b/src/language/visitor.ts @@ -9,7 +9,7 @@ import { isNode } from './ast'; * relevant functions to be called during the visitor's traversal. */ export type ASTVisitor = Visitor; -export type Visitor> = +export type Visitor = | EnterLeave< | VisitFn | ShapeMap(Node) => VisitFn>