Skip to content

Commit 4649517

Browse files
committed
docs(json-crdt): ✏️ add Log JSDoc
1 parent bcb84a1 commit 4649517

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/json-crdt/log/Log.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ import {first, next} from 'sonic-forest/lib/util';
77
import type {Printable} from '../../util/print/types';
88
import type {JsonNode} from '../nodes/types';
99

10+
/**
11+
* The `Log` represents a history of patches applied to a JSON CRDT model. It
12+
* consists of: (1) a starting {@link Model} instance, (2) a list of {@link Patch} instances,
13+
* that can be applied to the starting model to reach the current state of the
14+
* document, and (3) the current state of the document, the `end` {@link Model}.
15+
*
16+
* The log can be used to replay the history of patches to any point in time,
17+
* from the "start" to the "end" of the log, and return the resulting {@link Model}
18+
* state.
19+
*/
1020
export class Log<N extends JsonNode = JsonNode<any>> implements Printable {
1121
/**
1222
* Creates a `PatchLog` instance from a newly JSON CRDT model. Checks if

0 commit comments

Comments
 (0)