$ReadonlyMap<Key, Value>Type-level representation returned by ReadonlyMap.
export interface interface $ReadonlyMap<Key extends Constraint, Value extends Constraint>Type-level representation returned by
ReadonlyMap
.
$ReadonlyMap<function (type parameter) Key in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Key extends Constraint, function (type parameter) Value in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Value extends Constraint> extends
interface declareConstructor<T, E, TypeParameters extends ReadonlyArray<Constraint>, Iso = T>Creates a schema for a parametric type (a generic container such as
Array<A>, Option<A>, etc.) by accepting a list of type-parameter schemas
and a decoder factory.
When to use
Use when you are defining a schema for a generic container whose validation
depends on one or more type-parameter schemas.
Details
The outer call declareConstructor<T, E, Iso>() fixes the decoded type T,
the encoded type E, and the optional iso type. The inner call receives:
typeParameters — the concrete schemas for each type variable
run — a factory that, given resolved codecs for each type parameter,
returns a parsing function (u, ast, options) => Effect<T, Issue>
annotations — optional metadata
Type-level representation returned by
declareConstructor
.
declareConstructor<
module globalThisglobalThis.interface ReadonlyMap<K, V>ReadonlyMap<function (type parameter) Key in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Key["Type"], function (type parameter) Value in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Value["Type"]>,
module globalThisglobalThis.interface ReadonlyMap<K, V>ReadonlyMap<function (type parameter) Key in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Key["Encoded"], function (type parameter) Value in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Value["Encoded"]>,
readonly [function (type parameter) Key in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Key, function (type parameter) Value in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Value],
type ReadonlyMapIso<
Key extends Constraint,
Value extends Constraint
> = readonly (readonly [
Key["Iso"],
Value["Iso"]
])[]
Iso representation used for ReadonlyMap schemas: an array of readonly
[key, value] tuples using each entry schema's Iso type.
ReadonlyMapIso<function (type parameter) Key in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Key, function (type parameter) Value in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Value>
>
{
readonly "Rebuild": interface $ReadonlyMap<Key extends Constraint, Value extends Constraint>Type-level representation returned by
ReadonlyMap
.
$ReadonlyMap<function (type parameter) Key in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Key, function (type parameter) Value in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Value>
readonly $ReadonlyMap<Key extends Constraint, Value extends Constraint>.key: Key extends Constraintkey: function (type parameter) Key in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Key
readonly $ReadonlyMap<Key extends Constraint, Value extends Constraint>.value: Value extends Constraintvalue: function (type parameter) Value in $ReadonlyMap<Key extends Constraint, Value extends Constraint>Value
}