diff --git a/src/language/blockString.d.ts b/src/language/blockString.d.ts index 70ffc666c7..3819b9f0d9 100644 --- a/src/language/blockString.d.ts +++ b/src/language/blockString.d.ts @@ -3,6 +3,8 @@ * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. * * This implements the GraphQL spec's BlockStringValue() static algorithm. + * + * @internal */ export function dedentBlockStringValue(rawString: string): string; @@ -15,6 +17,8 @@ export function getBlockStringIndentation(body: string): number; * Print a block string in the indented block form by adding a leading and * trailing blank line. However, if a block string starts with whitespace and is * a single-line, adding a leading blank line would strip that whitespace. + * + * @internal */ export function printBlockString( value: string, diff --git a/src/language/directiveLocation.d.ts b/src/language/directiveLocation.d.ts index 225e129cd8..b803e40313 100644 --- a/src/language/directiveLocation.d.ts +++ b/src/language/directiveLocation.d.ts @@ -1,7 +1,7 @@ /** * The set of allowed directive location values. */ -export const DirectiveLocation: { +export const DirectiveLocation: Readonly<{ // Request Definitions QUERY: 'QUERY'; MUTATION: 'MUTATION'; @@ -24,7 +24,7 @@ export const DirectiveLocation: { ENUM_VALUE: 'ENUM_VALUE'; INPUT_OBJECT: 'INPUT_OBJECT'; INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'; -}; +}>; /** * The enum type representing the directive location values. diff --git a/src/language/kinds.d.ts b/src/language/kinds.d.ts index 35a7239923..2e31c1f06f 100644 --- a/src/language/kinds.d.ts +++ b/src/language/kinds.d.ts @@ -1,7 +1,7 @@ /** * The set of allowed kind values for AST nodes. */ -export const Kind: { +export const Kind: Readonly<{ // Name NAME: 'Name'; @@ -66,7 +66,7 @@ export const Kind: { UNION_TYPE_EXTENSION: 'UnionTypeExtension'; ENUM_TYPE_EXTENSION: 'EnumTypeExtension'; INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'; -}; +}>; /** * The enum type representing the possible kind values of AST nodes. diff --git a/src/language/lexer.d.ts b/src/language/lexer.d.ts index 40dbf9a6b2..1dc8be70a2 100644 --- a/src/language/lexer.d.ts +++ b/src/language/lexer.d.ts @@ -47,11 +47,6 @@ export class Lexer { lookahead(): Token; } -/** - * @internal - */ -export function isPunctuatorToken(token: Token): boolean; - /** * @internal */ diff --git a/src/language/source.d.ts b/src/language/source.d.ts index a7df7cbb6b..c216fa9233 100644 --- a/src/language/source.d.ts +++ b/src/language/source.d.ts @@ -15,6 +15,7 @@ export class Source { name: string; locationOffset: Location; constructor(body: string, name?: string, locationOffset?: Location); + get [Symbol.toStringTag](): string; } /** diff --git a/src/language/tokenKind.d.ts b/src/language/tokenKind.d.ts index fa27e23293..ecd6f201dd 100644 --- a/src/language/tokenKind.d.ts +++ b/src/language/tokenKind.d.ts @@ -2,7 +2,7 @@ * An exported enum describing the different kinds of tokens that the * lexer emits. */ -export const TokenKind: { +export const TokenKind: Readonly<{ SOF: ''; EOF: ''; BANG: '!'; @@ -25,7 +25,7 @@ export const TokenKind: { STRING: 'String'; BLOCK_STRING: 'BlockString'; COMMENT: 'Comment'; -}; +}>; /** * The enum type representing the token kinds values. diff --git a/src/type/definition.d.ts b/src/type/definition.d.ts index 42fb596024..ee73b426ae 100644 --- a/src/type/definition.d.ts +++ b/src/type/definition.d.ts @@ -180,6 +180,7 @@ export class GraphQLList { toString: () => string; toJSON: () => string; inspect: () => string; + get [Symbol.toStringTag](): string; } /** @@ -210,6 +211,7 @@ export class GraphQLNonNull { toString: () => string; toJSON: () => string; inspect: () => string; + get [Symbol.toStringTag](): string; } export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; @@ -426,6 +428,7 @@ export class GraphQLObjectType { toString(): string; toJSON(): string; inspect(): string; + get [Symbol.toStringTag](): string; } export function argsToArgsConfig( @@ -632,6 +635,7 @@ export class GraphQLInterfaceType { toString(): string; toJSON(): string; inspect(): string; + get [Symbol.toStringTag](): string; } export interface GraphQLInterfaceTypeConfig { @@ -706,6 +710,7 @@ export class GraphQLUnionType { toString(): string; toJSON(): string; inspect(): string; + get [Symbol.toStringTag](): string; } export interface GraphQLUnionTypeConfig { @@ -782,6 +787,7 @@ export class GraphQLEnumType { toString(): string; toJSON(): string; inspect(): string; + get [Symbol.toStringTag](): string; } export interface GraphQLEnumTypeConfig { @@ -879,6 +885,7 @@ export class GraphQLInputObjectType { toString(): string; toJSON(): string; inspect(): string; + get [Symbol.toStringTag](): string; } export interface GraphQLInputObjectTypeConfig { diff --git a/src/type/directives.d.ts b/src/type/directives.d.ts index 2c6de77b1d..1feae76aa8 100644 --- a/src/type/directives.d.ts +++ b/src/type/directives.d.ts @@ -51,6 +51,7 @@ export class GraphQLDirective { toString(): string; toJSON(): string; inspect(): string; + get [Symbol.toStringTag](): string; } export interface GraphQLDirectiveConfig { diff --git a/src/type/introspection.d.ts b/src/type/introspection.d.ts index 34cefa72fb..fc1512f795 100644 --- a/src/type/introspection.d.ts +++ b/src/type/introspection.d.ts @@ -13,7 +13,7 @@ export const __Field: GraphQLObjectType; export const __InputValue: GraphQLObjectType; export const __EnumValue: GraphQLObjectType; -export const TypeKind: { +export const TypeKind: Readonly<{ SCALAR: 'SCALAR'; OBJECT: 'OBJECT'; INTERFACE: 'INTERFACE'; @@ -22,7 +22,7 @@ export const TypeKind: { INPUT_OBJECT: 'INPUT_OBJECT'; LIST: 'LIST'; NON_NULL: 'NON_NULL'; -}; +}>; export const __TypeKind: GraphQLEnumType; diff --git a/src/type/schema.d.ts b/src/type/schema.d.ts index 9e751faff0..58d8f5e09a 100644 --- a/src/type/schema.d.ts +++ b/src/type/schema.d.ts @@ -81,7 +81,7 @@ export class GraphQLSchema { isSubType( abstractType: GraphQLAbstractType, - maybeSubType: GraphQLNamedType, + maybeSubType: GraphQLObjectType | GraphQLInterfaceType, ): boolean; getDirectives(): ReadonlyArray; @@ -94,6 +94,7 @@ export class GraphQLSchema { extensionASTNodes: ReadonlyArray; assumeValid: boolean; }; + get [Symbol.toStringTag](): string; } interface TypeMap { diff --git a/src/utilities/TypeInfo.d.ts b/src/utilities/TypeInfo.d.ts index e1a45f24c5..f2448ba33a 100644 --- a/src/utilities/TypeInfo.d.ts +++ b/src/utilities/TypeInfo.d.ts @@ -34,7 +34,7 @@ export class TypeInfo { getParentType(): Maybe; getInputType(): Maybe; getParentInputType(): Maybe; - getFieldDef(): GraphQLField>; + getFieldDef(): Maybe>; getDefaultValue(): Maybe; getDirective(): Maybe; getArgument(): Maybe; diff --git a/src/validation/validate.d.ts b/src/validation/validate.d.ts index e15fc0b2e3..254706ae2e 100644 --- a/src/validation/validate.d.ts +++ b/src/validation/validate.d.ts @@ -43,7 +43,7 @@ export function validateSDL( documentAST: DocumentNode, schemaToExtend?: Maybe, rules?: ReadonlyArray, -): Array; +): Readonly; /** * Utility function which asserts a SDL document is valid by throwing an error