diff --git a/types/frisby/index.d.ts b/types/frisby/index.d.ts index 366a3998d7..9057edae6d 100644 --- a/types/frisby/index.d.ts +++ b/types/frisby/index.d.ts @@ -18,16 +18,27 @@ export import Joi = require("joi"); // #region Frisby FrisbySpec Methods // Reference file: https://github.com/vlucas/frisby/blob/master/src/frisby/spec.js + +// **************************************CHANGE LOG************************************** +// C.E.W. This is an attempt to create some sort of changelog for these types. +// If you make any changes, please try and note those changes in this section. +// If this section gets too long we can always trim it. +// ## 2018-03-05 +// ### Changed +// - Update _Frisbyspec.get_, _Frisbyspec.post_, _Frisbyspec.put_, _Frisbyspec.del_, _Frisbyspec.patch_, _Frisbyspec.fetch_ to allow _params_ to be optional. +// - Update _FrisbySpec.then_ to allow _onRejected_ to be optional. +// **************************************CHANGE LOG************************************** + export class FrisbySpec { constructor(...args: any[]); catch(onRejected?: (error: Error) => void): FrisbySpec; - del(url: string, params: {}): FrisbySpec; + del(url: string, params?: {}): FrisbySpec; done(doneFn: (...args: any[]) => void): FrisbySpec; expect(expectName: string, ...args: any[]): FrisbySpec; expectNot(expectName: string): FrisbySpec; - fetch(url: string, params: {}, options?: {}): FrisbySpec; + fetch(url: string, params?: {}, options?: {}): FrisbySpec; fromJSON(json: {}): FrisbySpec; - get(url: string, params: {}): FrisbySpec; + get(url: string, params?: {}): FrisbySpec; getBaseUrl(): string | boolean; inspectBody(): FrisbySpec; inspectHeaders(): FrisbySpec; @@ -37,12 +48,12 @@ export class FrisbySpec { inspectRequestHeaders(): FrisbySpec; inspectResponse(): FrisbySpec; inspectStatus(): FrisbySpec; - patch(url: string, params: {}): FrisbySpec; - post(url: string, params: {}): FrisbySpec; + patch(url: string, params?: {}): FrisbySpec; + post(url: string, params?: {}): FrisbySpec; promise(): Promise; - put(url: string, params: {}): FrisbySpec; + put(url: string, params?: {}): FrisbySpec; setup(opts: {}, replace: boolean): FrisbySpec; - then(onFulfilled: {} | ((...args: any[]) => void), onRejected: (...args: any[]) => void): FrisbySpec; + then(onFulfilled: {} | ((...args: any[]) => void), onRejected?: (...args: any[]) => void): FrisbySpec; timeout(timeout: number): number; use(fn: (...args: any[]) => void): FrisbySpec; static addExpectHandler(expectName: string, expectFn: (...args: any[]) => any): void;