pg-proto-parser
Version:
The LaunchQL Proto parser
45 lines (44 loc) • 1.55 kB
TypeScript
import { Service, Type, Field, Enum, Namespace, ReflectionObject } from '@launchql/protobufjs';
import { PgProtoStoreOptions } from './options';
import * as t from '@babel/types';
interface IProtoStore {
options: PgProtoStoreOptions;
root: ReflectionObject;
services: Service[];
types: Type[];
fields: Field[];
enums: Enum[];
namespaces: Namespace[];
_parse(node: ReflectionObject): void;
}
export declare class ProtoStore implements IProtoStore {
options: PgProtoStoreOptions;
root: ReflectionObject;
services: Service[];
types: Type[];
fields: Field[];
enums: Enum[];
namespaces: Namespace[];
private _runtimeSchema?;
constructor(root: ReflectionObject, options?: PgProtoStoreOptions);
_parse(node: ReflectionObject, name?: string): void;
_processEnum(enumNode: Enum): Enum;
write(): void;
writeEnumMaps(): void;
allTypesExceptNode(): Type[];
typesToProcess(): Type[];
enumsToProcess(): Enum[];
writeTypes(): void;
writeEnums(): void;
writeUtilsEnums(): void;
writeAstHelpers(): void;
writeWrappedAstHelpers(): void;
writeRuntimeSchema(): void;
getRuntimeSchema(): any[];
generateRuntimeSchemaTypeScript(nodeSpecs: any[]): string;
generateEnumMapTypeScript(enumMap: any, varName: string, typeName: string): string;
ensureCorrectExtension(filename: string, expectedExt: string): string;
writeFile(filePath: string, content: string): void;
writeCodeToFile(filename: string, nodes: t.Node[]): void;
}
export {};