Files
setup-zig/node_modules/@protobuf-ts/plugin/build/code-gen/message-interface-generator.d.ts
mlugg 048396053b npm update
Notably, this gets us `@actions/github` 6.0.1, which is necessary for
`github.context.runAttempt` (so I have also updated `package.json`
accordingly). On that note... great job following semver, GitHub!
Between this and the non-breaking major version change on
`@actions/cache`, I'm starting to feel like nobody on the Actions team
understands how software versioning works.
2025-06-29 17:06:44 +01:00

72 lines
2.2 KiB
TypeScript

import * as ts from "typescript";
import * as rt from "@protobuf-ts/runtime";
import { TypescriptFile } from "../framework/typescript-file";
import { CommentGenerator } from "./comment-generator";
import { Interpreter } from "../interpreter";
import { DescMessage } from "@bufbuild/protobuf";
import { TypeScriptImports } from "../framework/typescript-imports";
import { SymbolTable } from "../framework/symbol-table";
export declare class MessageInterfaceGenerator {
private readonly symbols;
private readonly imports;
private readonly comments;
private readonly interpreter;
private readonly options;
constructor(symbols: SymbolTable, imports: TypeScriptImports, comments: CommentGenerator, interpreter: Interpreter, options: {
oneofKindDiscriminator: string;
normalLongType: rt.LongType;
});
registerSymbols(source: TypescriptFile, descMessage: DescMessage): void;
/**
* `message` as an interface.
*
* For the following .proto:
*
* message MyMessage {
* string str_field = 1;
* }
*
* We generate the following interface:
*
* interface MyMessage {
* strField: string;
* }
*
*/
generateMessageInterface(source: TypescriptFile, descMessage: DescMessage): ts.InterfaceDeclaration;
/**
* Create property signature for a protobuf field. Example:
*
* fieldName: number
*
*/
private createFieldPropertySignature;
/**
* `oneof` as an algebraic data type.
*
* For the following .proto:
*
* oneof result {
* int32 value = 1;
* string error = 2;
* }
*
* We generate the following property signature:
*
* result: { oneofKind: "value"; value: number; }
* | { oneofKind: "error"; error: string; }
* | { oneofKind: undefined; };
*/
private createOneofADTPropertySignature;
/**
* Helper to find for a OneofDescriptorProto:
* [0] the message descriptor
* [1] a corresponding message type generated by the interpreter
* [2] the runtime local name of the oneof
*/
private oneofInfo;
private createScalarTypeNode;
private createMessageTypeNode;
private createEnumTypeNode;
}