Files
NapCatQQ/.pnpm-store/v3/files/b4/65638d6e5e9e5a266fb2c4b46cb117f1e4179860718824596f6885421497952aa213a8e492217d83ef076c08f37b0ab32e8e2a84d2c36a5dc5dcc1bcb24cfc
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

15 lines
672 B
Plaintext

import type { TSchema, SchemaOptions } from '../schema/index';
import { type TLiteral } from '../literal/index';
import { Kind, Hint } from '../symbols/index';
export type TEnumRecord = Record<TEnumKey, TEnumValue>;
export type TEnumValue = string | number;
export type TEnumKey = string;
export interface TEnum<T extends Record<string, string | number> = Record<string, string | number>> extends TSchema {
[Kind]: 'Union';
[Hint]: 'Enum';
static: T[keyof T];
anyOf: TLiteral<T[keyof T]>[];
}
/** `[Json]` Creates a Enum type */
export declare function Enum<V extends TEnumValue, T extends Record<TEnumKey, V>>(item: T, options?: SchemaOptions): TEnum<T>;