For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/components/util.md.
v0.0.57
  • English
  • Util

    Config@rockshin/tao-ui

    Infer TypeScript types from components and their public props without a runtime helper.

    GetProps

    Read the props of a component, a Context value or an existing props object.

    TSX

    GetProp

    Read a non-nullable property type; the third argument Return extracts a function property’s return type.

    TSX
    import type { GetProp } from '@rockshin/tao-ui';
    type SearchProps = { onSearch?: (query: string) => Promise<string[]> };
    type SearchResult = GetProp<SearchProps, 'onSearch', 'Return'>; // Promise<string[]>

    GetRef

    Infer the public instance accepted by a component ref and use it with useRef.

    TSX

    Subpath import

    import type { GetProps, GetProp, GetRef } from '@rockshin/tao-ui/util';

    These exports exist only in the type system and add no browser runtime code.