Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TargetBehavior

Target behavior class containing the target behavior actions.

Hierarchy

Index

Accessors

behaviorType

  • get behaviorType(): "none" | "target" | "button"

target

Methods

isTargeted

  • isTargeted(userId?: string): boolean
  • Gets whether the behavior is being targeted by the given user, or at all if no user id is given.

    Parameters

    • Optional userId: string

      The id of the user to check whether they are targeting this behavior.

    Returns boolean

    True if the user is targeting this behavior, false if not. In the case where no user id is given, this returns true if any user is targeting this behavior, false if none are.

onTarget

  • onTarget(targetState: "enter" | "exit", handler: ActionHandler): this
  • Add a target handler to be called when the given target state is triggered.

    Parameters

    • targetState: "enter" | "exit"

      The target state to fire the handler on.

    • handler: ActionHandler

      The handler to call when the target state is triggered.

    Returns this

    This target behavior.