vue-ts-types
Version:
Lightweight TypeScript-first Vue prop type definitions
13 lines (12 loc) • 709 B
TypeScript
import type { PropOptionsGenerator } from '../types';
import type { Validator } from '../validators';
type PlainObject = Record<number | string | symbol, unknown>;
/**
* Allows any of the keys of the specified object (validated at runtime and compile time).
*
* @template T - can be used to adjust the inferred type at compile time, this is usually not necessary.
* @param object - The object whose keys are allowed.
* @param validator - Optional function for further runtime validation; should return `undefined` if valid, or an error string if invalid.
*/
export declare const oneOfObjectKeysProp: <T extends PlainObject>(object: T, validator?: Validator) => PropOptionsGenerator<keyof T>;
export {};