Files
NapCatQQ/.pnpm-store/v3/files/64/1b5676b54189639c6ba483037711e74ec697f47ee38733891ffa15da7f2eefa1418bb9be3493cd68734d43f1187f7bbd85f4990b3dea4977a87be4df431895
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

43 lines
1.5 KiB
Plaintext

import type { EnumInfo } from "./reflection-info";
/**
* Is this a lookup object generated by Typescript, for a Typescript enum
* generated by protobuf-ts?
*
* - No `const enum` (enum must not be inlined, we need reverse mapping).
* - No string enum (we need int32 for protobuf).
* - Must have a value for 0 (otherwise, we would need to support custom default values).
*/
export declare function isEnumObject(arg: any): arg is EnumInfo[1];
/**
* Lists all values of a Typescript enum, as an array of objects with a "name"
* property and a "number" property.
*
* Note that it is possible that a number appears more than once, because it is
* possible to have aliases in an enum.
*
* Throws if the enum does not adhere to the rules of enums generated by
* protobuf-ts. See `isEnumObject()`.
*/
export declare function listEnumValues(enumObject: any): EnumObjectValue[];
/**
* A value of a Typescript enum generated by protobuf-ts.
*/
export declare type EnumObjectValue = {
name: string;
number: number;
};
/**
* Lists the names of a Typescript enum.
*
* Throws if the enum does not adhere to the rules of enums generated by
* protobuf-ts. See `isEnumObject()`.
*/
export declare function listEnumNames(enumObject: any): Array<string>;
/**
* Lists the numbers of a Typescript enum.
*
* Throws if the enum does not adhere to the rules of enums generated by
* protobuf-ts. See `isEnumObject()`.
*/
export declare function listEnumNumbers(enumObject: any): Array<number>;