UNPKG

ui-ingredients

Version:

Headless component library for Svelte powered by zag

20 lines (19 loc) 444 B
import type { GenericObject } from './types.js'; /** * @example * ```ts * const props = { * a: 1, * b: 2, * c: 3, * d: 4, * e: 5 * }; * * const [i, j] = createSplitProps(['a', 'b'])(props); * * console.log(i); // {a: 1, b: 2} * console.log(j); // {c: 3, d: 4, e: 5} * ``` */ export declare function createSplitProps<T extends GenericObject>(keys: (keyof T)[]): <Props extends T>(props: Props) => [T, Omit<Props, keyof T>];