For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface CustomStateSet

The CustomStateSet interface of the Document Object Model stores a list of states for an autonomous custom element, and allows states to be added and removed from the set.

MDN Reference

interface CustomStateSet {
    "[toStringTag]": string;
    size: number;
    "[iterator]"(): SetIterator<string>;
    add(value: string): this;
    clear(): void;
    delete(value: string): boolean;
    entries(): SetIterator<[string, string]>;
    forEach(
        callbackfn: (
            value: string,
            key: string,
            parent: CustomStateSet,
        ) => void,
        thisArg?: any,
    ): void;
    has(value: string): boolean;
    keys(): SetIterator<string>;
    values(): SetIterator<string>;
}

Hierarchy

  • Set<string>
    • CustomStateSet
Index
"[toStringTag]": string
size: number

the number of (unique) elements in Set.

  • Appends a new element with a specified value to the end of the Set.

    Parameters

    • value: string

    Returns this

  • Removes all elements from the Set.

    Returns void

  • Removes a specified value from the Set.

    Parameters

    • value: string

    Returns boolean

    Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

  • Returns an iterable of [v,v] pairs for every value v in the set.

    Returns SetIterator<[string, string]>

  • Parameters

    • callbackfn: (value: string, key: string, parent: CustomStateSet) => void
    • OptionalthisArg: any

    Returns void

  • Parameters

    • value: string

    Returns boolean

    a boolean indicating whether an element with the specified value exists in the Set or not.

  • Despite its name, returns an iterable of the values in the set.

    Returns SetIterator<string>

Was this helpful?