Skip to content

Commit

Permalink
fix yjs importing warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hxhxhx88 committed Mar 8, 2024
1 parent 99fac10 commit 2331b60
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 384 deletions.
1 change: 1 addition & 0 deletions app/frontend/src/common/yjs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {setupWSConnection, setPersistence} from 'y-websocket/bin/utils';
10 changes: 10 additions & 0 deletions app/frontend/src/common/yjs/y-websocket.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
declare module 'y-websocket/bin/utils' {
import type {Doc} from 'yjs';

export function setupWSConnection(conn: unknown, req: http.IncomingMessage, doc: {docName: string}): void;

export function setPersistence(persistence: {
bindState: (docName: string, ydoc: Doc) => Promise<void>;
writeState: (docName: string, ydoc: Doc) => Promise<void>;
}): void;
}
Loading

0 comments on commit 2331b60

Please sign in to comment.