Class ArrayNode<TSchema, TContext, TItem>

Type parameters

  • TSchema

  • TContext

  • TItem

Hierarchy

Index

Properties

data

data: IArraySchema<TSchema>

schemaVersion

schemaVersion: number

Methods

beforeLoad

  • beforeLoad(context: TContext): Promise<void>

fromJSON

getItems

  • getItems(context: TContext): TItem[]

load

  • load(context: TContext): Promise<void>

loadItem

  • loadItem(item: TSchema, context: TContext): Promise<function | void>

migrate

  • migrate(version: number): void
  • Nodes that have evolved from schema version 1 should override this method. This function is responsible for changing this.data to match the current schema.

    Parameters

    • version: number

      The old version number

    Returns void

save

  • save(context: TContext): Promise<void>

saveItem

  • saveItem(item: TItem, context: TContext): Promise<TSchema>

toJSON