Skip to content

CursorCodecOptionsSync

type CursorCodecOptionsSync<T> = object;

Defined in: cursor-codec.ts:34

The codec pipeline is two independently pluggable stages (signature-compatible with drizzle-cursor’s options, so the same overrides can be shared between both libraries):

data ──serializer──▶ string ──encoder──▶ token
data ◀───parser───── string ◀──decoder── token

All-sync stages variant — produces a fully synchronous CursorCodec.

Type Parameter Default type
T Record<string, unknown>
decoder?: (token) => string;

Defined in: cursor-codec.ts:42

Reverses encoder. Default: base64url decode.

Parameter Type
token string

string


encoder?: (str) => string;

Defined in: cursor-codec.ts:40

Makes the serialized string opaque/transport-safe. Default: base64url.

Parameter Type
str string

string


parser?: (raw) => T;

Defined in: cursor-codec.ts:38

Converts a string back to cursor data. Default: JSON.parse.

Parameter Type
raw string

T


reviveDates?: boolean;

Defined in: cursor-codec.ts:47

Revive top-level ISO-8601 date/datetime strings into Date objects on decode (matching drizzle-cursor’s parse behavior). Default: true.


serializer?: (data) => string;

Defined in: cursor-codec.ts:36

Converts cursor data to a string. Default: JSON.stringify.

Parameter Type
data T

string