Skip to content

Encoded

const Encoded: Schema.Struct<{ args: typeof Schema.Any; clientId: typeof Schema.String; name: typeof Schema.String; parentSeqNum: Schema.Struct<{ client: Schema.BrandSchema<number & Brand, number, never>; global: Schema.BrandSchema<number & Brand, number, never>; rebaseGeneration: typeof Schema.Int; }> & object; seqNum: Schema.Struct<{ client: Schema.BrandSchema<number & Brand, number, never>; global: Schema.BrandSchema<number & Brand, number, never>; rebaseGeneration: typeof Schema.Int; }> & object; sessionId: typeof Schema.String; }>

Defined in: packages/@livestore/common/dist/schema/LiveStoreEvent/client.d.ts:49

Effect Schema for client events with encoded args.

// Confirmed event (client=0)
const event: LiveStoreEvent.Client.Encoded = {
name: 'todoCreated-v1',
args: { id: 'abc', text: 'Buy milk' },
seqNum: { global: 5, client: 0, rebaseGeneration: 0 },
parentSeqNum: { global: 4, client: 0, rebaseGeneration: 0 },
clientId: 'client-xyz',
sessionId: 'session-123'
}
// Pending local event (client=1, not yet synced)
const pending: LiveStoreEvent.Client.Encoded = {
...event,
seqNum: { global: 5, client: 1, rebaseGeneration: 0 }, // e5.1
}