Skip to content

Commit 05b06d4

Browse files
committed
allow type level namespace access too
1 parent d7df0b8 commit 05b06d4

File tree

2 files changed

+42
-8
lines changed

2 files changed

+42
-8
lines changed

src/language/kinds.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
import * as kinds_ from './kinds_.js'; // eslint-disable-line
2-
31
export * as Kind from './kinds_.js';
4-
5-
/**
6-
* The set of allowed kind values for AST nodes.
7-
*/
8-
export type Kind = (typeof kinds_)[keyof typeof kinds_];

src/language/kinds_.ts

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,104 @@ export const NAME = 'Name';
33

44
/** Document */
55
export const DOCUMENT = 'Document';
6+
export type DOCUMENT = typeof DOCUMENT;
67
export const OPERATION_DEFINITION = 'OperationDefinition';
8+
export type OPERATION_DEFINITION = typeof OPERATION_DEFINITION;
79
export const VARIABLE_DEFINITION = 'VariableDefinition';
10+
export type VARIABLE_DEFINITION = typeof VARIABLE_DEFINITION;
811
export const SELECTION_SET = 'SelectionSet';
12+
export type SELECTION_SET = typeof SELECTION_SET;
913
export const FIELD = 'Field';
14+
export type FIELD = typeof FIELD;
1015
export const ARGUMENT = 'Argument';
16+
export type ARGUMENT = typeof ARGUMENT;
1117
export const FRAGMENT_ARGUMENT = 'FragmentArgument';
18+
export type FRAGMENT_ARGUMENT = typeof FRAGMENT_ARGUMENT;
1219

1320
/** Fragments */
1421
export const FRAGMENT_SPREAD = 'FragmentSpread';
22+
export type FRAGMENT_SPREAD = typeof FRAGMENT_SPREAD;
1523
export const INLINE_FRAGMENT = 'InlineFragment';
24+
export type INLINE_FRAGMENT = typeof INLINE_FRAGMENT;
1625
export const FRAGMENT_DEFINITION = 'FragmentDefinition';
26+
export type FRAGMENT_DEFINITION = typeof FRAGMENT_DEFINITION;
1727

1828
/** Values */
1929
export const VARIABLE = 'Variable';
30+
export type VARIABLE = typeof VARIABLE;
2031
export const INT = 'IntValue';
32+
export type INT = typeof INT;
2133
export const FLOAT = 'FloatValue';
34+
export type FLOAT = typeof FLOAT;
2235
export const STRING = 'StringValue';
36+
export type STRING = typeof STRING;
2337
export const BOOLEAN = 'BooleanValue';
38+
export type BOOLEAN = typeof BOOLEAN;
2439
export const NULL = 'NullValue';
40+
export type NULL = typeof NULL;
2541
export const ENUM = 'EnumValue';
42+
export type ENUM = typeof ENUM;
2643
export const LIST = 'ListValue';
44+
export type LIST = typeof LIST;
2745
export const OBJECT = 'ObjectValue';
46+
export type OBJECT = typeof OBJECT;
2847
export const OBJECT_FIELD = 'ObjectField';
48+
export type OBJECT_FIELD = typeof OBJECT_FIELD;
2949

3050
/** Directives */
3151
export const DIRECTIVE = 'Directive';
52+
export type DIRECTIVE = typeof DIRECTIVE;
3253

3354
/** Types */
3455
export const NAMED_TYPE = 'NamedType';
56+
export type NAMED_TYPE = typeof NAMED_TYPE;
3557
export const LIST_TYPE = 'ListType';
58+
export type LIST_TYPE = typeof LIST_TYPE;
3659
export const NON_NULL_TYPE = 'NonNullType';
60+
export type NON_NULL_TYPE = typeof NON_NULL_TYPE;
3761

3862
/** Type System Definitions */
3963
export const SCHEMA_DEFINITION = 'SchemaDefinition';
64+
export type SCHEMA_DEFINITION = typeof SCHEMA_DEFINITION;
4065
export const OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';
66+
export type OPERATION_TYPE_DEFINITION = typeof OPERATION_TYPE_DEFINITION;
4167

4268
/** Type Definitions */
4369
export const SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';
70+
export type SCALAR_TYPE_DEFINITION = typeof SCALAR_TYPE_DEFINITION;
4471
export const OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';
72+
export type OBJECT_TYPE_DEFINITION = typeof OBJECT_TYPE_DEFINITION;
4573
export const FIELD_DEFINITION = 'FieldDefinition';
74+
export type FIELD_DEFINITION = typeof FIELD_DEFINITION;
4675
export const INPUT_VALUE_DEFINITION = 'InputValueDefinition';
76+
export type INPUT_VALUE_DEFINITION = typeof INPUT_VALUE_DEFINITION;
4777
export const INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';
78+
export type INTERFACE_TYPE_DEFINITION = typeof INTERFACE_TYPE_DEFINITION;
4879
export const UNION_TYPE_DEFINITION = 'UnionTypeDefinition';
80+
export type UNION_TYPE_DEFINITION = typeof UNION_TYPE_DEFINITION;
4981
export const ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';
5082
export const ENUM_VALUE_DEFINITION = 'EnumValueDefinition';
83+
export type ENUM_VALUE_DEFINITION = typeof ENUM_VALUE_DEFINITION;
5184
export const INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';
85+
export type INPUT_OBJECT_TYPE_DEFINITION = typeof INPUT_OBJECT_TYPE_DEFINITION;
5286

5387
/** Directive Definitions */
5488
export const DIRECTIVE_DEFINITION = 'DirectiveDefinition';
55-
89+
export type DIRECTIVE_DEFINITION = typeof DIRECTIVE_DEFINITION;
5690
/** Type System Extensions */
5791
export const SCHEMA_EXTENSION = 'SchemaExtension';
92+
export type SCHEMA_EXTENSION = typeof SCHEMA_EXTENSION;
5893

5994
/** Type Extensions */
6095
export const SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension';
96+
export type SCALAR_TYPE_EXTENSION = typeof SCALAR_TYPE_EXTENSION;
6197
export const OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension';
98+
export type OBJECT_TYPE_EXTENSION = typeof OBJECT_TYPE_EXTENSION;
6299
export const INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension';
100+
export type INTERFACE_TYPE_EXTENSION = typeof INTERFACE_TYPE_EXTENSION;
63101
export const UNION_TYPE_EXTENSION = 'UnionTypeExtension';
102+
export type UNION_TYPE_EXTENSION = typeof UNION_TYPE_EXTENSION;
64103
export const ENUM_TYPE_EXTENSION = 'EnumTypeExtension';
104+
export type ENUM_TYPE_EXTENSION = typeof ENUM_TYPE_EXTENSION;
65105
export const INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension';
106+
export type INPUT_OBJECT_TYPE_EXTENSION = typeof INPUT_OBJECT_TYPE_EXTENSION;

0 commit comments

Comments
 (0)