Files
codeql-action/node_modules/@protobuf-ts/plugin/build/code-gen/enum-generator.d.ts
Angela P Wen a196a714b8 Bump artifact dependencies if CODEQL_ACTION_ARTIFACT_V2_UPGRADE enabled (#2482)
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
Co-authored-by: Henry Mercer <henrymercer@github.com>
2024-10-01 09:59:05 -07:00

51 lines
1.3 KiB
TypeScript

import * as ts from "typescript";
import { DescriptorRegistry, EnumDescriptorProto, SymbolTable, TypescriptFile, TypeScriptImports } from "@protobuf-ts/plugin-framework";
import { CommentGenerator } from "./comment-generator";
import { Interpreter } from "../interpreter";
import { GeneratorBase } from "./generator-base";
export declare class EnumGenerator extends GeneratorBase {
private readonly options;
constructor(symbols: SymbolTable, registry: DescriptorRegistry, imports: TypeScriptImports, comments: CommentGenerator, interpreter: Interpreter, options: {});
/**
* For the following .proto:
*
* ```proto
* enum MyEnum {
* ANY = 0;
* YES = 1;
* NO = 2;
* }
* ```
*
* We generate the following enum:
*
* ```typescript
* enum MyEnum {
* ANY = 0,
* YES = 1,
* NO = 2
* }
* ```
*
* We drop a shared prefix, for example:
*
* ```proto
* enum MyEnum {
* MY_ENUM_FOO = 0;
* MY_ENUM_BAR = 1;
* }
* ```
*
* Becomes:
*
* ```typescript
* enum MyEnum {
* FOO = 0,
* BAR = 1,
* }
* ```
*
*/
generateEnum(source: TypescriptFile, descriptor: EnumDescriptorProto): ts.EnumDeclaration;
}