SerenityJS
    Preparing search index...

    Class StringProperty

    Hierarchy (View Summary)

    Index

    Constructors

    • Create a new string property with the given name and value.

      Parameters

      • name: string

        The name of the property, used for identification and referencing purposes.

      • value: string

        The value of the property, which can be of various types depending on the specific implementation and use case.

      • parent: null | ObjectProperty<unknown> = null

        The parent property of the current property, which can be used to establish a hierarchical relationship between properties and allow for proper referencing and access within the object hierarchy when serialized and deserialized.

      Returns StringProperty

    Properties

    name: string

    The name of the property, used for identification and referencing purposes.

    parent: null | ObjectProperty<unknown> = null

    The path of the property within the object hierarchy.

    triggerCount: bigint = 0n

    A counter that keeps track of the number of times the listeners have been triggered, which can be used for various purposes such as debugging, analytics, or controlling the flow of events within the user interface based on the number of interactions that have occurred.

    type: String = DataStorePropertyValueType.String

    The type of the property, used for serialization and deserialization purposes.

    value: string

    The value of the property, which can be of various types depending on the specific implementation and use case. This value is used for storing and retrieving data associated with the property.

    Methods

    • Add a listener function to the set of listeners associated with the observable element, allowing it to respond to specific events or interactions within the user interface.

      Parameters

      • listener: (player: Player, data: string) => void

        The listener function to be added, which defines the behavior and response of the observable element when certain events occur, enabling dynamic and interactive user interfaces.

      Returns void

    • Get the path of the property within the object hierarchy, which can be used for proper referencing and access when serialized and deserialized.

      Returns string

      The path of the property within the object hierarchy, which is constructed based on the parent path and the name of the property.

    • Get the data store information for the property, which includes the identifier of the root screen and the path of the property within the object hierarchy, allowing for proper referencing and access when serialized and deserialized.

      Returns null | DataDrivenScreen

      A tuple containing the identifier of the root screen and the path of the property within the object hierarchy, which can be used for proper referencing and access when serialized and deserialized.

    • Remove a listener function from the set of listeners associated with the observable element, allowing it to stop responding to specific events or interactions within the user interface.

      Parameters

      • listener: (player: Player, data: string) => void

        The listener function to be removed, which will no longer define the behavior and response of the observable element when certain events occur, allowing for dynamic control over the interactivity of the user interface.

      Returns void

    • Trigger all listener functions associated with the observable element, allowing it to respond to specific events or interactions within the user interface by executing the defined behavior and response of each listener function.

      Parameters

      • player: Player

        The player associated with the event or interaction, which can be used to provide context and information about the user who triggered the event, enabling personalized and dynamic user interfaces based on the player's actions.

      • data: string

        The data to be passed to each listener function when triggered, which can be used to provide context and information about the event or interaction that occurred, enabling dynamic and responsive user interfaces based on the provided data.

      Returns void