import { DescEnum } from "./index.js"; /** * Reflection information for a protobuf enumeration. */ export interface EnumType { /** * The fully qualified name of the enumeration. */ readonly typeName: string; readonly values: readonly EnumValueInfo[]; /** * Find an enum value by its (protobuf) name. */ findName(name: string): EnumValueInfo | undefined; /** * Find an enum value by its number. */ findNumber(no: number): EnumValueInfo | undefined; } /** * Reflection information for a protobuf enumeration value. */ export interface EnumValueInfo { /** * The numeric enumeration value, as specified in the protobuf source. */ readonly no: number; /** * The name of the enumeration value, as specified in the protobuf source. */ readonly name: string; /** * The name of the enumeration value in generated code. */ readonly localName: string; } /** * Create a new EnumType with the given values. */ export declare function createEnumType(typeName: string, values: (EnumValueInfo | Omit)[]): EnumType; export declare function enumInfoZeroValue(values: (EnumValueInfo | Omit)[]): number; export declare function enumDescZeroValue(info: DescEnum): number; export declare function enumZeroValue(info: T): number; /** * Returns the normalized version of the enum value. * Null is cast to the default value. * String names are cast to the number enum. * If string and the value is unknown, throws an error. */ export declare function normalizeEnumValue(info: EnumType, value: string | number | null | undefined): number;