Skip to content

ts 定义文件中 AV.Object.createWithoutData 重载版本的疑问 #566

@hustlzp

Description

@hustlzp

目前 ts 定义中有一个 AV.Object.createWithoutData 的重载版本

static createWithoutData<T extends Object>(
    className: new (...args: any[]) => T,
    objectId: string
): T;

但目前测试无法生成 T 的实例,而是普通的 AV.Object:

class Work extends AV.Object {
}

let work = AV.Object.createWithoutData(Work, "5cbdd7aea3180b7832e07f44")

console.log(work instanceof AV.Object)  // true
console.log(work instanceof Work)  // false

查看源码,貌似不支持这个用法。

不知是定义文件的问题,还是我哪个地方理解错误。

谢谢。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions