Skip to content

Commit 30e710d

Browse files
authored
fix(tracing): Add manual DOMStringList typing (#2718)
1 parent eb225dd commit 30e710d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

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

78
## 5.19.0
89

packages/apm/src/integrations/types.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
/**
2+
* A type returned by some APIs which contains a list of DOMString (strings).
3+
*
4+
* Copy DOMStringList interface so that user's dont have to include dom typings with Tracing integration
5+
* Based on https://github.com/microsoft/TypeScript/blob/4cf0afe2662980ebcd8d444dbd13d8f47d06fcd5/lib/lib.dom.d.ts#L4051
6+
*/
7+
interface DOMStringList {
8+
/**
9+
* Returns the number of strings in strings.
10+
*/
11+
readonly length: number;
12+
/**
13+
* Returns true if strings contains string, and false otherwise.
14+
*/
15+
contains(str: string): boolean;
16+
/**
17+
* Returns the string with index index from strings.
18+
*/
19+
item(index: number): string | null;
20+
[index: number]: string;
21+
}
22+
23+
declare var DOMStringList: {
24+
prototype: DOMStringList;
25+
new (): DOMStringList;
26+
};
27+
128
/**
229
* The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to.
330
* Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively.

0 commit comments

Comments
 (0)