diff --git a/types/m3u8-parser/index.d.ts b/types/m3u8-parser/index.d.ts index 803dc5f0e1680d..a460acc3c64b23 100644 --- a/types/m3u8-parser/index.d.ts +++ b/types/m3u8-parser/index.d.ts @@ -124,7 +124,7 @@ export interface Manifest { export class Parser extends Stream { constructor(options?: { - url?: string; + uri?: string; mainDefinitions?: Record; }); lineStream: LineStream; diff --git a/types/m3u8-parser/m3u8-parser-tests.ts b/types/m3u8-parser/m3u8-parser-tests.ts index 97897cd071064b..f4aeb25721e40e 100644 --- a/types/m3u8-parser/m3u8-parser-tests.ts +++ b/types/m3u8-parser/m3u8-parser-tests.ts @@ -10,7 +10,7 @@ parser.end(); const parsedManifest = parser.manifest.playlists?.[0].contentProtection?.["com.apple.fps.1_0"]?.attributes.resoltion; const parser2 = new Parser({ - url: "https://exmaple.com/video.m3u8?param_a=34¶m_b=abc", + uri: "https://exmaple.com/video.m3u8?param_a=34¶m_b=abc", mainDefinitions: { param_c: "def", }, diff --git a/types/react-dom/index.d.ts b/types/react-dom/index.d.ts index 43fa2d9e872c5a..76efddd2215455 100644 --- a/types/react-dom/index.d.ts +++ b/types/react-dom/index.d.ts @@ -84,6 +84,7 @@ export interface PreloadOptions { type?: string | undefined; nonce?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; + media?: string | undefined; } export function preload(href: string, options?: PreloadOptions): void; diff --git a/types/react-dom/test/react-dom-tests.tsx b/types/react-dom/test/react-dom-tests.tsx index e214de87f8542f..d446672998a88e 100644 --- a/types/react-dom/test/react-dom-tests.tsx +++ b/types/react-dom/test/react-dom-tests.tsx @@ -528,6 +528,7 @@ function preloadTest() { imageSrcSet: "fooset", imageSizes: "foosizes", referrerPolicy: "no-referrer", + media: "(max-width: 600px)", }); ReactDOM.preload("foo", { as: "image", diff --git a/types/react-dom/v18/canary.d.ts b/types/react-dom/v18/canary.d.ts index 827928da6156c7..e3ab63fb3b62f3 100644 --- a/types/react-dom/v18/canary.d.ts +++ b/types/react-dom/v18/canary.d.ts @@ -70,6 +70,7 @@ declare module "." { type?: string | undefined; nonce?: string | undefined; referrerPolicy?: ReferrerPolicy | undefined; + media?: string | undefined; } function preload(href: string, options?: PreloadOptions): void; diff --git a/types/react-dom/v18/test/canary-tests.tsx b/types/react-dom/v18/test/canary-tests.tsx index d19073b69a238e..3771fd58414484 100644 --- a/types/react-dom/v18/test/canary-tests.tsx +++ b/types/react-dom/v18/test/canary-tests.tsx @@ -26,6 +26,7 @@ function preloadTest() { imageSrcSet: "fooset", imageSizes: "foosizes", referrerPolicy: "no-referrer", + media: "(max-width: 600px)", }); ReactDOM.preload("foo", { as: "image", diff --git a/types/textarea-caret/index.d.ts b/types/textarea-caret/index.d.ts index e8fb1d0b84b9a2..1f748dfe3e1e8c 100644 --- a/types/textarea-caret/index.d.ts +++ b/types/textarea-caret/index.d.ts @@ -1,4 +1,4 @@ -export = textarea_caret; +export = getCaretCoordinates; interface Caret { top: number; @@ -10,4 +10,6 @@ interface Options { debug?: boolean | undefined; } -declare function textarea_caret(element: HTMLElement, position: number, options?: Options): Caret; +declare function getCaretCoordinates(element: HTMLElement, position: number, options?: Options): Caret; + +export as namespace getCaretCoordinates; diff --git a/types/textarea-caret/textarea-caret-tests.ts b/types/textarea-caret/textarea-caret-tests.ts index 09707ac2005734..967341d68781e9 100644 --- a/types/textarea-caret/textarea-caret-tests.ts +++ b/types/textarea-caret/textarea-caret-tests.ts @@ -1,8 +1,17 @@ -import getCaretCoordinates = require("textarea-caret"); +import anyNameYouLike = require("textarea-caret"); const element = document.querySelector("textarea"); -element!.addEventListener("input", function() { - const caret = getCaretCoordinates(this, this.selectionEnd); - console.log("(top, left, height) = (%s, %s, %s)", caret.top, caret.left, caret.height); -}); +function testImportedLibrary() { + element!.addEventListener("input", function() { + const caret = anyNameYouLike(this, this.selectionEnd); + console.log("(top, left, height) = (%s, %s, %s)", caret.top, caret.left, caret.height); + }); +} + +function testGlobalName() { + element!.addEventListener("input", function() { + const caret = window.getCaretCoordinates(this, this.selectionEnd); + console.log("(top, left, height) = (%s, %s, %s)", caret.top, caret.left, caret.height); + }); +}