mobx-ui-statelets

AddCancelHandler

AddCancelHandler: function

Describes a function where you can register a cancel handler.

param

The handler function to be called when a task is canceled.

    • (handler: function): void
    • Parameters

      • handler: function
          • (): void
          • Returns void

      Returns void

Always

Always<T>: Always<T>

Represents a type that removes the void type. For instance, Always<number|void> is just number.

Type parameter Description
T

AsTask

AsTask<T>: AsTask<T>

Converts a form state type as a task state type by extracting the task representing the submit action. Yields the provided task state as is. This is useful in normalizing a form and a task for presentations that interacts with task states like buttons.

Type parameter Description
T: FormOrTask

DomainResult

DomainResult<TDomainValue, TDomainError>: DomainFailure<TDomainValue, TDomainError> | DomainSuccess

Describes the result of domain validation on an input.

Type parameter Description
TDomainValue
TDomainError

Falsy

Falsy: null | false | void | 0 | ""

Represents any falsy value.

FormOrTask

FormOrTask: Form<any, any, any> | Task<any, any, any>

Describes a form or a task.

InputGroupContent

InputGroupContent: Input<any> | InputGroup<any> | InputGroupContentObject | InputGroupContentArray

Describes the valid structure for an input group content, which is:

  • an Input
  • an InputGroup
  • an array of inputs or input groups
  • an object of inputs or input groups
  • a nested structure of values above.

MaybeConstant

MaybeConstant<T>: T | T extends (...args: any[]) => infer TResult ? TResult : never

Represents a type that is either a constant value or a function that returns the type of that constant value. For instance, MaybeConstant<() => number> is either a function that returns number, or just number itself.

Type parameter Description
T: function

MaybePromise

MaybePromise<T>: T | Promise<T>

Represents a type or a promise that resolves to that type. For instance, MaybePromise<number> is either number or a promise that resolves number.

Type parameter Description
T

ParseResult

ParseResult<TInputValue, TParseError, TDomainValue>: ParseFailure<TInputValue, TParseError> | ParseSuccess<TDomainValue>

Describes the result of parsing an input value.

Type parameter Description
TInputValue

the input value

TParseError

the parse error

TDomainValue

the resulting domain value the from parsing

SubmitProgress

SubmitProgress<TActionProgress>: object | object

Describes a submit progress, which is divided into the validation phase and the action phase.

Type parameter Description
TActionProgress

TaskAction

TaskAction<TArg, TResult, TProgress>: function

Describes a task function.

param

the arbitrary argument the task is invoked with.

param

Call this method to register an arbitrary cancel handler that is invoked when this particular instance of the task gets canceled.

Type parameter Description
TArg
TResult
TProgress

ValidatedInputOptions

ValidatedInputOptions<TInputValue, TDomainValue, TParseError, TDomainError>: InputOptions<TInputValue> & ValidatorOptions<Input<TInputValue>, TDomainValue, TParseError, TDomainError>

Describes a validated input options, which is a combination of the input options and the validator options.

see

ValidatorOptions

see

InputOptions

Type parameter Description
TInputValue
TDomainValue
TParseError
TDomainError

ValidationError

ValidationError<TValue, TDomainValue, TParseError, TDomainError>: object & ValidationFailure<TParseError, TValue> | object & ValidationFailure<TDomainError, TDomainValue>

Represents a validation error, both domain and parsing.

Type parameter Description
TValue
TDomainValue
TParseError
TDomainError

syncFocusState

syncFocusState: DOMStateSync<HTMLElement, false | true | FocusState>

Creates a React component decorator that syncs a HTML element's focus state to the headless focus state.

createDOMStateSync

  • createDOMStateSync<TElement, TState>(syncFn: function): DOMStateSync<TElement, TState>
  • Type parameter Description
    TElement: HTMLElement
    TState

    Parameters

    • syncFn: function
        • (element: TElement, state: TState): void
        • Parameters

          • element: TElement
          • state: TState

          Returns void

    Returns DOMStateSync<TElement, TState>

resolveDOMQuery

  • resolveDOMQuery<TComponent, TMapping>(resolutions: function): (Anonymous function)
  • Creates a React component decoator that sets up headless DOM query resolution within the life-cycle of the component.

    Type parameter Description
    TComponent: Component<any, any, any>

    The type of the component that will resolve the DOM query.

    TMapping: DOMQueryResolutionMapping<any>[]

    The type of the resolution mapping.

    Parameters

    • resolutions: function

      The method should use the component context to emit DOM query resolutions that should be active while the component is active. This method will automatically be called on component mount as well as on component update.

        • (component: TComponent, resolveFn: resolve): TMapping
        • Parameters

          • component: TComponent
          • resolveFn: resolve

          Returns TMapping

    Returns (Anonymous function)

syncDOMState

  • syncDOMState<TComponent>(reaction: function): (Anonymous function)
  • Connects A React component to a state as a projection.

    Type parameter Description
    TComponent: Component<any, any, any>

    Parameters

    • reaction: function

      This function should return the subscriptions to the UI state that should be set up when the state is provided as a prop and torn down when the state is no longer provided.

        • (component: TComponent): void
        • Parameters

          • component: TComponent

          Returns void

    Returns (Anonymous function)

Generated using TypeDoc