1 | import { ASTNode, FragmentDefinitionNode, DirectiveNode } from 'graphql';
|
2 | import { ParsedMapper } from './mappers.js';
|
3 |
|
4 |
|
5 |
|
6 | export type DirectiveArgumentAndInputFieldMappings = {
|
7 | [name: string]: string;
|
8 | };
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export type ParsedDirectiveArgumentAndInputFieldMappings = {
|
14 | [name: string]: ParsedMapper;
|
15 | };
|
16 |
|
17 |
|
18 |
|
19 | export type ScalarsMap = string | {
|
20 | [name: string]: string | {
|
21 | input: string;
|
22 | output: string;
|
23 | };
|
24 | };
|
25 |
|
26 |
|
27 |
|
28 | export type NormalizedScalarsMap = {
|
29 | [name: string]: {
|
30 | input: string;
|
31 | output: string;
|
32 | };
|
33 | };
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export type ParsedScalarsMap = {
|
39 | [name: string]: {
|
40 | input: ParsedMapper;
|
41 | output: ParsedMapper;
|
42 | };
|
43 | };
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | export type EnumValuesMap<AdditionalProps = {}> = string | {
|
49 | [enumName: string]: string | ({
|
50 | [key: string]: string | number;
|
51 | } & AdditionalProps);
|
52 | };
|
53 | export type ParsedEnumValuesMap = {
|
54 | [enumName: string]: {
|
55 | mappedValues?: {
|
56 | [valueName: string]: string | number;
|
57 | };
|
58 | typeIdentifier: string;
|
59 | sourceIdentifier?: string;
|
60 | sourceFile?: string;
|
61 | importIdentifier?: string;
|
62 | isDefault?: boolean;
|
63 | };
|
64 | };
|
65 | export type ConvertNameFn<T = {}> = ConvertFn<T>;
|
66 | export type GetFragmentSuffixFn = (node: FragmentDefinitionNode | string) => string;
|
67 | export interface ConvertOptions {
|
68 | prefix?: string;
|
69 | suffix?: string;
|
70 | transformUnderscore?: boolean;
|
71 | }
|
72 | export type ConvertFn<T = {}> = (node: ASTNode | string, options?: ConvertOptions & T) => string;
|
73 | export type NamingConventionFn = (str: string) => string;
|
74 | export type NamingConventionResolvePath = string;
|
75 | export type NamingConvention = string | NamingConventionFn | NamingConventionMap;
|
76 |
|
77 |
|
78 |
|
79 | export interface NamingConventionMap {
|
80 | enumValues?: 'keep' | NamingConventionResolvePath | NamingConventionFn;
|
81 | typeNames?: 'keep' | NamingConventionResolvePath | NamingConventionFn;
|
82 | transformUnderscore?: boolean;
|
83 | }
|
84 | export type LoadedFragment<AdditionalFields = {}> = {
|
85 | name: string;
|
86 | onType: string;
|
87 | node: FragmentDefinitionNode;
|
88 | isExternal: boolean;
|
89 | importFrom?: string | null;
|
90 | } & AdditionalFields;
|
91 | export type DeclarationKind = 'type' | 'interface' | 'class' | 'abstract class';
|
92 | export interface DeclarationKindConfig {
|
93 | directive?: DeclarationKind;
|
94 | scalar?: DeclarationKind;
|
95 | input?: DeclarationKind;
|
96 | type?: DeclarationKind;
|
97 | interface?: DeclarationKind;
|
98 | arguments?: DeclarationKind;
|
99 | }
|
100 | export interface AvoidOptionalsConfig {
|
101 | field?: boolean;
|
102 | object?: boolean;
|
103 | inputValue?: boolean;
|
104 | defaultValue?: boolean;
|
105 | resolvers?: boolean;
|
106 | }
|
107 | export interface ParsedImport {
|
108 | moduleName: string | null;
|
109 | propName: string;
|
110 | }
|
111 | export type FragmentDirectives = {
|
112 | fragmentDirectives?: Array<DirectiveNode>;
|
113 | };
|
114 | export interface ResolversNonOptionalTypenameConfig {
|
115 | unionMember?: boolean;
|
116 | interfaceImplementingType?: boolean;
|
117 | excludeTypes?: string[];
|
118 | }
|