diff --git a/loro-js/src/index.ts b/loro-js/src/index.ts index 9dfbd964..ae056662 100644 --- a/loro-js/src/index.ts +++ b/loro-js/src/index.ts @@ -179,10 +179,10 @@ export function isContainer(value: any): value is Container { */ export function getType( value: T, -): T extends LoroText ? "Text" - : T extends LoroMap ? "Map" - : T extends LoroTree ? "Tree" - : T extends LoroList ? "List" +): T extends LoroText ? "Text" + : T extends LoroMap ? "Map" + : T extends LoroTree ? "Tree" + : T extends LoroList ? "List" : "Json" { if (isContainer(value)) { return value.kind() as unknown as any; @@ -212,7 +212,7 @@ declare module "loro-wasm" { interface LoroList< T extends any[] = any[], > { - new (): LoroList; + new (): LoroList; insertContainer( pos: number, child: C, @@ -223,13 +223,13 @@ declare module "loro-wasm" { insert(pos: number, value: Value): void; delete(pos: number, len: number): void; subscribe(txn: Loro, listener: Listener): number; - getAttached(): undefined | LoroList; + getAttached(): undefined | LoroList; } interface LoroMap< T extends Record = Record, > { - new (): LoroMap; + new (): LoroMap; getOrCreateContainer( key: string, child: C, @@ -246,8 +246,8 @@ declare module "loro-wasm" { subscribe(txn: Loro, listener: Listener): number; } - interface LoroText { - new (): LoroText; + interface LoroText { + new (): LoroText; insert(pos: number, text: string): void; delete(pos: number, len: number): void; subscribe(txn: Loro, listener: Listener): number; @@ -256,7 +256,7 @@ declare module "loro-wasm" { interface LoroTree< T extends Record = Record, > { - new (): LoroTree; + new (): LoroTree; createNode(parent: TreeID | undefined): LoroTreeNode; move(target: TreeID, parent: TreeID | undefined): void; delete(target: TreeID): void;