UNPKG

2.09 kBTypeScriptView Raw
1import { Types } from '@graphql-codegen/plugin-helpers';
2import { GraphQLConfig } from 'graphql-config';
3export declare type YamlCliFlags = {
4 config: string;
5 watch: boolean | string | string[];
6 require: string[];
7 overwrite: boolean;
8 project: string;
9 silent: boolean;
10};
11export declare function loadContext(configFilePath?: string): Promise<CodegenContext> | never;
12export declare function buildOptions(): {
13 c: {
14 alias: string;
15 type: "string";
16 describe: string;
17 };
18 w: {
19 alias: string;
20 describe: string;
21 coerce: (watch: any) => string | boolean | any[];
22 };
23 r: {
24 alias: string;
25 describe: string;
26 type: "array";
27 default: any[];
28 };
29 o: {
30 alias: string;
31 describe: string;
32 type: "boolean";
33 };
34 s: {
35 alias: string;
36 describe: string;
37 type: "boolean";
38 };
39 p: {
40 alias: string;
41 describe: string;
42 type: "string";
43 };
44};
45export declare function parseArgv(argv?: string[]): YamlCliFlags;
46export declare function createContext(cliFlags?: YamlCliFlags): Promise<CodegenContext>;
47export declare function updateContextWithCliFlags(context: CodegenContext, cliFlags: YamlCliFlags): void;
48export declare class CodegenContext {
49 private _config;
50 private _graphqlConfig?;
51 private config;
52 private _project?;
53 private _pluginContext;
54 cwd: string;
55 filepath: string;
56 constructor({ config, graphqlConfig, filepath, }: {
57 config?: Types.Config;
58 graphqlConfig?: GraphQLConfig;
59 filepath?: string;
60 });
61 useProject(name?: string): void;
62 getConfig(): Types.Config;
63 updateConfig(config: Partial<Types.Config>): void;
64 getPluginContext(): {
65 [key: string]: any;
66 };
67 loadSchema(pointer: Types.Schema): Promise<import("graphql").GraphQLSchema>;
68 loadDocuments(pointer: Types.OperationDocument[]): Promise<Types.DocumentFile[]>;
69}
70export declare function ensureContext(input: CodegenContext | Types.Config): CodegenContext;