winccoa-manager
    Preparing search index...

    Interface Metadata

    Interface representing metadata, which is a collection of key-value pairs. The value can be either an ASCII string or binary data.

    Keys can only contain alphanumeric characters [A-Za-z0-9], underscores (_), hyphens (-) and dots (.). Case is ignored when comparing keys and are converted to lowercase for storage. The key must not end with "-bin" if the value is ASCII. The key must end with "-bin" if the value is binary.

    interface Metadata {
        get count(): number;
        get entries(): IterableIterator<[string, string | Buffer<ArrayBufferLike>]>;
        get isEmpty(): boolean;
        add(key: string, value: string | Buffer<ArrayBufferLike>): void;
        addOrSet(key: string, value: string | Buffer<ArrayBufferLike>): void;
        clear(): void;
        get(key: string): undefined | string | Buffer<ArrayBufferLike>;
        getAll(key: string): (string | Buffer<ArrayBufferLike>)[];
        getValue(key: string, defaultValue: string): string;
        getValueBinary(key: string, defaultValue: Buffer): Buffer;
        isBinary(key: string): boolean;
        removeAll(key: string): void;
    }
    Index

    Accessors

    • get count(): number

      The number of metadata entries. Represents the total count of key-value pairs in the metadata.

      Returns number

    • get entries(): IterableIterator<[string, string | Buffer<ArrayBufferLike>]>

      The key-value pairs entries in the metadata.

      Returns IterableIterator<[string, string | Buffer<ArrayBufferLike>]>

      An iterator for the key-value pairs.

    • get isEmpty(): boolean

      A boolean property that is true if the metadata is empty, otherwise false.

      Returns boolean

    Methods

    • Adds a new valued metadata entry.

      Parameters

      • key: string

        The key of the metadata entry.

      • value: string | Buffer<ArrayBufferLike>

        The value for the metadata, which can be ASCII or binary.

      Returns void

      Error if the key is invalid.

    • Adds or sets a new valued metadata entry.

      Parameters

      • key: string

        The key of the metadata entry.

      • value: string | Buffer<ArrayBufferLike>

        The value for the metadata, which can be ASCII or binary.

      Returns void

      Error if the key is invalid.

    • Clears all metadata entries.

      Returns void

    • Gets the last value associated with the specified key.

      Parameters

      • key: string

        The key of the metadata entry.

      Returns undefined | string | Buffer<ArrayBufferLike>

      The value associated with the key, or undefined if the key does not exist.

      Error if the key is invalid.

    • Gets all values associated with the specified key.

      Parameters

      • key: string

        The key of the metadata entry.

      Returns (string | Buffer<ArrayBufferLike>)[]

      An array of values associated with the key, which can be strings or Buffers.

      Error if the key is invalid.

    • Gets the last string value associated with the specified key.

      Parameters

      • key: string

        The key of the metadata entry.

      • defaultValue: string

        The default value to return if the key does not exist.

      Returns string

      The value associated with the key, or the default value if the key does not exist.

      Error if the key is invalid.

    • Gets the last binary value associated with the specified key.

      Parameters

      • key: string

        The key of the metadata entry.

      • defaultValue: Buffer

        The default value to return if the key does not exist.

      Returns Buffer

      The value associated with the key, or the default value if the key does not exist.

      Error if the key is invalid.

    • Checks if the value associated with the specified key is binary.

      Parameters

      • key: string

        The key for the metadata.

      Returns boolean

      True if the value is binary, otherwise false.

      Error if the key is invalid.

    • Removes all values associated with the specified key.

      Parameters

      • key: string

        The key of the metadata entry.

      Returns void

      Error if the key is invalid.