Hosanna UI API v2.3.0-next
    Preparing search index...

    Class HsViewModelContract

    A model's declared contract: named state a view may read and named actions a view may send. The same names are used by every client of the product.

    Index

    Constructors

    Properties

    actionHandlers: Record<string, ViewModelActionHandler> = {}
    actionInputs: Record<string, Record<string, string>> = {}
    actionNames: string[] = []
    name: string = ''
    stateNames: string[] = []
    stateReaders: Record<string, () => unknown> = {}

    Methods

    • inputs names each input the action takes and its type: string, number, integer or boolean.

      Parameters

      Returns void

    • The declared inputs of an action; empty when it takes none.

      Parameters

      • name: string

      Returns Record<string, string>

    • Returns string[]

    • Parameters

      Returns boolean

      false when the contract has no such action.

    • Parameters

      • name: string
      • read: () => unknown

      Returns void