From e48415a72df4eec7a26062065a394f97218c77d9 Mon Sep 17 00:00:00 2001 From: John Palgut Date: Thu, 20 Aug 2015 15:23:11 -0500 Subject: [PATCH] Add a type definition for HTTPOptions The method [Parse.Cloud.httpRequest](https://parse.com/docs/js/api/symbols/Parse.Cloud.html#.httpRequest) takes a [HTTPOptions](https://parse.com/docs/js/api/symbols/Parse.Cloud.HTTPOptions.html) options object and not a ParseDefaultOptions object. I've included an initial interface definition for HTTPOptions and updated the httpRequest method definition to match --- parse/parse.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index cb4fa8b2b3..9322188af1 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -23,6 +23,17 @@ declare module Parse { useMasterKey?: boolean; } + interface HTTPOptions { + url: string; + body?: any; + error?: Function; + followRedirects?: boolean; + headers?: any; + method?: string; + params?: any; + success?: Function; + } + interface CollectionOptions { model?: Object; query?: Query; @@ -796,7 +807,7 @@ declare module Parse { function beforeDelete(arg1: any, func?: (request: BeforeDeleteRequest, response: BeforeDeleteResponse) => void): void; function beforeSave(arg1: any, func?: (request: BeforeSaveRequest, response: BeforeSaveResponse) => void): void; function define(name: string, func?: (request: FunctionRequest, response: FunctionResponse) => void): void; - function httpRequest(options: ParseDefaultOptions): Promise; + function httpRequest(options: HTTPOptions): Promise; function job(name: string, func?: (request: JobRequest, status: JobStatus) => void): HttpResponse; function run(name: string, data?: any, options?: ParseDefaultOptions): Promise; function useMasterKey(): void;