Overview

I18n io


Table of contents


MessageTypeParam (interface)

Signature

interface MessageTypeParam {
  message: MonidI18N
  type: t.Type<A, O, I>
}

Added in v0.2.0

EncodeMessage (type alias)

Signature

export type EncodeMessage = {
  _kind: 'messageType'
  message: MonidI18N
}

Added in v0.2.0

MessageType (type alias)

Signature

export type MessageType<A, O = A, I = unknown> = t.Type<A, O, I> & EncodeMessage

Added in v0.2.0

MessageValue (type alias)

Signature

export type MessageValue = {
  _kind: 'message'
  messages: Array<MessageInfo>
}

Added in v0.2.0

Int (constant)

Signature


export const Int: MessageType<t.Branded<number, t.IntBrand>, number, unknown> = ...

Added in v0.2.0

boolean (constant)

Signature


export const boolean: MessageType<boolean, boolean, unknown> = ...

Added in v0.2.0

dateFromISOString (constant)

Signature


export const dateFromISOString: MessageType<Date, string, unknown> = ...

Added in v0.2.0

dateFromNumber (constant)

Signature


export const dateFromNumber: MessageType<Date, number, unknown> = ...

Added in v0.2.0

dateFromUnixTime (constant)

Signature


export const dateFromUnixTime: MessageType<Date, number, unknown> = ...

Added in v0.2.0

email (constant)

Signature


export const email: MessageType<t.Branded<string, t.EmailBrand>, string, unknown> = ...

Added in v0.2.0

ipv4 (constant)

Signature


export const ipv4: MessageType<t.Branded<string, t.IpV4Brand>, string, unknown> = ...

Added in v0.2.0

ipv6 (constant)

Signature


export const ipv6: MessageType<t.Branded<string, t.IpV6Brand>, string, unknown> = ...

Added in v0.2.0

nonEmptyString (constant)

Signature


export const nonEmptyString: MessageType<t.Branded<string, t.NonEmptyStringBrand>, string, unknown> = ...

Added in v0.2.0

number (constant)

Signature


export const number: MessageType<number, number, unknown> = ...

Added in v0.2.0

string (constant)

Signature


export const string: MessageType<string, string, unknown> = ...

Added in v0.2.0

url (constant)

Signature


export const url: MessageType<t.Branded<string, t.UrlBrand>, string, unknown> = ...

Added in v0.2.0

uuid (constant)

Signature


export const uuid: MessageType<t.Branded<string, t.UUIDBrand>, string, unknown> = ...

Added in v0.2.0

void1 (constant)

Signature


export const void1: MessageType<void, void, unknown> = ...

array (function)

Signature


export const array = <C extends t.Mixed>(codec: C, name?: string) => ...

Added in v0.2.0

failMessage (function)

Signature


export const failMessage = <T>(messages: Array<MessageInfo>, context: t.Context, message?: string | undefined) => ...

Added in v0.2.0

literal (function)

Signature


export const literal = <V extends string | number | boolean>(value: V, name?: string) => ...

Added in v0.2.0

nonEmptyArray (function)

Signature


export const nonEmptyArray = <C extends t.Mixed>(codec: C, name?: string) => ...

Added in v0.2.0

numberMaxValue (function)

Signature


export const numberMaxValue = (value: number) => ...

Added in v0.2.0

numberMinValue (function)

Signature


export const numberMinValue = (value: number) => ...

Added in v0.2.0

show (function)

Parse Erros(contains message) to MonidI18N

Signature


export const show = (as: t.Errors): MonidI18N => p => ...

Added in v0.2.0

stringMatch (function)

Signature


export const stringMatch = (value: RegExp) => ...

Added in v0.2.0

stringMaxLength (function)

Signature


export const stringMaxLength = (value: number) => ...

Added in v0.2.0

stringMinLength (function)

Signature


export const stringMinLength = (value: number) => ...

Added in v0.2.0

withMessage (function)

Add message to a type

Added in v0.2.0

int (export)

Signature


MessageType<t.Branded<number, t.IntBrand>, number, unknown>

void (export)

Signature


MessageType<void, void, unknown>