Skip to content

Commit

Permalink
Update parse.d.ts (DefinitelyTyped#10249)
Browse files Browse the repository at this point in the history
Alter options for Cloud.run and Query.each
  • Loading branch information
birkskyum authored and mhegazy committed Jul 24, 2016
1 parent 5e942d8 commit 96034d8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions parse/parse.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ declare namespace Parse {

interface SuccessFailureOptions extends SuccessOption, ErrorOption {
}

interface SessionTokenOption {
sessionToken?: string;
}

interface WaitOption {
/**
Expand Down Expand Up @@ -589,7 +593,7 @@ declare namespace Parse {
doesNotExist(key: string): Query;
doesNotMatchKeyInQuery(key: string, queryKey: string, query: Query): Query;
doesNotMatchQuery(key: string, query: Query): Query;
each<T>(callback: Function, options?: SuccessFailureOptions): Promise<T>;
each<T>(callback: Function, options?: Query.EachOptions): Promise<T>;
endsWith(key: string, suffix: string): Query;
equalTo(key: string, value: any): Query;
exists(key: string): Query;
Expand Down Expand Up @@ -619,6 +623,7 @@ declare namespace Parse {
}

namespace Query {
interface EachOptions extends SuccessFailureOptions, UseMasterKeyOption { }
interface CountOptions extends SuccessFailureOptions, UseMasterKeyOption { }
interface FindOptions extends SuccessFailureOptions, UseMasterKeyOption { }
interface FirstOptions extends SuccessFailureOptions, UseMasterKeyOption { }
Expand Down Expand Up @@ -885,9 +890,11 @@ declare namespace Parse {
function define(name: string, func?: (request: FunctionRequest, response: FunctionResponse) => void): void;
function httpRequest(options: HTTPOptions): Promise<HttpResponse>;
function job(name: string, func?: (request: JobRequest, status: JobStatus) => void): HttpResponse;
function run<T>(name: string, data?: any, options?: SuccessFailureOptions): Promise<T>;
function run<T>(name: string, data?: any, options?: RunOptions): Promise<T>;
function useMasterKey(): void;

interface RunOptions extends SuccessFailureOptions, UseMasterKeyOption, SessionTokenOption { }

/**
* To use this Cloud Module in Cloud Code, you must require 'buffer' in your JavaScript file.
*
Expand Down

0 comments on commit 96034d8

Please sign in to comment.