import * as Y from "yjs"; // // declare module "yjs" { // class YDoc extends Y.Doc { // getMap(key?: string | undefined): YTMap // } // } // Y.Doc.prototype.getTMap = function (key: string):YTMap { // return this.getMap(key) as unknown as YTMap; // } export type YTMap = Y.Map> = { [Property in keyof Omit]: TMap[Property]; } & { toJSON(): T; get(key: TKey): T[TKey]; set(key: TKey, value: TValue): TValue; } export function t(map: Y.Map): YTMap { return map as unknown as YTMap; }