Entry/encoded attributes — a readonly record of arbitrary values, matching the engine's
{ readonly [key: string]: unknown } on QueueEntry / QueueEncodedEntry.
export const const queueEntryAttributes: Schema.$Record<
Schema.String,
Schema.Unknown
>
const queueEntryAttributes: {
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]: unknown; }, readonly []>) => Schema.$Record<Schema.String, Schema.Unknown>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: unknown }>) => Schema.$Record<Schema.String, Schema.Unknown>;
check: (checks_0: Check<{ readonly [x: string]: unknown }>, ...checks: Array<Check<{ readonly [x: string]: unknown }>>) => Schema.$Record<Schema.String, Schema.Unknown>;
rebuild: (ast: Objects) => Schema.$Record<Schema.String, Schema.Unknown>;
make: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => { readonly [x: string]: unknown };
makeOption: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => Option.Option<{ readonly [x: string]: unknown }>;
makeEffect: (input: { readonly [x: string]: unknown }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly [x: string]: unknown }, 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; <…;
}
Entry/encoded attributes — a readonly record of arbitrary values, matching the engine's
{ readonly [key: string]: unknown } on QueueEntry / QueueEncodedEntry.
queueEntryAttributes = import SchemaSchema.function Record<Schema.String, Schema.Unknown>(key: Schema.String, value: Schema.Unknown, options?: {
readonly keyValueCombiner: {
readonly decode?: Combiner<readonly [string, unknown]> | undefined;
readonly encode?: Combiner<readonly [string, unknown]> | undefined;
};
} | undefined): Schema.$Record<Schema.String, Schema.Unknown>
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, import SchemaSchema.const Unknown: Schema.Unknownconst Unknown: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<unknown, readonly []>) => Schema.Unknown;
annotateKey: (annotations: Schema.Annotations.Key<unknown>) => Schema.Unknown;
check: (checks_0: Check<unknown>, ...checks: Array<Check<unknown>>) => Schema.Unknown;
rebuild: (ast: Unknown) => Schema.Unknown;
make: (input: unknown, options?: Schema.MakeOptions) => unknown;
makeOption: (input: unknown, options?: Schema.MakeOptions) => Option.Option<unknown>;
makeEffect: (input: unknown, options?: Schema.MakeOptions) => Effect.Effect<unknown, 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
Unknown
.
Schema for the unknown type. Accepts any value without validation.
When to use
Use as a top schema when you need to accept any input while preserving
TypeScript's unknown safety at use sites.
Unknown);