mimekit-ts - v1.0.0
    Preparing search index...

    Class ParameterList

    Represents a collection of MIME header parameters.

    Implements

    Index
    onChanged: (() => void) | null = null

    Invoked when the parameter list changes.

    onBoundaryChanged: (() => void) | null = null

    Invoked when the boundary parameter changes.

    • Adds a parameter to the list.

      Parameters

      Returns void

      A parameter with the same name already exists.

    • Adds a parameter with the specified name and value.

      Parameters

      • name: string

        The parameter name.

      • value: string

        The parameter value.

      Returns void

    • Adds a parameter with the specified charset, name, and value.

      Parameters

      • charset: string | CharsetEncoding

        The charset to use when encoding the value.

      • name: string

        The parameter name.

      • value: string

        The parameter value.

      Returns void

    • Determines whether the list contains the specified parameter or parameter name.

      Parameters

      • nameOrParameter: string | Parameter

        The parameter or parameter name.

      Returns boolean

      true if the parameter is contained; otherwise, false.

      nameOrParameter is null or undefined.

    • Gets the index of the specified parameter or parameter name.

      Parameters

      • nameOrParameter: string | Parameter

        The parameter or parameter name.

      Returns number

      The index of the parameter, or -1 if it is not found.

      nameOrParameter is null or undefined.

    • Inserts a parameter at the specified index.

      Parameters

      • index: number

        The insertion index.

      • parameter: Parameter

        The parameter to insert.

      Returns void

      index is out of range.

      A parameter with the same name already exists.

    • Inserts a parameter with the specified name and value.

      Parameters

      • index: number

        The insertion index.

      • name: string

        The parameter name.

      • value: string

        The parameter value.

      Returns void

    • Removes a parameter from the list.

      Parameters

      • nameOrParameter: string | Parameter

        The parameter or parameter name to remove.

      Returns boolean

      true if the parameter was removed; otherwise, false.

      nameOrParameter is null or undefined.

    • Removes the parameter at the specified index.

      Parameters

      • index: number

        The index to remove.

      Returns void

      index is out of range.

    • Gets the parameter at the specified index.

      Parameters

      • index: number

        The parameter index.

      Returns Parameter

    • Gets the value of the specified parameter name.

      Parameters

      • name: string

        The parameter name.

      Returns string | null

      The parameter value, or null if it is not found.

    • Replaces the parameter at the specified index.

      Parameters

      • index: number

        The parameter index.

      • parameter: Parameter

        The replacement parameter.

      Returns void

      index is out of range.

    • Sets a parameter value by name, adding it if it does not exist.

      Parameters

      • name: string

        The parameter name.

      • value: string

        The parameter value.

      Returns void

    • Attempts to get a parameter by name.

      Parameters

      • name: string

        The parameter name.

      Returns Parameter | null

      The parameter, or null if it is not found.

      name is null or undefined.

    • Encodes the parameter list and appends it to a string builder.

      Parameters

      • options: FormatOptions

        The formatting options.

      • builder: string[]

        The destination string fragments.

      • lineLength: { value: number }

        The current output line length.

      • charset: CharsetEncoding = utf8

        The charset to use when encoding parameter values.

      Returns void

    • Writes the parameter list without applying header encoding.

      Parameters

      • builder: string[]

        The destination string fragments.

      Returns void

    • Serializes the parameter list.

      Returns string

      A string representing the parameter list.