File tree 1 file changed +22
-3
lines changed
1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 1
- // Not available on old TS versions but used by `@testing-library/user-event`
1
+ // Patches types not available on old TS versions but is used by `@testing-library/user-event`.
2
2
// @see https://stackoverflow.com/a/61505395
3
- declare class ClipboardItem {
4
- constructor ( data : { [ mimeType : string ] : Blob } )
3
+ declare module 'lib.dom.ts' {
4
+ type ClipboardItemData = Promise < ClipboardItemDataType > ;
5
+ type ClipboardItemDataType = string | Blob ;
6
+ type PresentationStyle = "attachment" | "inline" | "unspecified" ;
7
+
8
+ interface ClipboardItemOptions {
9
+ presentationStyle ?: PresentationStyle ;
10
+ }
11
+
12
+ interface ClipboardItem {
13
+ readonly types : ReadonlyArray < string >
14
+ getType ( type : string ) : Promise < Blob >
15
+ }
16
+
17
+ var ClipboardItem : {
18
+ prototype : ClipboardItem
19
+ new (
20
+ items : Record < string , ClipboardItemData > ,
21
+ options ?: ClipboardItemOptions
22
+ ) : ClipboardItem
23
+ }
5
24
}
You can’t perform that action at this time.
0 commit comments