UNPKG

vue-ts-types

Version:

Lightweight TypeScript-first Vue prop type definitions

11 lines (10 loc) 607 B
import type { Constructor, PropOptionsGenerator } from '../types'; import type { Validator } from '../validators'; /** * Allows instances of the given constructor (validated at runtime and compile time). * * @template T - can be used to adjust the inferred type at compile time. * @param parent - The constructor to allow. * @param validator - Optional function for further runtime validation; should return `undefined` if valid, or an error string if invalid. */ export declare const instanceOfProp: <T extends Constructor>(parent: T, validator?: Validator) => PropOptionsGenerator<InstanceType<T>>;