Skip to content
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

fix(tracing): Add manual DOMStringList typing #2718

Merged
merged 2 commits into from Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
- [tracing] fix: Add manual `DOMStringList` typing (#2718)

## 5.19.0

Expand Down
27 changes: 27 additions & 0 deletions packages/apm/src/integrations/types.ts
@@ -1,3 +1,30 @@
/**
* A type returned by some APIs which contains a list of DOMString (strings).
*
* Copy DOMStringList interface so that user's dont have to include dom typings with Tracing integration
* Based on https://github.com/microsoft/TypeScript/blob/4cf0afe2662980ebcd8d444dbd13d8f47d06fcd5/lib/lib.dom.d.ts#L4051
*/
interface DOMStringList {
/**
* Returns the number of strings in strings.
*/
readonly length: number;
/**
* Returns true if strings contains string, and false otherwise.
*/
contains(str: string): boolean;
/**
* Returns the string with index index from strings.
*/
item(index: number): string | null;
[index: number]: string;
}

declare var DOMStringList: {
prototype: DOMStringList;
new (): DOMStringList;
};

/**
* The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to.
* Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively.
Expand Down