Skip to content

fix: Typescript typings#1134

Merged
kamilogorek merged 4 commits intogetsentry:masterfrom
pgrm:master
Dec 19, 2017
Merged

fix: Typescript typings#1134
kamilogorek merged 4 commits intogetsentry:masterfrom
pgrm:master

Conversation

@pgrm
Copy link
Contributor

@pgrm pgrm commented Nov 16, 2017

Before submitting a pull request, please verify the following:

  • If you've added code that should be tested, please add tests.
  • If you've modified the API (e.g. added a new config or public method), update the docs and TypeScript declaration file.
  • Ensure your code lints and the test suite passes (npm test).

I tried applying the hack described here - #339 (comment) - in my angular (typescript) application, when I noticed that some types don't match.

  • I changed onFailure to onError and added correct parameter
  • I fixed the callback types for setXYZCallback

I went through the implementation and hope that I've renamed / adjusted everything correctly. Would be cool if you could merge and release these fixes soon. Thx

@pgrm pgrm changed the title change onFailure to onError and add correct parameter fix: Typescript typings - change onFailure to onError and add correct parameter Nov 17, 2017
@pgrm pgrm changed the title fix: Typescript typings - change onFailure to onError and add correct parameter fix: Typescript typings Nov 17, 2017
};
onSuccess: () => void;
onFailure: () => void;
onError: (error: Error & { request: XMLHttpRequest }) => void;
Copy link
Contributor

@kamilogorek kamilogorek Nov 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know TS syntax much, so is this request already optional by using &, or does it have to be annotated somehow? Because it can be omitted in the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not, that'd have to be request?:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamilogorek @SimonSchick I actually went through the code and thought that request is always set, but if you think it should be optional, it's fine with me - adjusted

};
onSuccess: () => void;
onFailure: () => void;
onError: (error: Error & { request: XMLHttpRequest }) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not, that'd have to be request?:

@@ -264,7 +266,7 @@ declare module Raven {
sentry_key: string;
};
onSuccess: () => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw: onSuccess(): void in generally shorter and preferred for interfaces.

@pgrm
Copy link
Contributor Author

pgrm commented Nov 22, 2017

@SimonSchick @kamilogorek thx for the review, anything else I'm missing?

@kamilogorek
Copy link
Contributor

Looks good to me. Thanks!

@kamilogorek kamilogorek merged commit 7d7eee2 into getsentry:master Dec 19, 2017
chargome added a commit that referenced this pull request Mar 5, 2026
Fixes Dependabot alert #1134.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
chargome added a commit that referenced this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants