Schema.Struct<{
readonly date: Schema.String
readonly level: Schema.Literals<
readonly [
"All",
"Fatal",
"Error",
"Warn",
"Info",
"Debug",
"Trace",
"None"
]
>
readonly message: Schema.String
readonly cause: Schema.optional<Schema.String>
readonly annotations: Schema.$Record<Schema.String, Schema.String>
readonly spans: Schema.$Array<Schema.String>
}>export const const LogEntrySchema: Schema.Struct<{
readonly date: Schema.String
readonly level: Schema.Literals<
readonly [
"All",
"Fatal",
"Error",
"Warn",
"Info",
"Debug",
"Trace",
"None"
]
>
readonly message: Schema.String
readonly cause: Schema.optional<Schema.String>
readonly annotations: Schema.$Record<
Schema.String,
Schema.String
>
readonly spans: Schema.$Array<Schema.String>
}>
const LogEntrySchema: {
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 date: Schema.String; readonly level: Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>; readonly message: Schema.String; readonly cause: Schema.optional<Schema.String>; re…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly annotations: { readonly [x: string]: string; }; readonly spans: ReadonlyArray<string>; readonly date: string; readonly level: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly annotations: { readonly [x: string]: string }; readonly spans: ReadonlyArray<string>; readonly date: string; readonly level: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | …;
check: (checks_0: Check<{ readonly annotations: { readonly [x: string]: string }; readonly spans: ReadonlyArray<string>; readonly date: string; readonly level: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'; readonly mes…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly date: Schema.String; readonly level: Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>; readonly message: Schema.String; readonly cause: Schema.optional…;
make: (input: { readonly annotations: { readonly [x: string]: string }; readonly spans: ReadonlyArray<string>; readonly date: string; readonly level: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'; readonly message: str…;
makeOption: (input: { readonly annotations: { readonly [x: string]: string }; readonly spans: ReadonlyArray<string>; readonly date: string; readonly level: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'; readonly message: str…;
makeEffect: (input: { readonly annotations: { readonly [x: string]: string }; readonly spans: ReadonlyArray<string>; readonly date: string; readonly level: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'; readonly message: str…;
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; <…;
}
LogEntrySchema = import SchemaSchema.function Struct<{
readonly date: Schema.String;
readonly level: Schema.Literals<readonly ["All", "Fatal", "Error", "Warn", "Info", "Debug", "Trace", "None"]>;
readonly message: Schema.String;
readonly cause: Schema.optional<Schema.String>;
readonly annotations: Schema.$Record<Schema.String, Schema.String>;
readonly spans: Schema.$Array<Schema.String>;
}>(fields: {
readonly date: Schema.String;
readonly level: Schema.Literals<readonly ["All", "Fatal", "Error", "Warn", "Info", "Debug", "Trace", "None"]>;
readonly message: Schema.String;
readonly cause: Schema.optional<Schema.String>;
readonly annotations: Schema.$Record<Schema.String, Schema.String>;
readonly spans: Schema.$Array<Schema.String>;
}): 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({
date: Schema.String(property) date: {
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<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; <…;
}
date: 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<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,
level: Schema.Literals<
readonly [
"All",
"Fatal",
"Error",
"Warn",
"Info",
"Debug",
"Trace",
"None"
]
>
(property) level: {
literals: L;
members: { readonly [K in keyof L]: Literal<L[K]>; };
mapMembers: (f: (members: readonly [Schema.Literal<'All'>, Schema.Literal<'Fatal'>, Schema.Literal<'Error'>, Schema.Literal<'Warn'>, Schema.Literal<'Info'>, Schema.Literal<'Debug'>, Schema.Literal<'Trace'>, Schema.Literal<'None'>]) => To) => Schema.Un…;
pick: (literals: L2) => Schema.Literals<L2>;
transform: (to: L2) => Schema.Union<readonly [Schema.decodeTo<Schema.Literal<L2['0']>, Schema.Literal<'All'>, never, never>, Schema.decodeTo<Schema.Literal<L2['1']>, Schema.Literal<'Fatal'>, never, never>, Schema.decodeTo<Schema.Literal<L2['2']>, Sch…;
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', readonly []>) => Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>;
annotateKey: (annotations: Schema.Annotations.Key<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>) => Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>;
check: (checks_0: Check<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>, ...checks: Array<Check<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>>) => Schema.Literals<readonly ['All', 'Fatal', 'Er…;
rebuild: (ast: Union<Literal>) => Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>;
make: (input: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', options?: Schema.MakeOptions) => 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None';
makeOption: (input: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', options?: Schema.MakeOptions) => Option<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>;
makeEffect: (input: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', options?: Schema.MakeOptions) => Effect.Effect<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', 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; <…;
}
level: const logLevelSchema: Schema.Literals<
readonly [
"All",
"Fatal",
"Error",
"Warn",
"Info",
"Debug",
"Trace",
"None"
]
>
const logLevelSchema: {
literals: L;
members: { readonly [K in keyof L]: Literal<L[K]>; };
mapMembers: (f: (members: readonly [Schema.Literal<'All'>, Schema.Literal<'Fatal'>, Schema.Literal<'Error'>, Schema.Literal<'Warn'>, Schema.Literal<'Info'>, Schema.Literal<'Debug'>, Schema.Literal<'Trace'>, Schema.Literal<'None'>]) => To) => Schema.Un…;
pick: (literals: L2) => Schema.Literals<L2>;
transform: (to: L2) => Schema.Union<readonly [Schema.decodeTo<Schema.Literal<L2['0']>, Schema.Literal<'All'>, never, never>, Schema.decodeTo<Schema.Literal<L2['1']>, Schema.Literal<'Fatal'>, never, never>, Schema.decodeTo<Schema.Literal<L2['2']>, Sch…;
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', readonly []>) => Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>;
annotateKey: (annotations: Schema.Annotations.Key<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>) => Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>;
check: (checks_0: Check<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>, ...checks: Array<Check<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>>) => Schema.Literals<readonly ['All', 'Fatal', 'Er…;
rebuild: (ast: Union<Literal>) => Schema.Literals<readonly ['All', 'Fatal', 'Error', 'Warn', 'Info', 'Debug', 'Trace', 'None']>;
make: (input: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', options?: Schema.MakeOptions) => 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None';
makeOption: (input: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', options?: Schema.MakeOptions) => Option<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None'>;
makeEffect: (input: 'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', options?: Schema.MakeOptions) => Effect.Effect<'All' | 'Fatal' | 'Error' | 'Warn' | 'Info' | 'Debug' | 'Trace' | 'None', 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; <…;
}
logLevelSchema,
message: Schema.String(property) message: {
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<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; <…;
}
message: 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<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,
cause: Schema.optional<Schema.String>(property) cause: {
Rebuild: optional<S>;
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<string | undefined, readonly []>) => Schema.optional<Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<string | undefined>) => Schema.optional<Schema.String>;
check: (checks_0: Check<string | undefined>, ...checks: Array<Check<string | undefined>>) => Schema.optional<Schema.String>;
rebuild: (ast: Union<String | Undefined>) => Schema.optional<Schema.String>;
make: (input: string | undefined, options?: Schema.MakeOptions) => string | undefined;
makeOption: (input: string | undefined, options?: Schema.MakeOptions) => Option<string | undefined>;
makeEffect: (input: string | undefined, options?: Schema.MakeOptions) => Effect.Effect<string | undefined, 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; <…;
}
cause: import SchemaSchema.const optional: optionalLambda
<Schema.String>(self: Schema.String) => Schema.optional<Schema.String>
Type-level representation returned by
optional
.
Marks a struct field as optional, allowing the key to be absent or
undefined.
Details
The resulting property may be absent or explicitly set to undefined.
Equivalent to optionalKey(UndefinedOr(S)).
Use
optionalKey
instead if you want exact optional semantics (absent
only, not undefined).
Example (Defining an optional field accepting undefined)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optional(Schema.Number)
})
// { readonly name: string; readonly age?: number | undefined }
type Person = typeof schema.Type
optional(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<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),
annotations: Schema.$Record<
Schema.String,
Schema.String
>
(property) annotations: {
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]: string; }, readonly []>) => Schema.$Record<Schema.String, Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: string }>) => Schema.$Record<Schema.String, Schema.String>;
check: (checks_0: Check<{ readonly [x: string]: string }>, ...checks: Array<Check<{ readonly [x: string]: string }>>) => Schema.$Record<Schema.String, Schema.String>;
rebuild: (ast: Objects) => Schema.$Record<Schema.String, Schema.String>;
make: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => { readonly [x: string]: string };
makeOption: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => Option<{ readonly [x: string]: string }>;
makeEffect: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly [x: string]: 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; <…;
}
annotations: import SchemaSchema.function Record<Schema.String, Schema.String>(key: Schema.String, value: Schema.String, options?: {
readonly keyValueCombiner: {
readonly decode?: Combiner<readonly [string, string]> | undefined;
readonly encode?: Combiner<readonly [string, string]> | undefined;
};
} | undefined): Schema.$Record<Schema.String, Schema.String>
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<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 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<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),
spans: Schema.$Array<Schema.String>(property) spans: {
Type: ReadonlyArray<S["Type"]>;
Encoded: ReadonlyArray<S["Encoded"]>;
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: ReadonlyArray<S["Iso"]>;
value: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<ReadonlyArray<string>, readonly []>) => Schema.$Array<Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<ReadonlyArray<string>>) => Schema.$Array<Schema.String>;
check: (checks_0: Check<ReadonlyArray<string>>, ...checks: Array<Check<ReadonlyArray<string>>>) => Schema.$Array<Schema.String>;
rebuild: (ast: Arrays) => Schema.$Array<Schema.String>;
make: (input: ReadonlyArray<string>, options?: Schema.MakeOptions) => ReadonlyArray<string>;
makeOption: (input: ReadonlyArray<string>, options?: Schema.MakeOptions) => Option<ReadonlyArray<string>>;
makeEffect: (input: ReadonlyArray<string>, options?: Schema.MakeOptions) => Effect.Effect<ReadonlyArray<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; <…;
}
spans: import SchemaSchema.Array<Schema.String>(self: Schema.String): Schema.$Array<Schema.String>
export Array
Defines a ReadonlyArray schema for a given element schema.
Example (Defining an array of strings)
import { Schema } from "effect"
const schema = Schema.Array(Schema.String)
const result = Schema.decodeUnknownSync(schema)(["a", "b", "c"])
console.log(result)
// [ 'a', 'b', 'c' ]
Array(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<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),
});