import { Assign, RequiredKeys } from "utility-types"; import { Optionals } from "./types"; declare type Requireds = Pick>; export declare const required = "__!!!!!!this is a required property!!!!!!__"; declare type Definition = { [K in keyof T]: {} extends Pick ? T[K] : typeof required; }; /** * `define(props: unknown, definition)` * Guarantees at runtime that `props` matches `definition` * `U` must only be the optional params on `T` * * @return {object} T where provided defaults are guaranteed * * @example * * define<{name: string, * highlight?: boolean, * last?: string}, * {highlight: boolean}>(unknown_prop, {highlight: false}); * * Unfortunately you must use both type annotations until this goes through * https://github.com/microsoft/TypeScript/issues/26242 * **/ export declare function define(props: unknown, definition: Definition): T; export declare function define>(props: unknown, definition: Assign, U>, allow_extra?: boolean, strict?: boolean): Assign>; export {};