1 | import { Types, Profiler } from '@graphql-codegen/plugin-helpers';
|
2 | import { GraphQLConfig } from 'graphql-config';
|
3 | import { GraphQLSchema } from 'graphql';
|
4 | export declare type YamlCliFlags = {
|
5 | config: string;
|
6 | watch: boolean | string | string[];
|
7 | require: string[];
|
8 | overwrite: boolean;
|
9 | project: string;
|
10 | silent: boolean;
|
11 | errorsOnly: boolean;
|
12 | profile: boolean;
|
13 | };
|
14 | export declare function generateSearchPlaces(moduleName: string): string[];
|
15 | export interface LoadCodegenConfigOptions {
|
16 | |
17 |
|
18 |
|
19 |
|
20 | configFilePath?: string;
|
21 | |
22 |
|
23 |
|
24 |
|
25 | moduleName?: string;
|
26 | |
27 |
|
28 |
|
29 | searchPlaces?: string[];
|
30 | |
31 |
|
32 |
|
33 | packageProp?: string;
|
34 | |
35 |
|
36 |
|
37 | loaders?: Record<string, (filepath: string, content: string) => Promise<Types.Config> | Types.Config>;
|
38 | }
|
39 | export interface LoadCodegenConfigResult {
|
40 | filepath: string;
|
41 | config: Types.Config;
|
42 | isEmpty?: boolean;
|
43 | }
|
44 | export declare function loadCodegenConfig({ configFilePath, moduleName, searchPlaces: additionalSearchPlaces, packageProp, loaders: customLoaders, }: LoadCodegenConfigOptions): Promise<LoadCodegenConfigResult>;
|
45 | export declare function loadContext(configFilePath?: string): Promise<CodegenContext> | never;
|
46 | export declare function buildOptions(): {
|
47 | c: {
|
48 | alias: string;
|
49 | type: "string";
|
50 | describe: string;
|
51 | };
|
52 | w: {
|
53 | alias: string;
|
54 | describe: string;
|
55 | coerce: (watch: any) => string | boolean | any[];
|
56 | };
|
57 | r: {
|
58 | alias: string;
|
59 | describe: string;
|
60 | type: "array";
|
61 | default: any[];
|
62 | };
|
63 | o: {
|
64 | alias: string;
|
65 | describe: string;
|
66 | type: "boolean";
|
67 | };
|
68 | s: {
|
69 | alias: string;
|
70 | describe: string;
|
71 | type: "boolean";
|
72 | };
|
73 | e: {
|
74 | alias: string;
|
75 | describe: string;
|
76 | type: "boolean";
|
77 | };
|
78 | profile: {
|
79 | describe: string;
|
80 | type: "boolean";
|
81 | };
|
82 | p: {
|
83 | alias: string;
|
84 | describe: string;
|
85 | type: "string";
|
86 | };
|
87 | };
|
88 | export declare function parseArgv(argv?: string[]): YamlCliFlags;
|
89 | export declare function createContext(cliFlags?: YamlCliFlags): Promise<CodegenContext>;
|
90 | export declare function updateContextWithCliFlags(context: CodegenContext, cliFlags: YamlCliFlags): void;
|
91 | export declare class CodegenContext {
|
92 | private _config;
|
93 | private _graphqlConfig?;
|
94 | private config;
|
95 | private _project?;
|
96 | private _pluginContext;
|
97 | cwd: string;
|
98 | filepath: string;
|
99 | profiler: Profiler;
|
100 | profilerOutput?: string;
|
101 | constructor({ config, graphqlConfig, filepath, }: {
|
102 | config?: Types.Config;
|
103 | graphqlConfig?: GraphQLConfig;
|
104 | filepath?: string;
|
105 | });
|
106 | useProject(name?: string): void;
|
107 | getConfig<T>(extraConfig?: T): T & Types.Config;
|
108 | updateConfig(config: Partial<Types.Config>): void;
|
109 | useProfiler(): void;
|
110 | getPluginContext(): {
|
111 | [key: string]: any;
|
112 | };
|
113 | loadSchema(pointer: Types.Schema): Promise<GraphQLSchema>;
|
114 | loadDocuments(pointer: Types.OperationDocument[]): Promise<Types.DocumentFile[]>;
|
115 | }
|
116 | export declare function ensureContext(input: CodegenContext | Types.Config): CodegenContext;
|