-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
polish raven.d.ts #827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
polish raven.d.ts #827
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ef30661
polished raven.d.ts
LucaVazz 98a83c1
updated author information of raven.d.ts
LucaVazz 2e590d2
added extra to RavenUserContext
LucaVazz cc9fc47
small fixes
LucaVazz 592e542
copied fixes from PR in DefenitivelyTyped
LucaVazz 089efdd
fixed tsc --noEmit --noImplicitAny typescript/raven-tests.ts
LucaVazz 305d38b
made `data: any` in set...Calback more specific
LucaVazz 949bc5d
added missing values to RavenOutgoingData
LucaVazz d0d32c8
replaced any in setBreadcrumbCallback
LucaVazz e562d5c
made options for setTransport more specific
LucaVazz a53a044
set user in RavenOutgoingData to RavenUserContext instead of any
LucaVazz f46fde8
fixed missed RavenTransportOptions (-> RavenTransportFunctionOptions …
LucaVazz 7fdef1f
fixed interface-props terminated by `;` to be terminated by `;`
LucaVazz 9f38a30
Merge branch 'master' of https://github.com/getsentry/raven-js
LucaVazz 1f55f01
re-added accidentally deleted tests (in a fixed version)
LucaVazz 3e51fc6
fixed typo in RavenBreadcrumbOptions
LucaVazz ac60fe3
added a proposal for a PR-Template
LucaVazz 10d48cc
removed redundant testing from the PR-Template
LucaVazz 60a7809
fix optionals in RavenBreadcrumb
LucaVazz 5e92191
added tests for captureBreadcrumb
LucaVazz 634908c
fixed erroneous optionals from the last commit
LucaVazz d8941cf
removed PR-Template
LucaVazz e034ba6
Merge branch 'master' of https://github.com/LucaVazz/raven-js
LucaVazz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ***Status:*** | ||
| - [ ] ready | ||
| - [ ] work in progress | ||
| - [ ] hold | ||
|
|
||
|
|
||
| **What is the purpose of this PR?** | ||
|
|
||
|
|
||
| **Is this related to an Issue? (If so, please link to it)** | ||
|
|
||
|
|
||
| **How should this be manually tested?** | ||
|
|
||
|
|
||
| ***Checklist:*** | ||
| - [ ] I have included appropriate Tests and have run `npm test` without errors | ||
| - [ ] I have updated the Documentation accordingly | ||
| - [ ] I updated typings/raven.d.ts if I added to or changed the API and have run `tsc --noEmit --noImplicitAny typescript/raven-tests.ts` without errors | ||
|
|
||
| Please note: If you are not able to fulfill these points by yourself, leave them unchecked. We are happy to help you with them. | ||
|
|
||
|
|
||
| ***Release Type:*** | ||
| - [ ] Major | ||
| - [ ] Minor | ||
| - [X] Patch | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import Raven from "./raven" | ||
|
|
||
| import Raven, {RavenOutgoingData} from "./raven" | ||
|
|
||
| // configuring: | ||
| Raven.config('https://[email protected]/1').install(); | ||
|
|
||
| Raven.config( | ||
|
|
@@ -20,32 +20,54 @@ Raven.config( | |
| } | ||
| ).install(); | ||
|
|
||
| var throwsError = () => { | ||
| throw new Error('broken'); | ||
| }; | ||
| Raven.setDataCallback((data: RavenOutgoingData) => {return data}); | ||
| Raven.setDataCallback(function (data: RavenOutgoingData, original: string) {return data}); | ||
|
|
||
| Raven.setShouldSendCallback((data: RavenOutgoingData) => {return data}); | ||
| Raven.setShouldSendCallback(function (data: RavenOutgoingData, original: string) {return data}); | ||
|
|
||
| try { | ||
| throwsError(); | ||
| } catch(e) { | ||
| Raven.captureException(e); | ||
| Raven.captureException(e, {tags: { key: "value" }}); | ||
| } | ||
|
|
||
| // context: | ||
| Raven.context(throwsError); | ||
| Raven.context({tags: { key: "value" }}, throwsError); | ||
| Raven.context({extra: {planet: {name: 'Earth'}}}, throwsError); | ||
|
|
||
| setTimeout(Raven.wrap(throwsError), 1000); | ||
| Raven.wrap({logger: "my.module"}, throwsError)(); | ||
| Raven.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)(); | ||
|
|
||
| Raven.setUserContext({ | ||
| email: '[email protected]', | ||
| id: '123' | ||
| }); | ||
|
|
||
| Raven.setExtraContext({foo: 'bar'}); | ||
|
|
||
| Raven.setTagsContext({env: 'prod'}); | ||
|
|
||
| Raven.clearContext(); | ||
|
|
||
| var obj:Object = Raven.getContext(); | ||
|
|
||
| Raven.setRelease('abc123'); | ||
| Raven.setEnvironment('production'); | ||
|
|
||
| setTimeout(Raven.wrap(throwsError), 1000); | ||
| Raven.wrap({logger: "my.module"}, throwsError)(); | ||
| Raven.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)(); | ||
|
|
||
|
|
||
| // reporting: | ||
| var throwsError = () => { | ||
| throw new Error('broken'); | ||
| }; | ||
|
|
||
| try { | ||
| throwsError(); | ||
| } catch(e) { | ||
| Raven.captureException(e); | ||
| Raven.captureException(e, {tags: { key: "value" }}); | ||
| } | ||
|
|
||
| Raven.captureMessage('Broken!'); | ||
| Raven.captureMessage('Broken!', {tags: { key: "value" }}); | ||
| Raven.captureMessage('Broken!', { stacktrace: true }); | ||
|
|
||
| Raven.showReportDialog({ | ||
| eventId: 0815, | ||
|
|
@@ -56,6 +78,5 @@ Raven.showReportDialog({ | |
| } | ||
| }); | ||
|
|
||
| Raven.setTagsContext({ key: "value" }); | ||
|
|
||
| Raven.setExtraContext({ foo: "bar" }); | ||
| var err:Error = Raven.lastException(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably make this a script like
npm run test:ts, or make it called bynpm testdirectlyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that in fact it already is called directly by
npm test😁