Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(AV) {
/**
* Sets a hash of model attributes on the status data.
* @param {String} key The key to set.
* @param {} value The value to give it.
* @param {any} value The value to give it.
*/
set: function(key, value) {
this.data[key] = value;
Expand Down Expand Up @@ -383,7 +383,7 @@ module.exports = function(AV) {
},
/**
* Sets the querying inbox type.default is 'default'.
* @param {Object} type The inbox type.
* @param {String} type The inbox type.
* @return {AV.InboxQuery} Returns the query, so you can chain this call.
*/
inboxType: function(type) {
Expand Down
41 changes: 40 additions & 1 deletion storage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export class Events {
unbind(eventName?: string, callback?: Function, context?: any): Events;
}

declare type Queriable = Object | File;
declare type Queriable = Object | File | Status;

declare class BaseQuery<T extends Queriable> extends BaseObject {
className: string;
Expand Down Expand Up @@ -1495,6 +1495,45 @@ export namespace Cloud {
function getServerDate(): Promise<Date>;
}

export class Status {
inboxType: string;
constructor(imageUrl?: string | null, message?: string | null);
constructor(data: Record<string, any>);
static sendStatusToFollowers(
status: Status,
options?: AuthOptions
): Promise<Status>;
static sendPrivateStatus(
status: Status,
target: string,
options?: AuthOptions
): Promise<Status>;
static countUnreadStatuses(
owner: User,
inboxType?: string,
options?: AuthOptions
): Promise<{ total: number; unread: number }>;
static resetUnreadCount(
owner: User,
inboxType?: string,
options?: AuthOptions
): Promise<any>;
static statusQuery(source?: User): Query<Object>;
static inboxQuery(owner?: User, inboxType?: string): InboxQuery<Status>;
get(key: string): any;
set(key: string, value: any): this;
destroy(options?: AuthOptions): Promise<any>;
toObject(): Object;
send(options?: AuthOptions): Promise<this>;
}

export class InboxQuery<T extends Queriable> extends Query<T> {
sinceId(id: number): this;
maxId(id: number): this;
owner(owner: User): this;
inboxType(type: string): this;
}

interface ServerURLs {
api?: string;
engine?: string;
Expand Down