UNPKG

@jsonjoy.com/json-type

Version:

High-performance JSON Pointer implementation

22 lines (21 loc) 1.38 kB
import * as schema from '../../schema'; import type { SchemaOf, Type } from '../types'; import { AbsType } from './AbsType'; import type { TypeExportContext } from './ModuleType/TypeExportContext'; export declare class ArrType<T extends Type | void = any, const Head extends Type[] = any, const Tail extends Type[] = any> extends AbsType<schema.ArrSchema<T extends void ? schema.Schema : SchemaOf<T extends Type ? T : never>, { [K in keyof Head]: SchemaOf<Head[K]>; }, { [K in keyof Tail]: SchemaOf<Tail[K]>; }>> { readonly _type?: T | undefined; readonly _head?: Head | undefined; readonly _tail?: Tail | undefined; constructor(_type?: T | undefined, _head?: Head | undefined, _tail?: Tail | undefined, options?: schema.Optional<schema.ArrSchema>); head<const H extends Type[]>(...head: H): ArrType<T, H, Tail>; tail<const X extends Type[]>(...tail: X): ArrType<T, Head, X>; min(min: schema.ArrSchema['min']): this; max(max: schema.ArrSchema['max']): this; getSchema(ctx?: TypeExportContext): schema.ArrSchema<T extends void ? schema.Schema : SchemaOf<T extends Type ? T : never>, { [K in keyof Head]: SchemaOf<Head[K]>; }, { [K_1 in keyof Tail]: SchemaOf<Tail[K_1]>; }>; getOptions(): schema.Optional<schema.ArrSchema<T extends void ? schema.Schema : SchemaOf<T extends Type ? T : never>>>; toString(tab?: string): string; }