@types/react-dom 18.2.9 → 18.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
react-dom/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React (react-dom) (https://reactjs.or
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 04 Oct 2023 14:05:53 GMT
11
+ * Last updated: Wed, 04 Oct 2023 19:06:11 GMT
12
12
  * Dependencies: [@types/react](https://npmjs.com/package/@types/react)
13
13
  * Global values: `ReactDOM`, `ReactDOMServer`
14
14
 
react-dom/canary.d.ts CHANGED
@@ -32,21 +32,78 @@ import ReactDOM = require(".");
32
32
  export {};
33
33
 
34
34
  declare module "." {
35
- type PreloadAs = "font" | "script" | "style";
35
+ function prefetchDNS(href: string): void;
36
+
37
+ interface PreconnectOptions {
38
+ // Don't create a helper type.
39
+ // It would have to be in module scope to be inlined in TS tooltips.
40
+ // But then it becomes part of the public API.
41
+ // TODO: Upstream to microsoft/TypeScript-DOM-lib-generator -> w3c/webref
42
+ // since the spec has a notion of a dedicated type: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attribute
43
+ crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
44
+ }
45
+ function preconnect(href: string, options?: PreconnectOptions): void;
46
+
47
+ type PreloadAs =
48
+ | "audio"
49
+ | "document"
50
+ | "embed"
51
+ | "fetch"
52
+ | "font"
53
+ | "image"
54
+ | "object"
55
+ | "track"
56
+ | "script"
57
+ | "style"
58
+ | "video"
59
+ | "worker";
36
60
  interface PreloadOptions {
37
61
  as: PreloadAs;
38
- crossOrigin?: string | undefined;
62
+ crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
63
+ fetchPriority?: "high" | "low" | "auto" | undefined;
64
+ // TODO: These should only be allowed with `as: 'image'` but it's not trivial to write tests against the full TS support matrix.
65
+ imageSizes?: string | undefined;
66
+ imageSrcSet?: string | undefined;
39
67
  integrity?: string | undefined;
68
+ nonce?: string | undefined;
69
+ referrerPolicy?: ReferrerPolicy | undefined;
40
70
  }
41
71
  function preload(href: string, options?: PreloadOptions): void;
42
72
 
73
+ // https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload
74
+ type PreloadModuleAs = RequestDestination;
75
+ interface PreloadModuleOptions {
76
+ /**
77
+ * @default "script"
78
+ */
79
+ as: PreloadModuleAs;
80
+ crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
81
+ integrity?: string | undefined;
82
+ nonce?: string | undefined;
83
+ }
84
+ function preloadModule(href: string, options?: PreloadModuleOptions): void;
85
+
43
86
  type PreinitAs = "script" | "style";
44
87
  interface PreinitOptions {
45
88
  as: PreinitAs;
46
- crossOrigin?: string | undefined;
89
+ crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
90
+ fetchPriority?: "high" | "low" | "auto" | undefined;
47
91
  precedence?: string | undefined;
48
92
  integrity?: string | undefined;
49
93
  nonce?: string | undefined;
50
94
  }
51
95
  function preinit(href: string, options?: PreinitOptions): void;
96
+
97
+ // Will be expanded to include all of https://github.com/tc39/proposal-import-attributes
98
+ type PreinitModuleAs = "script";
99
+ interface PreinitModuleOptions {
100
+ /**
101
+ * @default "script"
102
+ */
103
+ as?: PreinitModuleAs;
104
+ crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
105
+ integrity?: string | undefined;
106
+ nonce?: string | undefined;
107
+ }
108
+ function preinitModule(href: string, options?: PreinitModuleOptions): void;
52
109
  }
react-dom/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "18.2.9",
3
+ "version": "18.2.10",
4
4
  "description": "TypeScript definitions for React (react-dom)",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
6
6
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "@types/react": "*"
51
51
  },
52
- "typesPublisherContentHash": "771c775383a7ee5d36a780b07a71d47c2a43412521804449e3262779a91ad0d5",
52
+ "typesPublisherContentHash": "c5d9463c22d80651c11d87155cd8ec4c582285ff59f0c84203e35e64f8af55b3",
53
53
  "typeScriptVersion": "4.5",
54
54
  "exports": {
55
55
  ".": {