Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

Readonly root

root: Field

Readonly schema

schema: Schema

Static displayName

displayName: string

The name provided to Record(values, name) can be accessed with displayName.

Accessors

Private __form_blueprint__

  • get __form_blueprint__(): boolean

kind

  • get kind(): string

Methods

[iterator]

  • Returns IterableIterator<[keyof BlueprintRecord, Field | Schema]>

asImmutable

  • see

    Map#asImmutable

    Returns Blueprint

asMutable

  • see

    Map#asMutable

    Returns Blueprint

clear

  • Returns a new instance of this Record type with all values set to their default values.

    Returns Blueprint

delete

  • Returns a new instance of this Record type with the value for the specific key set to its default value.

    alias

    remove

    Type parameters

    Parameters

    • key: K

    Returns Blueprint

deleteIn

  • deleteIn(keyPath: Iterable<unknown>): Blueprint
  • alias

    removeIn

    Parameters

    • keyPath: Iterable<unknown>

    Returns Blueprint

equals

  • equals(other: unknown): boolean
  • Parameters

    • other: unknown

    Returns boolean

get

  • get<K>(key: K, notSetValue?: unknown): BlueprintRecord[K]
  • get<T>(key: string, notSetValue: T): T
  • Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.

    If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.

    Type parameters

    Parameters

    • key: K
    • Optional notSetValue: unknown

    Returns BlueprintRecord[K]

  • Type parameters

    • T

    Parameters

    • key: string
    • notSetValue: T

    Returns T

getField

  • getField(key: string): undefined | Field
  • Get a field in a blueprint by key. The key can be complex to get deep values (eg. a[0].b.c).

    Parameters

    • key: string

      A field key.

    Returns undefined | Field

getIn

  • getIn(keyPath: Iterable<unknown>): unknown
  • Parameters

    • keyPath: Iterable<unknown>

    Returns unknown

has

  • has(key: string): key is "root" | "schema"
  • Parameters

    • key: string

    Returns key is "root" | "schema"

hasIn

  • hasIn(keyPath: Iterable<unknown>): boolean
  • Parameters

    • keyPath: Iterable<unknown>

    Returns boolean

hashCode

  • hashCode(): number
  • Returns number

join

  • Merges blueprints' root fields into this one and returns a new blueprint. Blueprints' root fields are merged left-to-right, with the right-most blueprint replacing data in those left of it. The blueprints' schemas are left untouched, and the schema of the blueprint that join is called on is used to perform the join.

    Parameters

    Returns Blueprint

merge

  • Parameters

    • Rest ...collections: (Partial<BlueprintRecord> | Iterable<[string, unknown]>)[]

    Returns Blueprint

mergeDeep

  • Parameters

    • Rest ...collections: (Partial<BlueprintRecord> | Iterable<[string, unknown]>)[]

    Returns Blueprint

mergeDeepIn

  • mergeDeepIn(keyPath: Iterable<unknown>, ...collections: unknown[]): Blueprint
  • Parameters

    • keyPath: Iterable<unknown>
    • Rest ...collections: unknown[]

    Returns Blueprint

mergeDeepWith

  • mergeDeepWith(merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, ...collections: (Partial<BlueprintRecord> | Iterable<[string, unknown]>)[]): Blueprint
  • Parameters

    • merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown
        • (oldVal: unknown, newVal: unknown, key: unknown): unknown
        • Parameters

          • oldVal: unknown
          • newVal: unknown
          • key: unknown

          Returns unknown

    • Rest ...collections: (Partial<BlueprintRecord> | Iterable<[string, unknown]>)[]

    Returns Blueprint

mergeIn

  • mergeIn(keyPath: Iterable<unknown>, ...collections: unknown[]): Blueprint
  • Parameters

    • keyPath: Iterable<unknown>
    • Rest ...collections: unknown[]

    Returns Blueprint

mergeWith

  • Parameters

    • merger: (oldVal: unknown, newVal: unknown, key: keyof BlueprintRecord) => unknown
        • Parameters

          Returns unknown

    • Rest ...collections: (Partial<BlueprintRecord> | Iterable<[string, unknown]>)[]

    Returns Blueprint

normalize

remove

  • Type parameters

    Parameters

    • key: K

    Returns Blueprint

removeIn

  • removeIn(keyPath: Iterable<unknown>): Blueprint
  • Parameters

    • keyPath: Iterable<unknown>

    Returns Blueprint

serialize

  • Convert this blueprint into an object that can be stringified or passed back to Blueprint.create().

    Internally, this is calling the blueprint's schema's serialize() on the blueprint's root field.

    Returns FieldCreate

set

setIn

  • setIn(keyPath: Iterable<unknown>, value: unknown): Blueprint
  • Parameters

    • keyPath: Iterable<unknown>
    • value: unknown

    Returns Blueprint

toJS

  • toJS(): { root: unknown; schema: unknown }
  • Deeply converts this Record to equivalent native JavaScript Object.

    Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.

    Returns { root: unknown; schema: unknown }

    • root: unknown
    • schema: unknown

toJSON

  • Shallowly converts this Record to equivalent native JavaScript Object.

    Returns BlueprintRecord

toObject

  • Shallowly converts this Record to equivalent JavaScript Object.

    Returns BlueprintRecord

toSeq

  • Returns Keyed<keyof BlueprintRecord, Field | Schema>

transform

  • transform(value?: any): any
  • Transforms a value according to the blueprint and schema rules. Value does not need to be provided, in which case default values are returned.

    Parameters

    • Optional value: any

      A value to transform.

    Returns any

update

updateIn

  • updateIn(keyPath: Iterable<unknown>, updater: (value: unknown) => unknown): Blueprint
  • Parameters

    • keyPath: Iterable<unknown>
    • updater: (value: unknown) => unknown
        • (value: unknown): unknown
        • Parameters

          • value: unknown

          Returns unknown

    Returns Blueprint

wasAltered

  • wasAltered(): boolean
  • see

    Map#wasAltered

    Returns boolean

withMutations

  • Note: Not all methods can be used on a mutable collection or within withMutations! Only set may be used mutatively.

    see

    Map#withMutations

    Parameters

    Returns Blueprint

Static create

Static isBlueprint

Generated using TypeDoc