Skip to main content Link Search Menu Expand Document (external link)

Schema.ts overview

An extension to the effect/Schema module that adds Schema instances for number and date formatting and parsing and implements new brands


Exports Grouped by Category


Instances

DateTime

A Schema that represents a MDateTime

Signature

declare const DateTime: Schema.Codec<MDateTime.Type, MDateTime.Type, never, never>

Source

Utils

BigDecimalFromString

A Schema that transforms a string into a BigDecimal according to format. Read documentation of module NumberBase10Format.ts for more details

Signature

declare const BigDecimalFromString: (format: MNumberBase10Format.Type) => Schema.Codec<BigDecimal.BigDecimal, string>

Source

DateFromDateTime

A Schema that transforms a MDateTime into a Javascript Date. Upon encoding, the MDateTime object is created with the default timeZoneOffset of the machine this code is running on

Signature

declare const DateFromDateTime: Schema.Codec<Date, MDateTime.Type, never, never>

Source

DateFromString

A Schema that transforms a string into a Javascript Date according to the given dateTimeFormat and dateTimeContext. Read documentation of module DateTime.ts for more details.

Signature

declare const DateFromString: (
  dateTimeFormat: MDateTimeFormat.Type,
  dateTimeContext: MDateTimeContext.Type
) => Schema.Codec<Date, string>

Source

DateTimeFromString

A Schema that transforms a string into a MDateTime according to the given dateTimeFormat and dateTimeContext. Read documentation of module DateTime.ts for more details.

Signature

declare const DateTimeFromString: (
  dateTimeFormat: MDateTimeFormat.Type,
  dateTimeContext: MDateTimeContext.Type
) => Schema.Codec<MDateTime.Type, string>

Source

DateTimeZonedFromDateTime

A Schema that transforms a MDateTime into an effect/DateTime.Zoned. Both objects share the same time zone offset

Signature

declare const DateTimeZonedFromDateTime: Schema.Codec<DateTime.Zoned, MDateTime.Type, never, never>

Source

DateTimeZonedFromString

A Schema that transforms a string into an effect/DateTime.Zoned according to the given dateTimeFormat and dateTimeContext. Read documentation of module DateTime.ts for more details.

Signature

declare const DateTimeZonedFromString: (
  dateTimeFormat: MDateTimeFormat.Type,
  dateTimeContext: MDateTimeContext.Type
) => Schema.Codec<DateTime.Zoned, string>

Source

FiniteFromString

A Schema that transforms a string into a number according to format. Read documentation of module NumberBase10Format.ts for more details

Signature

declare const FiniteFromString: (format: MNumberBase10Format.Type) => Schema.Codec<number, string>

Source

Template

A Schema that transforms a string into an object according to template. Read documentation of module Template.ts for more details

Signature

declare const Template: <PlaceholderTypes extends MTypes.Object>(
  template: MTemplate.Type<PlaceholderTypes>
) => Schema.Codec<PlaceholderTypes, string>

Source