Represents a generic control interface with key-value pair operations.

interface IControl<K, V> {
    add: (key: K, value: V) => void;
    remove: (key: K) => boolean;
}

Type Parameters

  • K

    The type of keys.

  • V

    The type of values.

Properties

Properties

add: (key: K, value: V) => void

Adds a key-value pair to the control.

Type declaration

    • (key: K, value: V): void
    • Parameters

      • key: K

        The key to add.

      • value: V

        The value to associate with the key.

      Returns void

remove: (key: K) => boolean

Removes a key and its associated value from the control.

Type declaration

    • (key: K): boolean
    • Parameters

      • key: K

        The key to remove.

      Returns boolean

      true if ok