Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Bind

Index

Type aliases

HandlerRegistrationGeneric

HandlerRegistrationGeneric: IBindHandlerRegistration<{}, string | number>

Variables

Const anythingHandlers

anythingHandlers: Map<BindingEvent, PriorityMap<Set<IBindHandlerRegistration<{}, string | number>>>> = new Map<BindingEvent, PriorityMap<Set<HandlerRegistrationGeneric>>>()

Const handlerMap

handlerMap: WeakMap<(api: IBindHandlerApi) => R, number> = new WeakMap<BindingHandler<any>, number>()

Const handlers

handlers: Map<BindingEvent, PriorityMap<Map<Bindable, Set<IBindHandlerRegistration<{}, string | number>>>>> = new Map<BindingEvent, PriorityMap<Map<Bindable, Set<HandlerRegistrationGeneric>>>>()

Let id

id: number = 0

Const nullInstance

nullInstance: InstanceWithBindHandlers & {} = {} as InstanceWithBindHandlers & Record<number, BindingHandler<any>>

Const shouldLogHoldingEvent

shouldLogHoldingEvent: false = false

Functions

addHandler

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Type parameters

    • T: {}

    • K: keyof T

    Parameters

    Returns void

  • Type parameters

    • T: {}

    • K: keyof T

    Parameters

    • bindable: "anything"
    • event: BindingEventName
    • obj: T
    • key: K
    • Optional priority: undefined | number

    Returns void

  • Type parameters

    • T: {}

    • K: keyof T

    Parameters

    Returns void

deregisterHandler

deregisterHandlers

  • deregisterHandlers(host: any): void
  • Deregisters any registered bind handlers for the given class instance. (Bind handlers are methods decorated with @Bind.onDown, @Bind.onHolding, @Bind.onUp)

    Parameters

    • host: any

    Returns void

emitEvent

executeHandler

getAnythingHandlers

getHandlers

getHandlersForInput

onDown

  • Registers a handler for when the given Bindable is pressed. This event won't be fired again until the Bindable was then released.

    Your decorated method should return whether or not the bindable was actually activated. (For example, if the mouse was in the right spot and the action can currently be executed.) If you return true, no other @Bind.onDown handlers will be run. If you return false, other matching @Bind.onDown handlers will be run.

    Parameters

    • bindable: Bindable

      The Bindable.

    • Optional priority: undefined | number

      The "priority" of this handler compared to other handlers. Higher priorities are executed first.

    Returns (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptorFunctionAnyNOfParams<BindingHandler>) => void

  • Registers a handler for when anything is pressed.

    Parameters

    • bindable: "anything"

      Must be the string "anything".

    • Optional priority: undefined | number

      The "priority" of this handler compared to other handlers. Higher priorities are executed first.

    Returns (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptorFunctionAnyNOfParams<BindingHandler<any>>) => void

  • Registers a handler for when anything is pressed. This handler will always be executed, even if other handlers also matched the catalyst.

    Parameters

    • bindable: Bindable | "anything"

      The Bindable, or the string "anything" (to handle when anything is pressed).

    • priority: number | undefined

      The "priority" of this handler compared to other handlers. Higher priorities are executed first.

    • always: true

      Must be true.

    Returns (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptorFunctionAnyNOfParams<BindingHandler<any>>) => void

onHolding

onUp

registerHandler

registerHandlers

  • registerHandlers(host: any, warnIfNoneRegistered?: boolean): boolean
  • Registers bind handlers for the given class instance. (Bind handlers are methods decorated with @Bind.onDown, @Bind.onHolding, @Bind.onUp)

    Parameters

    • host: any
    • Default value warnIfNoneRegistered: boolean = true

    Returns boolean

removeHandler

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Type parameters

    • T: {}

    • K: keyof T

    Parameters

    Returns void

  • Type parameters

    • T: {}

    • K: keyof T

    Parameters

    • bindable: "anything"
    • event: BindingEventName
    • obj: T
    • key: K
    • Optional priority: undefined | number

    Returns void

  • Type parameters

    • T: {}

    • K: keyof T

    Parameters

    Returns void

Generated using TypeDoc