Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>
}>Timestamps carried by a wire queueEntry.
export const const queueEntryTimestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
const queueEntryTimestamps: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly enqueuedAt: Schema.DateTimeUtc; readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined; }, readonly []>…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }>) => Schema.Struc…;
check: (checks_0: Check<{ readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }>, ...checks: Array<Check<{ readonly e…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly enqueuedAt: Schema.DateTimeUtc; readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>; readonly interruptedAt: Schema.optionalKey…;
make: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => { readonly e…;
makeOption: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Option.Optio…;
makeEffect: (input: { readonly enqueuedAt: DateTime.Utc; readonly startedAt?: DateTime.Utc | undefined; readonly completedAt?: DateTime.Utc | undefined; readonly interruptedAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Effect.Effec…;
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; <…;
}
Timestamps carried by a wire
queueEntry
.
queueEntryTimestamps = import SchemaSchema.function Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>(fields: {
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>;
}): Schema.Struct<...>
Defines a struct schema from a map of field schemas.
Details
Each field value is a schema. Use
optionalKey
or
optional
to
mark fields as optional, and
mutableKey
to mark them as mutable.
The resulting schema's Type is a readonly object type with the fields'
decoded types. The Encoded form mirrors the field schemas' encoded types.
Example (Defining a basic struct)
import { Schema } from "effect"
const Person = Schema.Struct({
name: Schema.String,
age: Schema.Number,
email: Schema.optionalKey(Schema.String)
})
// { readonly name: string; readonly age: number; readonly email?: string }
type Person = typeof Person.Type
const alice = Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 })
console.log(alice)
// { name: 'Alice', age: 30 }
Struct({
enqueuedAt: Schema.DateTimeUtc(property) enqueuedAt: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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; <…;
}
enqueuedAt: import SchemaSchema.const DateTimeUtc: Schema.DateTimeUtcconst DateTimeUtc: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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
DateTimeUtc
.
Schema for DateTime.Utc values.
When to use
Use to validate existing DateTime.Utc schema values and use the default JSON
codec that represents them as UTC ISO strings.
Details
The default JSON codec decodes UTC ISO strings into DateTime.Utc values and
encodes DateTime.Utc values as UTC ISO strings.
DateTimeUtc,
startedAt: Schema.optionalKey<Schema.DateTimeUtc>(property) startedAt: {
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.optionalKey<Schema.DateTimeUtc>;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.optionalKey<Schema.DateTimeUtc>;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.optionalKey<Schema.DateTimeUtc>;
rebuild: (ast: Declaration) => Schema.optionalKey<Schema.DateTimeUtc>;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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; <…;
}
startedAt: import SchemaSchema.const optionalKey: optionalKeyLambda
<Schema.DateTimeUtc>(self: Schema.DateTimeUtc) => Schema.optionalKey<Schema.DateTimeUtc>
Type-level representation returned by
optionalKey
.
Creates an exact optional key schema for struct fields. Unlike optional,
this creates exact optional properties (not | undefined) that can be
completely omitted from the object.
Example (Creating a struct with optional key)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optionalKey(Schema.Number)
})
// Type: { readonly name: string; readonly age?: number }
type Person = typeof schema["Type"]
optionalKey(import SchemaSchema.const DateTimeUtc: Schema.DateTimeUtcconst DateTimeUtc: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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
DateTimeUtc
.
Schema for DateTime.Utc values.
When to use
Use to validate existing DateTime.Utc schema values and use the default JSON
codec that represents them as UTC ISO strings.
Details
The default JSON codec decodes UTC ISO strings into DateTime.Utc values and
encodes DateTime.Utc values as UTC ISO strings.
DateTimeUtc),
completedAt: Schema.optionalKey<Schema.DateTimeUtc>(property) completedAt: {
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.optionalKey<Schema.DateTimeUtc>;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.optionalKey<Schema.DateTimeUtc>;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.optionalKey<Schema.DateTimeUtc>;
rebuild: (ast: Declaration) => Schema.optionalKey<Schema.DateTimeUtc>;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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; <…;
}
completedAt: import SchemaSchema.const optionalKey: optionalKeyLambda
<Schema.DateTimeUtc>(self: Schema.DateTimeUtc) => Schema.optionalKey<Schema.DateTimeUtc>
Type-level representation returned by
optionalKey
.
Creates an exact optional key schema for struct fields. Unlike optional,
this creates exact optional properties (not | undefined) that can be
completely omitted from the object.
Example (Creating a struct with optional key)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optionalKey(Schema.Number)
})
// Type: { readonly name: string; readonly age?: number }
type Person = typeof schema["Type"]
optionalKey(import SchemaSchema.const DateTimeUtc: Schema.DateTimeUtcconst DateTimeUtc: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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
DateTimeUtc
.
Schema for DateTime.Utc values.
When to use
Use to validate existing DateTime.Utc schema values and use the default JSON
codec that represents them as UTC ISO strings.
Details
The default JSON codec decodes UTC ISO strings into DateTime.Utc values and
encodes DateTime.Utc values as UTC ISO strings.
DateTimeUtc),
interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>(property) interruptedAt: {
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.optionalKey<Schema.DateTimeUtc>;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.optionalKey<Schema.DateTimeUtc>;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.optionalKey<Schema.DateTimeUtc>;
rebuild: (ast: Declaration) => Schema.optionalKey<Schema.DateTimeUtc>;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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; <…;
}
interruptedAt: import SchemaSchema.const optionalKey: optionalKeyLambda
<Schema.DateTimeUtc>(self: Schema.DateTimeUtc) => Schema.optionalKey<Schema.DateTimeUtc>
Type-level representation returned by
optionalKey
.
Creates an exact optional key schema for struct fields. Unlike optional,
this creates exact optional properties (not | undefined) that can be
completely omitted from the object.
Example (Creating a struct with optional key)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optionalKey(Schema.Number)
})
// Type: { readonly name: string; readonly age?: number }
type Person = typeof schema["Type"]
optionalKey(import SchemaSchema.const DateTimeUtc: Schema.DateTimeUtcconst DateTimeUtc: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, 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
DateTimeUtc
.
Schema for DateTime.Utc values.
When to use
Use to validate existing DateTime.Utc schema values and use the default JSON
codec that represents them as UTC ISO strings.
Details
The default JSON codec decodes UTC ISO strings into DateTime.Utc values and
encodes DateTime.Utc values as UTC ISO strings.
DateTimeUtc),
});