import { CSSProperties } from "react"; //#region src/utils.d.ts /** https://www.totaltypescript.com/tips/create-autocomplete-helper-which-allows-for-arbitrary-values */ type PrimitiveType = string | boolean | number; /** Force TypeScript to "print" the union by remapping keys to themselves. */ type Simplify = { [K in keyof T]: T[K] } & {}; type HasStringIndex = string extends keyof T ? true : false; type HasNumberIndex = number extends keyof T ? true : false; /** Remove index-signature catch-alls ("string" / "number") if present. */ type StripIndexSignatures = HasStringIndex extends true ? Exclude : HasNumberIndex extends true ? Exclude : keyof T; /** Core: only the keys you declared on your interface (no Object.prototype). */ type OwnKeys = Exclude, keyof object>; type Id = T extends object ? { [K in keyof T]: Id } : T; type SetState = React.Dispatch>; type ArbitraryValue = `[${string}]`; type CssProperty = keyof CSSProperties; interface AsChildProps { /** * @description When asChild is set to true, the component's child will be cloned and passed * the props and behavior required to make it functional. */ asChild?: boolean; } //#endregion export { ArbitraryValue, AsChildProps, CssProperty, Id, OwnKeys, PrimitiveType, SetState, Simplify };