UNPKG

@graphql-cli/init

Version:

Creates a GraphQL project using a template or GraphQL Config file for your existing project.

53 lines (52 loc) 1.69 kB
declare type StandardEnum<T> = { [id: string]: T | string; [nu: number]: string; }; export declare function askForEnum<T, Enum extends StandardEnum<T>>(options: { enum: Enum; message: string; defaultValue?: T; ignoreList?: (T | string)[]; }): Promise<T>; export interface Context { name: string; path: string; type?: ProjectType; graphqlConfig: any; } export declare enum InitializationType { FromScratch = "I want to create a new project from a GraphQL CLI Project Template.", ExistingOpenAPI = "I have an existing project using OpenAPI/Swagger Schema Definition.", ExistingGraphQL = "I have an existing project using GraphQL and want to add GraphQL CLI (run from project root)." } export declare enum ProjectType { FullStack = "Full Stack", FrontendOnly = "Frontend only", BackendOnly = "Backend only" } export declare enum FrontendType { TSReactApollo = "TypeScript React Apollo", ApolloAngular = "Apollo Angular", StencilApollo = "Stencil Apollo", TSUrql = "TypeScript Urql", GraphQLRequest = "GraphQL Request", ApolloAndroid = "Apollo Android", Other = "Other" } export declare enum BackendType { TS = "TypeScript", Java = "Java", Kotlin = "Kotlin", Other = "Other" } export declare type PackageManifest = ReturnType<typeof managePackageManifest>; export declare function managePackageManifest(): { addDependency(name: string): void; addScript(name: string, script: string): void; writePackage({ path, name, initializationType, }: { path: string; name: string; initializationType: InitializationType; }): Promise<void>; }; export {};