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

29 lines
1.1 KiB
Plaintext

import { Ensure } from '../helpers/index';
import type { SchemaOptions, TSchema } from '../schema/index';
import type { Static } from '../static/index';
import { Kind } from '../symbols/index';
export interface ArrayOptions extends SchemaOptions {
/** The minimum number of items in this array */
minItems?: number;
/** The maximum number of items in this array */
maxItems?: number;
/** Should this schema contain unique items */
uniqueItems?: boolean;
/** A schema for which some elements should match */
contains?: TSchema;
/** A minimum number of contains schema matches */
minContains?: number;
/** A maximum number of contains schema matches */
maxContains?: number;
}
type ArrayStatic<T extends TSchema, P extends unknown[]> = Ensure<Static<T, P>[]>;
export interface TArray<T extends TSchema = TSchema> extends TSchema, ArrayOptions {
[Kind]: 'Array';
static: ArrayStatic<T, this['params']>;
type: 'array';
items: T;
}
/** `[Json]` Creates an Array type */
export declare function Array<Type extends TSchema>(items: Type, options?: ArrayOptions): TArray<Type>;
export {};