From 089d05e3a09603e249b4717ad8c6ce26335a18f1 Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Thu, 16 Nov 2023 22:50:22 +0800 Subject: [PATCH] refactor: expose frontiers type --- loro-js/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/loro-js/src/index.ts b/loro-js/src/index.ts index 5b3dd517..165d8a64 100644 --- a/loro-js/src/index.ts +++ b/loro-js/src/index.ts @@ -1,5 +1,5 @@ export * from "loro-wasm"; -import { Delta } from "loro-wasm"; +import { Delta, OpId } from "loro-wasm"; import { PrelimText, PrelimList, PrelimMap } from "loro-wasm"; import { ContainerID, @@ -55,6 +55,7 @@ export type Value = export type Container = LoroList | LoroMap | LoroText | LoroTree; export type Prelim = PrelimList | PrelimMap | PrelimText; +export type Frontiers = OpId[]; /** * Represents a path to identify the exact location of an event's target. @@ -110,8 +111,8 @@ export type MapDiff = { export type TreeDiff = { type: "tree"; diff: - | { target: TreeID; action: "create" | "delete" } - | { target: TreeID; action: "move"; parent: TreeID }; + | { target: TreeID; action: "create" | "delete" } + | { target: TreeID; action: "move"; parent: TreeID }; }; export type Diff = ListDiff | TextDiff | MapDiff | TreeDiff;