YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
https://syncedstore.org
MIT License
1.69k stars 51 forks source link

How can I use Y.Map when I init the store? #128

Closed PeterChen1997 closed 4 months ago

PeterChen1997 commented 4 months ago

Thx for this good repo! I found that I can't use Y.Map when I init the store. Am I doing wrong?

export declare type MappedTypeDescription<T extends DocTypeDescription> = {
    readonly [P in keyof T]: T[P] extends "xml" ? Y.XmlFragment : T[P] extends "text" ? Y.Text : T[P] extends Array<any> ? T[P] : T[P] extends object ? Partial<T[P]> : never;
};

the object cannot be auto parsed as Y.Map

PeterChen1997 commented 4 months ago

I got it. Just use the obj[key] will be fine. If doc notices that will be great!