Options
All
  • Public
  • Public/Protected
  • All
Menu

cardon

Index

Type aliases

CardonRef

CardonRef: { component: () => JSX.Element | null; key: string; resolve: (value: any) => void; setVisible: (value: boolean) => void }

Type declaration

  • component: () => JSX.Element | null
      • (): JSX.Element | null
      • Returns JSX.Element | null

  • key: string
  • resolve: (value: any) => void
      • (value: any): void
      • Parameters

        • value: any

        Returns void

  • setVisible: (value: boolean) => void
      • (value: boolean): void
      • Parameters

        • value: boolean

        Returns void

WithCardonGet

WithCardonGet<T>: (data?: T) => VoidFunction

Type parameters

  • T

Type declaration

    • (data?: T): VoidFunction
    • Parameters

      • Optional data: T

      Returns VoidFunction

WithCardonOptions

WithCardonOptions: { destroyOnHide?: boolean; key?: string }

Type declaration

  • Optional destroyOnHide?: boolean

    Enables destroy the component while hiding.

    When you do not change this property, the component will not be removed from the root and you will need to hide it with the 'visible' property manually.

    Default value is 'false'

  • Optional key?: string

    The key of the component. You can close the component by calling the 'CardonContainer.remove(key)' method.

WithCardonResult

WithCardonResult<T, P>: { hide: (rejectData: any) => void; show: WithCardonShow<T, P> }

Type parameters

  • T

  • P

Type declaration

  • hide: (rejectData: any) => void

    Hides the card.

    By default, it calls the 'get' method that is passed as props: get(undefined). If you call it with a parameter, the promise resolves with that value.

      • (rejectData: any): void
      • Parameters

        • rejectData: any

        Returns void

  • show: WithCardonShow<T, P>

    Shows the card component. Card props can be passed optionally.

WithCardonShow

WithCardonShow<P, R>: (props?: P, callback?: (result: R) => void) => Promise<R>

Type parameters

  • P

  • R

Type declaration

    • (props?: P, callback?: (result: R) => void): Promise<R>
    • Parameters

      • Optional props: P
      • Optional callback: (result: R) => void
          • (result: R): void
          • Parameters

            • result: R

            Returns void

      Returns Promise<R>

Functions

CardonContainer

  • CardonContainer(): ReactElement<any>

withCardon

  • Wraps the component you want to make reusable and returns the 'show' and 'hide' functions within an object.

    Type parameters

    • P

      The type of props value

    • R = {}

      The type of return value

    Parameters

    Returns WithCardonResult<P, R>

    {
      show: (args?: P, callback?: (result: P) => void): Promise<R>,
      hide: () => void,
    }
    

Generated using TypeDoc