Schema.$Record<
Schema.String,
Schema.Codec<JsonValue, JsonValue, never, never>
>Option attributes — a readonly record of JsonValue, matching the engine's
{ readonly [key: string]: JsonValue } on QueueReleaseOptions / QueueRouteOptions.
export const const queueJsonAttributes: Schema.$Record<
Schema.String,
Schema.Codec<JsonValue, JsonValue, never, never>
>
const queueJsonAttributes: {
Type: Record.Type<Key, Value>;
Encoded: Record.Encoded<Key, Value>;
DecodingServices: Record.DecodingServices<Key, Value>;
EncodingServices: Record.EncodingServices<Key, Value>;
Iso: Record.Iso<Key, Value>;
key: Key;
value: Value;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly [x: string]: JsonValue; }, readonly []>) => Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: JsonValue }>) => Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>;
check: (checks_0: Check<{ readonly [x: string]: JsonValue }>, ...checks: Array<Check<{ readonly [x: string]: JsonValue }>>) => Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>;
rebuild: (ast: Objects) => Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>;
make: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => { readonly [x: string]: JsonValue };
makeOption: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => Option.Option<{ readonly [x: string]: JsonValue }>;
makeEffect: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly [x: string]: JsonValue }, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Option attributes — a readonly record of
JsonValue
, matching the engine's
{ readonly [key: string]: JsonValue } on QueueReleaseOptions / QueueRouteOptions.
queueJsonAttributes = import SchemaSchema.function Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>(key: Schema.String, value: Schema.Codec<JsonValue, JsonValue, never, never>, options?: {
readonly keyValueCombiner: {
readonly decode?: Combiner<readonly [string, JsonValue]> | undefined;
readonly encode?: Combiner<readonly [string, JsonValue]> | undefined;
};
} | undefined): Schema.$Record<Schema.String, Schema.Codec<JsonValue, JsonValue, never, never>>
Defines a record schema whose dynamic properties are selected by a key schema
and decoded with a value schema.
Details
For dynamic keys, the key schema selects matching own properties and the
value schema decodes or encodes only those selected properties. Checks on
string, number, symbol, and template literal key schemas narrow which
properties are selected.
For transformed key schemas, property selection is based on encoded property
names before the selected key is decoded.
Example (Defining a string-keyed record of numbers)
import { Schema } from "effect"
const schema = Schema.Record(Schema.String, Schema.Number)
// { readonly [x: string]: number }
type R = typeof schema.Type
const result = Schema.decodeUnknownSync(schema)({ a: 1, b: 2 })
console.log(result)
// { a: 1, b: 2 }
Record(import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String, const jsonValue: Schema.Codec<
JsonValue,
JsonValue,
never,
never
>
const jsonValue: {
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
Rebuild: Codec<T, E, RD, RE>;
Type: T;
Iso: Iso;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<JsonValue, any>) => Schema.Codec<JsonValue, JsonValue, never, never>;
annotateKey: (annotations: Schema.Annotations.Key<JsonValue>) => Schema.Codec<JsonValue, JsonValue, never, never>;
check: (checks_0: Check<JsonValue>, ...checks: Array<Check<JsonValue>>) => Schema.Codec<JsonValue, JsonValue, never, never>;
rebuild: (ast: AST) => Schema.Codec<JsonValue, JsonValue, never, never>;
make: (input: unknown, options?: Schema.MakeOptions) => JsonValue;
makeOption: (input: unknown, options?: Schema.MakeOptions) => Option.Option<JsonValue>;
makeEffect: (input: unknown, options?: Schema.MakeOptions) => Effect.Effect<JsonValue, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Recursive structural JSON value schema — decodes to
JsonValue
. Used for the option
attributes, which the engine persists as JSON. Schema.suspend breaks the self-reference.
jsonValue);