From 3ccca87866a0517cfb9ba67381430461d37efcca Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 17:49:44 +0800 Subject: [PATCH] Fixed types. --- types/graphql/language/directiveLocation.d.ts | 7 +++++-- types/graphql/language/kinds.d.ts | 7 +++++-- types/graphql/language/lexer.d.ts | 7 +++++-- types/graphql/utilities/findBreakingChanges.d.ts | 14 ++++++++++---- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/types/graphql/language/directiveLocation.d.ts b/types/graphql/language/directiveLocation.d.ts index 412e3ad32a..16c42d7877 100644 --- a/types/graphql/language/directiveLocation.d.ts +++ b/types/graphql/language/directiveLocation.d.ts @@ -1,7 +1,10 @@ /** * The set of allowed directive location values. */ -export type DirectiveLocation = { +export const DirectiveLocation: _DirectiveLocation; + +// @internal +type _DirectiveLocation = { // Request Definitions QUERY: "QUERY"; MUTATION: "MUTATION"; @@ -28,4 +31,4 @@ export type DirectiveLocation = { /** * The enum type representing the directive location values. */ -export type DirectiveLocationEnum = DirectiveLocation[keyof DirectiveLocation]; +export type DirectiveLocationEnum = _DirectiveLocation[keyof _DirectiveLocation]; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index 6e497cbc68..768f00addd 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -1,7 +1,10 @@ /** * The set of allowed kind values for AST nodes. */ -export type Kind = { +export const Kind: _Kind; + +// @internal +type _Kind = { // Name NAME: "Name"; @@ -68,4 +71,4 @@ export type Kind = { /** * The enum type representing the possible kind values of AST nodes. */ -export type KindEnum = Kind[keyof Kind]; +export type KindEnum = _Kind[keyof _Kind]; diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 69fa3df460..19a57d3a11 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -55,7 +55,10 @@ export interface Lexer { * An exported enum describing the different kinds of tokens that the * lexer emits. */ -export type TokenKind = { +export const TokenKind: _TokenKind; + +// @internal +type _TokenKind = { SOF: ""; EOF: ""; BANG: "!"; @@ -83,7 +86,7 @@ export type TokenKind = { /** * The enum type representing the token kinds values. */ -export type TokenKindEnum = TokenKind[keyof TokenKind]; +export type TokenKindEnum = _TokenKind[keyof _TokenKind]; /** * A helper function to describe a token as a string for debugging diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 77f98f848a..84f1bea158 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -12,7 +12,10 @@ import { GraphQLDirective } from "../type/directives"; import { GraphQLSchema } from "../type/schema"; import { DirectiveLocationEnum } from "../language/directiveLocation"; -export type BreakingChangeType = { +export const BreakingChangeType : _BreakingChangeType; + +// @internal +type _BreakingChangeType = { FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; FIELD_REMOVED: "FIELD_REMOVED"; TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; @@ -30,7 +33,10 @@ export type BreakingChangeType = { NON_NULL_DIRECTIVE_ARG_ADDED: "NON_NULL_DIRECTIVE_ARG_ADDED"; }; -export type DangerousChangeType = { +export const DangerousChangeType: _DangerousChangeType; + +// @internal +type _DangerousChangeType = { ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE"; VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM"; INTERFACE_ADDED_TO_OBJECT: "INTERFACE_ADDED_TO_OBJECT"; @@ -40,12 +46,12 @@ export type DangerousChangeType = { }; export interface BreakingChange { - type: keyof BreakingChangeType; + type: keyof _BreakingChangeType; description: string; } export interface DangerousChange { - type: keyof DangerousChangeType; + type: keyof _DangerousChangeType; description: string; }