From 243d9b9b2894685fce10c1913c9f6af1a9dd981f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iker=20P=C3=A9rez=20Brunelli?= Date: Mon, 10 Apr 2017 19:27:39 +0200 Subject: [PATCH] bugsnag-js: Provides its own types (#15621) * Add bugsnag-node types * Remove bugsnag-js * Update comment * Remove bugsnag-node typings --- notNeededPackages.json | 6 +++ types/bugsnag/bugsnag-tests.ts | 27 ---------- types/bugsnag/index.d.ts | 90 ---------------------------------- types/bugsnag/tsconfig.json | 22 --------- 4 files changed, 6 insertions(+), 139 deletions(-) delete mode 100644 types/bugsnag/bugsnag-tests.ts delete mode 100644 types/bugsnag/index.d.ts delete mode 100644 types/bugsnag/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 0c3a536d70..82619066ac 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -24,6 +24,12 @@ "sourceRepoURL": "https://github.com/mzabriskie/axios", "asOfVersion": "0.14.0" }, + { + "libraryName": "Bugsnag Browser", + "typingsPackageName": "bugsnag-js", + "sourceRepoURL": "https://github.com/bugsnag/bugsnag-js", + "asOfVersion": "3.1.0" + }, { "libraryName": "camel-case", "typingsPackageName": "camel-case", diff --git a/types/bugsnag/bugsnag-tests.ts b/types/bugsnag/bugsnag-tests.ts deleted file mode 100644 index 033abe2a34..0000000000 --- a/types/bugsnag/bugsnag-tests.ts +++ /dev/null @@ -1,27 +0,0 @@ - - -Bugsnag.apiKey = "API-KEY"; - -Bugsnag.releaseStage = "beta"; -Bugsnag.appVersion = "2.4.56"; - -Bugsnag.user = { - name: "Robert K. User", - email: "robbie@example.com" -}; - -Bugsnag.metaData = { - account: { - name: "Acme Co", - plan: "hacker" - } -} - -Bugsnag.notifyException(new Error("Something broke")); - -Bugsnag.notify("Serious Problem", "We are out of cookies"); - -Bugsnag.notify("Serious Problem", - "We are out of cookies", - { remaining_snacks: ["carrots", "biscuits"] }, - "error"); diff --git a/types/bugsnag/index.d.ts b/types/bugsnag/index.d.ts deleted file mode 100644 index 1ba14de2ef..0000000000 --- a/types/bugsnag/index.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -// Type definitions for Bugsnag v2.5.0 -// Project: https://github.com/bugsnag/bugsnag-js -// Definitions by: Delisa Mason -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface BugsnagUser { - id?: string, - name?: string, - email?: string -} - -interface BugsnagStatic { - /** Bugsnag project API key */ - apiKey: string; - /** The client application version */ - appVersion: string; - /** true if Bugsnag should be automatically notified of errors which are - * sent to `window.onerror` - */ - autoNotify: boolean; - /** Callback run before error reports are sent to Bugsnag. - * Payload and metadata information can be altered or removed altogether. - * To cancel sending the report, return false from this function. - */ - beforeNotify: (payload: any, metaData: any) => boolean; - /** The pathname of the current page, not including the fragment identifier - * nor search parameters - */ - context: string; - /** Disables console-based logging. Defaults to false. */ - disableLog: boolean; - /** The address used to send errors to Bugsnag. The default is - * `https://notify.bugsnag.com/js` - */ - endpoint: string; - /** Enables sending inline scripts on the page to Bugsnag to assist with - * debugging. Defaults to true - */ - inlineScript: boolean; - /** The maximum depth to parse the error stack */ - maxDepth: number; - /** Additional metadata to send to Bugsnag with every error. */ - metaData: any; - /** The method used for the notify request. The default is a temporary - * JavaScript image object, however Chrome apps/extensions and other - * applications where XHR is needed can use `xhr` instead. - */ - notifyHandler: string; - /** The releases stages during which Bugsnag will be notified of errors. */ - notifyReleaseStages: string[]; - /** The recorded root of the project. The default is the current host - * address (protocol and domain). - */ - projectRoot: string; - /** Current phase of the application release process. The default is - * `production` - */ - releaseStage: string; - /** Information about the current user which is sent to Bugsnag with - * exception reports - */ - user: BugsnagUser; - - /** Continue catching exceptions after the page error limit is reached. - * Useful for long-running single-page apps - */ - refresh(): void; - - /** Remove Bugsnag from the window object and restore the previous - * binding - */ - noConflict(): BugsnagStatic; - - /** Send caught exceptions to Bugsnag. Valid severity values are `info`, - * `warning`, and `error`, in order of increasing severity. - */ - notifyException(exception: Error, name?: string, metaData?: any, - severity?: string): void; - - /** Send custom errors to Bugsnag */ - notify(name: string, message: string, metaData?: any, - severity?: string): void; -} - -declare var Bugsnag: BugsnagStatic; - -declare module "Bugsnag" { - export = Bugsnag; -} - diff --git a/types/bugsnag/tsconfig.json b/types/bugsnag/tsconfig.json deleted file mode 100644 index 480f98a223..0000000000 --- a/types/bugsnag/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bugsnag-tests.ts" - ] -} \ No newline at end of file