UNPKG

@pqstudio/protobuf_ts_plugin

Version:

The protocol buffer compiler plugin "protobuf-ts" generates TypeScript, gRPC-web, Twirp, and more.

24 lines (23 loc) 1.24 kB
import { DescriptorProto, DescriptorRegistry, TypescriptFile, TypeScriptImports } from "@pqstudio/protobuf_ts_framework"; import * as ts from "typescript"; import { LongType } from "@protobuf-ts/runtime"; import { Interpreter } from "../interpreter"; import { CustomMethodGenerator } from "../code-gen/message-type-generator"; /** * Generates a "create()" method for an `IMessageType` */ export declare class Create implements CustomMethodGenerator { private readonly registry; private readonly imports; private readonly interpreter; private readonly options; constructor(registry: DescriptorRegistry, imports: TypeScriptImports, interpreter: Interpreter, options: { normalLongType: LongType; oneofKindDiscriminator: string; runtimeImportPath: string; }); make(source: TypescriptFile, descriptor: DescriptorProto): ts.MethodDeclaration[]; makeMethod(source: TypescriptFile, descriptor: DescriptorProto, ...bodyStatements: readonly ts.Statement[]): ts.MethodDeclaration; makeMessageVariable(source: TypescriptFile, descriptor: DescriptorProto): ts.VariableStatement; makeMergeIf(source: TypescriptFile, descriptor: DescriptorProto): ts.IfStatement; }