expression-evaluation
Version:
Expression Evaluation
50 lines (49 loc) • 1.94 kB
TypeScript
export type Value = void | undefined | boolean | number | ArrayBuffer | string | Value[] | {
[key: string]: Value;
} | ((...args: Value[]) => Value);
type ValueType = 'void' | 'boolean' | 'number' | 'buffer' | 'string' | 'array' | 'object' | 'function';
export declare class Type {
protected _vtypes: Set<ValueType>;
constructor(...args: ValueType[]);
get isSpecific(): boolean;
get isBoolean(): boolean;
get isNumber(): boolean;
get isBuffer(): boolean;
get isString(): boolean;
get isArray(): boolean;
get isObject(): boolean;
get isFunction(): boolean;
get isVoid(): boolean;
reduce(mask: Type): Type | undefined;
toOptional(): Type;
toString(): string;
static of(value: Value): Type;
}
export declare const typeUnknown: Type;
export declare const typeVoid: Type;
export declare const typeBoolean: Type;
export declare const typeNumber: Type;
export declare const typeBuffer: Type;
export declare const typeString: Type;
export declare const typeArray: Type;
export declare const typeObject: Type;
export declare const typeFunction: Type;
export declare const typeOptionalBoolean: Type;
export declare const typeOptionalNumber: Type;
export declare const typeOptionalBuffer: Type;
export declare const typeOptionalString: Type;
export declare const typeOptionalArray: Type;
export declare const typeOptionalObject: Type;
export declare const typeOptionalFunction: Type;
export declare const typeBooleanOrArray: Type;
export declare const typeNumberOrArray: Type;
export declare const typeBufferOrArray: Type;
export declare const typeStringOrArray: Type;
export declare const typeNumberOrString: Type;
export declare const typeArrayOrObject: Type;
export declare const typeOptionalArrayOrObject: Type;
export declare const typeEnumerable: Type;
export declare const typeIterable: Type;
export declare const typeJson: Type;
export declare const typeValid: Type;
export {};