Skip to content

Commit 2a4170b

Browse files
committed
fix(ts): properly type static methods of AV.Object
1 parent 7f2ba3c commit 2a4170b

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

storage.d.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,25 @@ export class Object extends BaseObject {
281281

282282
constructor(className?: string, options?: any);
283283
constructor(attributes?: string[], options?: any);
284-
static createWithoutData<T extends Object>(className: string, objectId: string): T;
285-
static extend(className: string, protoProps?: any, classProps?: any): any;
286-
static fetchAll<T>(list: Object[], options?: AuthOptions): Promise<T>;
287-
static destroyAll<T>(
288-
list: Object[],
289-
options?: Object.DestroyAllOptions
284+
static createWithoutData<T extends Object>(
285+
className: string,
286+
objectId: string
287+
): T;
288+
static createWithoutData<T extends Object>(
289+
className: new (...args: any[]) => T,
290+
objectId: string
291+
): T;
292+
static extend(className: string, protoProps?: any, classProps?: any): Object;
293+
static fetchAll<T extends Object>(
294+
list: T[],
295+
options?: AuthOptions
290296
): Promise<T>;
291-
static saveAll<T>(
297+
static destroyAll(
292298
list: Object[],
299+
options?: Object.DestroyAllOptions
300+
): Promise<void>;
301+
static saveAll<T extends Object>(
302+
list: T[],
293303
options?: Object.SaveAllOptions
294304
): Promise<T>;
295305
static register(klass: new (...args: any[]) => Object, name?: string): void;
@@ -504,7 +514,7 @@ export class Query<T extends Queriable> extends BaseQuery<T> {
504514
count(options?: AuthOptions): Promise<number>;
505515
descending(key: string): this;
506516
descending(key: string[]): this;
507-
destroyAll(options?: AuthOptions): Promise<undefined>;
517+
destroyAll(options?: AuthOptions): Promise<void>;
508518
doesNotExist(key: string): this;
509519
doesNotMatchKeyInQuery<U extends Queriable>(
510520
key: string,

0 commit comments

Comments
 (0)