/** * 64-bit unsigned integer stored as a string in base-10. * * Not sortable as a string. */ export type OpId = string; /** * Type of local change. */ export declare enum UpdateType { /** Insert or replace existing row. All non-null columns are included in the data. Generated by INSERT statements. */ PUT = "PUT", /** Update existing row. Contains the id, and value of each changed column. Generated by UPDATE statements. */ PATCH = "PATCH", /** Delete existing row. Contains the id. Generated by DELETE statements. */ DELETE = "DELETE" } export type CrudEntryJSON = { id: string; data: string; tx_id?: number; }; /** * The output JSON seems to be a third type of JSON, not the same as the input JSON. */ type CrudEntryOutputJSON = { op_id: number; op: UpdateType; type: string; id: string; tx_id?: number; data?: Record; old?: Record; metadata?: string; }; /** * A single client-side change. */ export declare class CrudEntry { /** * Auto-incrementing client-side id. */ clientId: number; /** * ID of the changed row. */ id: string; /** * Type of change. */ op: UpdateType; /** * Data associated with the change. */ opData?: Record; /** * For tables where the `trackPreviousValues` option has been enabled, this tracks previous values for * `UPDATE` and `DELETE` statements. */ previousValues?: Record; /** * Table that contained the change. */ table: string; /** * Auto-incrementing transaction id. This is the same for all operations within the same transaction. */ transactionId?: number; /** * Client-side metadata attached with this write. * * This field is only available when the `trackMetadata` option was set to `true` when creating a table * and the insert or update statement set the `_metadata` column. */ metadata?: string; static fromRow(dbRow: CrudEntryJSON): CrudEntry; constructor(clientId: number, op: UpdateType, table: string, id: string, transactionId?: number, opData?: Record, previousValues?: Record, metadata?: string); /** * Converts the change to JSON format. */ toJSON(): CrudEntryOutputJSON; equals(entry: CrudEntry): boolean; /** * The hash code for this object. * @deprecated This should not be necessary in the JS SDK. * Use the @see CrudEntry#equals method instead. * TODO remove in the next major release. */ hashCode(): string; /** * Generates an array for use in deep comparison operations */ toComparisonArray(): (string | number | Record | undefined)[]; } export {};