Type Alias: DetectedChange<T>

DetectedChange<T> = object

A detected change that lix ingests in to the database.

  • If the snapshot is undefined, the change is considered to be a deletion.
  • The schema type can be narrowed by providing a change schema.

Example

Type narrowing with a change schema:

const FooV1Schema = { key: "plugin-name-foo-v1", type: "json", schema: { type: "object", properties: { name: { type: "string" }, } } } as const satisfies ChangeSchema; const detectedChange: DetectedChange<typeof FooV1Schema> detectedChange.snapshot.name // string

Type Parameters

T

T = any

Properties

entity_id

entity_id: string


schema

schema: LixSchemaDefinition


snapshot_content

snapshot_content: T | null

The change is considered a deletion if snapshot_content is null.