@pqstudio/protobuf_ts_plugin
Version:
The protocol buffer compiler plugin "protobuf-ts" generates TypeScript, gRPC-web, Twirp, and more.
27 lines (26 loc) • 1.1 kB
TypeScript
import * as rt from "@protobuf-ts/runtime";
import * as ts from "typescript";
import { DescriptorRegistry, TypescriptFile, TypeScriptImports } from "@pqstudio/protobuf_ts_framework";
/**
* Generates TypeScript code for runtime field information,
* from runtime field information.
*/
export declare class FieldInfoGenerator {
private readonly registry;
private readonly imports;
private readonly options;
constructor(registry: DescriptorRegistry, imports: TypeScriptImports, options: {});
createFieldInfoLiterals(source: TypescriptFile, fieldInfos: readonly rt.PartialFieldInfo[]): ts.ArrayLiteralExpression;
createFieldInfoLiteral(source: TypescriptFile, fieldInfo: rt.PartialFieldInfo): ts.ObjectLiteralExpression;
/**
* Turn normalized field info returned by normalizeFieldInfo() back into
* the minimized form.
*/
private static denormalizeFieldInfo;
private createMessageT;
private createEnumT;
private createRepeatType;
private createScalarType;
private createLongType;
private createMapV;
}