bugsnag-js: Provides its own types (#15621)

* Add bugsnag-node types

* Remove bugsnag-js

* Update comment

* Remove bugsnag-node typings
This commit is contained in:
Iker Pérez Brunelli
2017-04-10 10:27:39 -07:00
committed by Andy
parent 7495cb2c5c
commit 243d9b9b28
4 changed files with 6 additions and 139 deletions
+6
View File
@@ -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",
-27
View File
@@ -1,27 +0,0 @@
Bugsnag.apiKey = "API-KEY";
Bugsnag.releaseStage = "beta";
Bugsnag.appVersion = "2.4.56";
Bugsnag.user = <BugsnagUser>{
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");
-90
View File
@@ -1,90 +0,0 @@
// Type definitions for Bugsnag v2.5.0
// Project: https://github.com/bugsnag/bugsnag-js
// Definitions by: Delisa Mason <https://github.com/kattrali>
// 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;
}
-22
View File
@@ -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"
]
}