Skip to content

Commit f3025b3

Browse files
authored
feat(AV.Status): type definition (#672)
1 parent a2c1655 commit f3025b3

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

src/status.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = function(AV) {
5050
/**
5151
* Sets a hash of model attributes on the status data.
5252
* @param {String} key The key to set.
53-
* @param {} value The value to give it.
53+
* @param {any} value The value to give it.
5454
*/
5555
set: function(key, value) {
5656
this.data[key] = value;
@@ -383,7 +383,7 @@ module.exports = function(AV) {
383383
},
384384
/**
385385
* Sets the querying inbox type.default is 'default'.
386-
* @param {Object} type The inbox type.
386+
* @param {String} type The inbox type.
387387
* @return {AV.InboxQuery} Returns the query, so you can chain this call.
388388
*/
389389
inboxType: function(type) {

storage.d.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export class Events {
479479
unbind(eventName?: string, callback?: Function, context?: any): Events;
480480
}
481481

482-
declare type Queriable = Object | File;
482+
declare type Queriable = Object | File | Status;
483483

484484
declare class BaseQuery<T extends Queriable> extends BaseObject {
485485
className: string;
@@ -1495,6 +1495,45 @@ export namespace Cloud {
14951495
function getServerDate(): Promise<Date>;
14961496
}
14971497

1498+
export class Status {
1499+
inboxType: string;
1500+
constructor(imageUrl?: string | null, message?: string | null);
1501+
constructor(data: Record<string, any>);
1502+
static sendStatusToFollowers(
1503+
status: Status,
1504+
options?: AuthOptions
1505+
): Promise<Status>;
1506+
static sendPrivateStatus(
1507+
status: Status,
1508+
target: string,
1509+
options?: AuthOptions
1510+
): Promise<Status>;
1511+
static countUnreadStatuses(
1512+
owner: User,
1513+
inboxType?: string,
1514+
options?: AuthOptions
1515+
): Promise<{ total: number; unread: number }>;
1516+
static resetUnreadCount(
1517+
owner: User,
1518+
inboxType?: string,
1519+
options?: AuthOptions
1520+
): Promise<any>;
1521+
static statusQuery(source?: User): Query<Object>;
1522+
static inboxQuery(owner?: User, inboxType?: string): InboxQuery<Status>;
1523+
get(key: string): any;
1524+
set(key: string, value: any): this;
1525+
destroy(options?: AuthOptions): Promise<any>;
1526+
toObject(): Object;
1527+
send(options?: AuthOptions): Promise<this>;
1528+
}
1529+
1530+
export class InboxQuery<T extends Queriable> extends Query<T> {
1531+
sinceId(id: number): this;
1532+
maxId(id: number): this;
1533+
owner(owner: User): this;
1534+
inboxType(type: string): this;
1535+
}
1536+
14981537
interface ServerURLs {
14991538
api?: string;
15001539
engine?: string;

0 commit comments

Comments
 (0)