interface / @typed/ui/Form

MaskSlot

Named decoded segment in a bidirectional text mask.

Learn this UI primitive →

Package version
1.0.0-beta.7
Category
Input codecs
Since
1.0.0

Import

import { MaskSlot } from "@typed/ui/Form";

Signatures

export interface MaskSlot<Name extends string = string, Value = unknown> {
    readonly _tag: "MaskSlot";
    readonly name: Name;
    readonly codec: Schema.Codec<Value, string>;
    readonly length?: number;
    readonly charset?: RegExp | ((character: string) => boolean);
}

Property: _tag

Discriminant used to distinguish slots from literal mask parts.

Property: charset

Per-character acceptance test applied before Schema decoding.

Property: codec

Bidirectional conversion between this slot’s string segment and decoded value.

Property: length

Exact encoded character count, when fixed-width.

Property: name

Property name written into the decoded mask object.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source