From c1f4dd9532bb3d05c2bbe53fd73a2abdd79c4944 Mon Sep 17 00:00:00 2001 From: Marc Woolfson Date: Thu, 1 Jun 2017 18:27:33 +0100 Subject: [PATCH] Added new optional parameters to StackTrace.report() function. (#16603) * Added new optional parameters to StackTrace.report() function. * [sinon-stub-promise] Replaced empty exports with sinon-wrapping function (#11880) --- types/sinon-stub-promise/index.d.ts | 3 ++- types/stacktrace-js/index.d.ts | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/types/sinon-stub-promise/index.d.ts b/types/sinon-stub-promise/index.d.ts index 30e24650ac..ad188d0fc4 100644 --- a/types/sinon-stub-promise/index.d.ts +++ b/types/sinon-stub-promise/index.d.ts @@ -16,4 +16,5 @@ declare module 'sinon' { } } -export {}; +declare function sinonStubPromise(sinon: sinon.SinonStatic): void; +export = sinonStubPromise; \ No newline at end of file diff --git a/types/stacktrace-js/index.d.ts b/types/stacktrace-js/index.d.ts index 4f0bac1635..9f3078b102 100644 --- a/types/stacktrace-js/index.d.ts +++ b/types/stacktrace-js/index.d.ts @@ -34,6 +34,10 @@ declare namespace StackTrace { isNative: boolean; toString(): string; } + + export interface RequestOptions { + headers: { [id: string]: string }; + } /** * Get a backtrace from invocation point. @@ -81,11 +85,13 @@ declare namespace StackTrace { /** * Given an Array of StackFrames, serialize and POST to given URL. * - * @param stackframes - Array[StackFrame] - * @param url - URL as String - * @return Promise + * @param {Array} stackframes - Previously wrapped Function + * @param {string} url - URL to POST stack JSON to + * @param {string} message - Optional Error message + * @param {Object} requestOptions - Request Headers {headers: {key: "value"}} + * @return {Promise} - Promise is resolved with response text from POST request. */ - export function report(stackframes: StackFrame[], url: string): Promise; + export function report(stackframes: StackFrame[], url: string, message?: string, requestOptions?: RequestOptions): Promise; } declare module "stacktrace-js" {