UNPKG

@aws-amplify/graphql-types-generator

Version:

Generate API code or type annotations based on a GraphQL schema and statements

45 lines (44 loc) 1.54 kB
export interface BasicGeneratedFile { output: string; } export declare type BasicGeneratedFileMap = { [filepath: string]: BasicGeneratedFile; }; export declare function isBasicGeneratedFileMap(output: string | BasicGeneratedFileMap): output is BasicGeneratedFileMap; export declare class GeneratedFile<Scope = any> implements BasicGeneratedFile { scopeStack: Scope[]; indentWidth: number; indentLevel: number; startOfIndentLevel: boolean; output: string; pushScope(scope: Scope): void; popScope(): Scope | undefined; get scope(): Scope; print(string?: string): void; printNewline(): void; printNewlineIfNeeded(): void; printOnNewline(string?: string): void; printIndent(): void; withIndent(closure: Function): void; withinBlock(closure: Function, open?: string, close?: string): void; } export declare class CodeGenerator<Context = any, Scope = any> { context: Context; generatedFiles: { [fileName: string]: GeneratedFile<Scope>; }; currentFile: GeneratedFile<Scope>; constructor(context: Context); withinFile(fileName: string, closure: Function): void; get output(): string; pushScope(scope: Scope): void; popScope(): void; get scope(): Scope; print(string?: string): void; printNewline(): void; printNewlineIfNeeded(): void; printOnNewline(string?: string): void; printIndent(): void; withIndent(closure: Function): void; withinBlock(closure: Function, open?: string, close?: string): void; }