Interface HthvItem<TNameMode, TTagMode, TParamsMode>

Parsed HTTP header value item.

HTTP header value may consist of multiple such items, either comma- or space- separated.

Some items may be nested inside another ones. E.g. as item parameters, or as nested comments.

Item may represent a <name>=<value> pair used as top level item or its parameter, or a <name>:<value> pair within comment.

Type Parameters

  • TNameMode extends "has-name" | "no-name" = "has-name" | "no-name"

    Whether this item has a name.

  • TTagMode extends "has-tag" | "no-tag" = "has-tag" | "no-tag"

    Whether this item has a tag.

  • TParamsMode extends "has-params" | "no-params" = "has-params" | "no-params"

    Whether this item has parameters.

Hierarchy

  • HthvItem

Properties

$ n p pl t v x

Properties

$: "has-tag" extends TTagMode
    ? HthvItemType
    : "raw" | "date-time" | "quoted-string" | "angle-bracketed-string"

Item value type.

n: "has-name" extends TNameMode
    ? "no-name" extends TNameMode
        ? undefined | string
        : string
    : undefined

A name of name/value item.

This is always a token.

p: "has-params" extends TParamsMode
    ? HthvParamMap
    : {
        [name: string]: never;
    }

A map of item parameters.

Includes an entry for this item if it has a name.

pl: "has-params" extends TParamsMode
    ? HthvParamItem[]
    : []

A list of all item parameters.

t: "has-tag" extends TTagMode
    ? "no-tag" extends TTagMode
        ? undefined | string
        : string
    : undefined

A tag of tagged string.

This is only set for tagged-string item type.

v: string

Item value.

Any extra items immediately following item value and preceding its parameters. Typically empty.

Generated using TypeDoc