Skip to content

quickmodel / IQHistoryHandle

Interface: IQHistoryHandle ​

Public interface for a history handle attached to a model instance.

Access via instance.$qHistory. When history is disabled, the handle is a shared no-op object (value is always empty, all methods are no-ops).

Example ​

typescript
@Quick({}, { history: { enabled: true } })
class ContractModel extends QModel<IContract> { ... }

const contract = new ContractModel({ name: 'v1' });
contract.$qPatch({ name: 'v2' });

const history = contract.$qHistory;
history.value;
// → [{ method: 'patch', at: Date, changes: { name: { from: 'v1', to: 'v2' } } }]

See ​

Methods ​

clear() ​

clear(): void

Clears all recorded entries. Does not affect isActive.

Returns ​

void


configure() ​

configure(config): void

Applies runtime configuration overrides (e.g. adjust maxEntries).

Parameters ​

config ​

Partial<IQHistoryConfig>

Returns ​

void


start() ​

start(): void

Starts (or resumes) recording. No-op if already active.

Returns ​

void


stop() ​

stop(): void

Pauses recording. Existing entries are preserved. No-op if already inactive.

Returns ​

void

Properties ​

isActive ​

readonly isActive: boolean

true while recording is active.


recordMode ​

readonly recordMode: "operation" | "field"

Recording granularity — 'operation' (default) or 'field'.


value ​

readonly value: IQHistoryEntry[]

Frozen array of all recorded mutation entries (oldest first).