Skip to content

Commit a3b9571

Browse files
committed
fix(ts): properly type Object#set
1 parent 6c00bf6 commit a3b9571

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/object.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -655,17 +655,9 @@ module.exports = function(AV) {
655655
* gameTurn.set({
656656
* player: player1,
657657
* diceRoll: 2
658-
* }, {
659-
* error: function(gameTurnAgain, error) {
660-
* // The set failed validation.
661-
* }
662658
* });
663659
*
664-
* game.set("currentPlayer", player2, {
665-
* error: function(gameTurnAgain, error) {
666-
* // The set failed validation.
667-
* }
668-
* });
660+
* game.set("currentPlayer", player2);
669661
*
670662
* game.set("finished", true);
671663
*

storage.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class File extends BaseObject {
165165

166166
destroy(options?: AuthOptions): Promise<void>;
167167
fetch(fetchOptions?: FetchOptions, options?: AuthOptions): Promise<this>;
168-
get(attr: string): any;
168+
get(key: string): any;
169169
getACL(): ACL;
170170
metaData(): any;
171171
metaData(metaKey: string): any;
@@ -175,6 +175,7 @@ export class File extends BaseObject {
175175
url(): string;
176176
save(options?: FileSaveOptions): Promise<this>;
177177
set(key: string, value: any): this;
178+
set(data: { [key: string]: any }): this;
178179
setACL(acl: ACL): this;
179180
setUploadHeader(key: string, value: string): this;
180181
size(): any;
@@ -331,6 +332,7 @@ export class Object extends BaseObject {
331332
options?: Object.SaveOptions<this>
332333
): Promise<this>;
333334
set(key: string, value: any, options?: Object.SetOptions): this;
335+
set(data: { [key: string]: any }, options?: Object.SetOptions): this;
334336
setACL(acl: ACL, options?: Object.SetOptions): this;
335337
unset(attr: string, options?: Object.SetOptions): this;
336338
validate(attrs: any): any;

0 commit comments

Comments
 (0)