mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-22 21:07:43 +00:00
refactor: refine ts type (#322)
This commit is contained in:
parent
a32b75ad3b
commit
ce992b9de0
1 changed files with 3 additions and 3 deletions
|
@ -187,7 +187,7 @@ declare module "loro-wasm" {
|
|||
* const map = doc.getMap("map");
|
||||
* ```
|
||||
*/
|
||||
getMap<Key extends keyof T>(
|
||||
getMap<Key extends (keyof T) | ContainerID>(
|
||||
name: Key,
|
||||
): T[Key] extends LoroMap ? T[Key] : LoroMap;
|
||||
/**
|
||||
|
@ -204,7 +204,7 @@ declare module "loro-wasm" {
|
|||
* const list = doc.getList("list");
|
||||
* ```
|
||||
*/
|
||||
getList<Key extends keyof T>(
|
||||
getList<Key extends (keyof T) | ContainerID>(
|
||||
name: Key,
|
||||
): T[Key] extends LoroList ? T[Key] : LoroList;
|
||||
/**
|
||||
|
@ -221,7 +221,7 @@ declare module "loro-wasm" {
|
|||
* const tree = doc.getTree("tree");
|
||||
* ```
|
||||
*/
|
||||
getTree<Key extends keyof T>(
|
||||
getTree<Key extends (keyof T) | ContainerID>(
|
||||
name: Key,
|
||||
): T[Key] extends LoroTree ? T[Key] : LoroTree;
|
||||
getText(key: string | ContainerID): LoroText;
|
||||
|
|
Loading…
Reference in a new issue