The structural shape a Temporal.* value presents to the encode side of the tagged-container bridge.

Encoding needs no Temporal implementation at all — the two members below are intrinsic to the value (tagged-types.ts:43-47), so the shape is declared structurally here instead of type-depending on a polyfill this package does not install.

The tag is the template literal rather than a bare string on purpose. BigInt.prototype[Symbol.toStringTag] is "BigInt" and Symbol.prototype[Symbol.toStringTag] is string, so a bare string here would quietly admit two of the four scalar classes WireValue exists to place OUTSIDE the wire domain, and the type would stop describing the codec.

interface WireTemporal {
    "[toStringTag]":
        | "Temporal.Instant"
        | "Temporal.PlainDate"
        | "Temporal.PlainTime"
        | "Temporal.PlainDateTime"
        | "Temporal.PlainYearMonth"
        | "Temporal.PlainMonthDay"
        | "Temporal.ZonedDateTime"
        | "Temporal.Duration";
    toString(): string;
}

Properties

Methods

Properties

"[toStringTag]":
    | "Temporal.Instant"
    | "Temporal.PlainDate"
    | "Temporal.PlainTime"
    | "Temporal.PlainDateTime"
    | "Temporal.PlainYearMonth"
    | "Temporal.PlainMonthDay"
    | "Temporal.ZonedDateTime"
    | "Temporal.Duration"

Methods

  • Returns string