Skip to content

Commit

Permalink
fix(tracing): Add manual DOMStringList typing (#2718)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jul 3, 2020
1 parent eb225dd commit 30e710d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
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

0 comments on commit 30e710d

Please sign in to comment.