Fixed types.

This commit is contained in:
Firede
2018-03-28 17:49:44 +08:00
parent fe4997e85f
commit 3ccca87866
4 changed files with 25 additions and 10 deletions

View File

@@ -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];

View File

@@ -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];

View File

@@ -55,7 +55,10 @@ export interface Lexer<TOptions> {
* An exported enum describing the different kinds of tokens that the
* lexer emits.
*/
export type TokenKind = {
export const TokenKind: _TokenKind;
// @internal
type _TokenKind = {
SOF: "<SOF>";
EOF: "<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

View File

@@ -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;
}