mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-02 11:06:14 +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");
|
* const map = doc.getMap("map");
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
getMap<Key extends keyof T>(
|
getMap<Key extends (keyof T) | ContainerID>(
|
||||||
name: Key,
|
name: Key,
|
||||||
): T[Key] extends LoroMap ? T[Key] : LoroMap;
|
): T[Key] extends LoroMap ? T[Key] : LoroMap;
|
||||||
/**
|
/**
|
||||||
|
@ -204,7 +204,7 @@ declare module "loro-wasm" {
|
||||||
* const list = doc.getList("list");
|
* const list = doc.getList("list");
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
getList<Key extends keyof T>(
|
getList<Key extends (keyof T) | ContainerID>(
|
||||||
name: Key,
|
name: Key,
|
||||||
): T[Key] extends LoroList ? T[Key] : LoroList;
|
): T[Key] extends LoroList ? T[Key] : LoroList;
|
||||||
/**
|
/**
|
||||||
|
@ -221,7 +221,7 @@ declare module "loro-wasm" {
|
||||||
* const tree = doc.getTree("tree");
|
* const tree = doc.getTree("tree");
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
getTree<Key extends keyof T>(
|
getTree<Key extends (keyof T) | ContainerID>(
|
||||||
name: Key,
|
name: Key,
|
||||||
): T[Key] extends LoroTree ? T[Key] : LoroTree;
|
): T[Key] extends LoroTree ? T[Key] : LoroTree;
|
||||||
getText(key: string | ContainerID): LoroText;
|
getText(key: string | ContainerID): LoroText;
|
||||||
|
|
Loading…
Reference in a new issue