Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ComponentBuilder<C, O, P>

Type Parameters

  • C

  • O

  • P = O

Hierarchy

  • ComponentBuilder

Index

Methods

  • end(): (C extends void ? FC<P> : C) & { props: P }
  • map<TName, TValue>(name: TName, mapper: ((value: TValue, props: P) => O[TName])): ComponentBuilder<void, O, P & (TValue extends void ? { [ key in string | number | symbol]?: TValue } : { [ key in string | number | symbol]: TValue })>
  • Type Parameters

    • TName extends string | number | symbol

    • TValue = O[TName]

    Parameters

    • name: TName
    • mapper: ((value: TValue, props: P) => O[TName])
        • (value: TValue, props: P): O[TName]
        • Parameters

          • value: TValue
          • props: P

          Returns O[TName]

    Returns ComponentBuilder<void, O, P & (TValue extends void ? { [ key in string | number | symbol]?: TValue } : { [ key in string | number | symbol]: TValue })>

  • prop<TValue>(name: keyof O, values: TValue[]): ComponentBuilder<void, O, P & { [ key in string]?: boolean }>
  • prop<TName, TValue>(name: TName, compute: ((value: TValue, props: P) => Partial<O>)): ComponentBuilder<void, O, P & (TValue extends void ? { [ key in string]?: TValue } : { [ key in string]: TValue })>
  • prop<TName, TMap>(name: TName, map: TMap): ComponentBuilder<void, O, P & { [ key in string | number | symbol]?: boolean }>
  • create component prop with specified valid values

    Type Parameters

    • TValue extends string

    Parameters

    • name: keyof O
    • values: TValue[]

    Returns ComponentBuilder<void, O, P & { [ key in string]?: boolean }>

  • create computed prop

    Type Parameters

    • TName extends string = string

    • TValue = unknown

    Parameters

    • name: TName
    • compute: ((value: TValue, props: P) => Partial<O>)
        • (value: TValue, props: P): Partial<O>
        • Parameters

          • value: TValue
          • props: P

          Returns Partial<O>

    Returns ComponentBuilder<void, O, P & (TValue extends void ? { [ key in string]?: TValue } : { [ key in string]: TValue })>

  • create new prop that has specified values

    Type Parameters

    • TName extends string | number | symbol

    • TMap extends Record<string, string>

    Parameters

    • name: TName
    • map: TMap

    Returns ComponentBuilder<void, O, P & { [ key in string | number | symbol]?: boolean }>

  • rename<TOld, TNew>(oldName: TOld, newName: TNew): ComponentBuilder<void, O, Omit<P, TOld> & { [ key in string]: P[TOld] }>
  • render<TNewProps, TRef>(renderFn: ((component: FC<P>, props: TNewProps, ref: ForwardedRef<TRef>) => any)): ComponentBuilder<void, O, TNewProps>
  • use renderFn to render compound component, the renderFn retrives compound component, input props, ref

    Type Parameters

    • TNewProps = P

    • TRef = any

    Parameters

    • renderFn: ((component: FC<P>, props: TNewProps, ref: ForwardedRef<TRef>) => any)
        • (component: FC<P>, props: TNewProps, ref: ForwardedRef<TRef>): any
        • Parameters

          • component: FC<P>
          • props: TNewProps
          • ref: ForwardedRef<TRef>

          Returns any

    Returns ComponentBuilder<void, O, TNewProps>

  • use<TNewProps, TArgs>(hoc: ((component: FC<P>, ...args: TArgs) => Component<TNewProps, {}, any> | FC<TNewProps>), ...args: TArgs): ComponentBuilder<void, O, TNewProps>
  • use HOC

    Type Parameters

    • TNewProps = P

    • TArgs extends any[] = []

    Parameters

    • hoc: ((component: FC<P>, ...args: TArgs) => Component<TNewProps, {}, any> | FC<TNewProps>)
        • (component: FC<P>, ...args: TArgs): Component<TNewProps, {}, any> | FC<TNewProps>
        • Parameters

          • component: FC<P>
          • Rest ...args: TArgs

          Returns Component<TNewProps, {}, any> | FC<TNewProps>

    • Rest ...args: TArgs

    Returns ComponentBuilder<void, O, TNewProps>

Generated using TypeDoc