DetectedChange<
T> = {entity_id:string;schema:LixSchemaDefinition;snapshot_content:T|null; }
A detected change that lix ingests in to the database.
snapshot is undefined, the change is considered to be a deletion.schema type can be narrowed by providing a change schema.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 Parameter | Default type |
|---|---|
T | any |
entity_id:
string
schema:
LixSchemaDefinition
snapshot_content:
T|null
The change is considered a deletion if snapshot_content is null.