@types/react 16.9.55 → 16.14.2

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.
File without changes
@@ -5,10 +5,10 @@
5
5
  This package contains type definitions for React (http://facebook.github.io/react/).
6
6
 
7
7
  # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 28 Oct 2020 18:56:19 GMT
11
+ * Last updated: Mon, 23 Nov 2020 18:56:37 GMT
12
12
  * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types)
13
13
  * Global values: `React`
14
14
 
File without changes
@@ -1,4 +1,4 @@
1
- // Type definitions for React 16.9
1
+ // Type definitions for React 16.14
2
2
  // Project: http://facebook.github.io/react/
3
3
  // Definitions by: Asana <https://asana.com>
4
4
  // AssureSign <http://www.assuresign.com>
@@ -176,6 +176,7 @@ declare namespace React {
176
176
  }
177
177
 
178
178
  // ReactHTML for ReactHTMLElement
179
+ // tslint:disable-next-line:no-empty-interface
179
180
  interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> { }
180
181
 
181
182
  interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {
@@ -214,6 +215,7 @@ declare namespace React {
214
215
  type DOMFactory<P extends DOMAttributes<T>, T extends Element> =
215
216
  (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]) => DOMElement<P, T>;
216
217
 
218
+ // tslint:disable-next-line:no-empty-interface
217
219
  interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}
218
220
 
219
221
  interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {
@@ -429,6 +431,7 @@ declare namespace React {
429
431
  type ReactInstance = Component<any> | Element;
430
432
 
431
433
  // Base component for plain JS classes
434
+ // tslint:disable-next-line:no-empty-interface
432
435
  interface Component<P = {}, S = {}, SS = any> extends ComponentLifecycle<P, S, SS> { }
433
436
  class Component<P, S> {
434
437
  // tslint won't let me format the sample code in a way that vscode likes it :(
@@ -1193,6 +1196,7 @@ declare namespace React {
1193
1196
  target: EventTarget & T;
1194
1197
  }
1195
1198
 
1199
+ // tslint:disable-next-line:no-empty-interface
1196
1200
  interface FormEvent<T = Element> extends SyntheticEvent<T> {
1197
1201
  }
1198
1202
 
@@ -1940,6 +1944,7 @@ declare namespace React {
1940
1944
  referrerPolicy?: HTMLAttributeReferrerPolicy;
1941
1945
  }
1942
1946
 
1947
+ // tslint:disable-next-line:no-empty-interface
1943
1948
  interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
1944
1949
 
1945
1950
  interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -2964,6 +2969,7 @@ type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps
2964
2969
 
2965
2970
  declare global {
2966
2971
  namespace JSX {
2972
+ // tslint:disable-next-line:no-empty-interface
2967
2973
  interface Element extends React.ReactElement<any, any> { }
2968
2974
  interface ElementClass extends React.Component<any> {
2969
2975
  render(): React.ReactNode;
@@ -2979,7 +2985,9 @@ declare global {
2979
2985
  : ReactManagedAttributes<T, P>
2980
2986
  : ReactManagedAttributes<C, P>;
2981
2987
 
2988
+ // tslint:disable-next-line:no-empty-interface
2982
2989
  interface IntrinsicAttributes extends React.Attributes { }
2990
+ // tslint:disable-next-line:no-empty-interface
2983
2991
  interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
2984
2992
 
2985
2993
  interface IntrinsicElements {
@@ -0,0 +1,2 @@
1
+ // Expose `JSX` namespace in `global` namespace
2
+ import './';
@@ -0,0 +1,2 @@
1
+ // Expose `JSX` namespace in `global` namespace
2
+ import './';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.55",
3
+ "version": "16.14.2",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -144,6 +144,6 @@
144
144
  "@types/prop-types": "*",
145
145
  "csstype": "^3.0.2"
146
146
  },
147
- "typesPublisherContentHash": "aaafb411c8479f94d32139bfbd85aba32a4428942e2f24f96576263b7d78fcc3",
148
- "typeScriptVersion": "3.2"
147
+ "typesPublisherContentHash": "36c10b8c6b898fde912c62245ed9f63a2addbc19f40999bc97024af14d80b409",
148
+ "typeScriptVersion": "3.3"
149
149
  }
react/experimental.d.ts DELETED
@@ -1,189 +0,0 @@
1
- /**
2
- * These are types for things that are present in the `experimental` builds of React but not yet
3
- * on a stable build.
4
- *
5
- * Once they are promoted to stable they can just be moved to the main index file.
6
- *
7
- * To load the types declared here in an actual project, there are three ways. The easiest one,
8
- * if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
9
- * is to add `"react/experimental"` to the `"types"` array.
10
- *
11
- * Alternatively, a specific import syntax can to be used from a typescript file.
12
- * This module does not exist in reality, which is why the {} is important:
13
- *
14
- * ```ts
15
- * import {} from 'react/experimental'
16
- * ```
17
- *
18
- * It is also possible to include it through a triple-slash reference:
19
- *
20
- * ```ts
21
- * /// <reference types="react/experimental" />
22
- * ```
23
- *
24
- * Either the import or the reference only needs to appear once, anywhere in the project.
25
- */
26
-
27
- // See https://github.com/facebook/react/blob/master/packages/react/src/React.js to see how the exports are declared,
28
- // and https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js to verify which APIs are
29
- // flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
30
- //
31
- // For the inputs of types exported as simply a fiber tag, the `beginWork` function of ReactFiberBeginWork.js
32
- // is a good place to start looking for details; it generally calls prop validation functions or delegates
33
- // all tasks done as part of the render phase (the concurrent part of the React update cycle).
34
- //
35
- // Suspense-related handling can be found in ReactFiberThrow.js.
36
-
37
- import React = require('.');
38
-
39
- export {};
40
-
41
- declare module '.' {
42
- export interface SuspenseProps {
43
- /**
44
- * The presence of this prop indicates that the content is computationally expensive to render.
45
- * In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
46
- * @see {@link https://github.com/facebook/react/pull/19936}
47
- */
48
- unstable_expectedLoadTime?: number;
49
- }
50
-
51
- export type SuspenseListRevealOrder = 'forwards' | 'backwards' | 'together';
52
- export type SuspenseListTailMode = 'collapsed' | 'hidden';
53
-
54
- export interface SuspenseListCommonProps {
55
- /**
56
- * Note that SuspenseList require more than one child;
57
- * it is a runtime warning to provide only a single child.
58
- *
59
- * It does, however, allow those children to be wrapped inside a single
60
- * level of `<React.Fragment>`.
61
- */
62
- children: ReactElement | Iterable<ReactElement>;
63
- }
64
-
65
- interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
66
- /**
67
- * Defines the order in which the `SuspenseList` children should be revealed.
68
- */
69
- revealOrder: 'forwards' | 'backwards';
70
- /**
71
- * Dictates how unloaded items in a SuspenseList is shown.
72
- *
73
- * - By default, `SuspenseList` will show all fallbacks in the list.
74
- * - `collapsed` shows only the next fallback in the list.
75
- * - `hidden` doesn’t show any unloaded items.
76
- */
77
- tail?: SuspenseListTailMode;
78
- }
79
-
80
- interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
81
- /**
82
- * Defines the order in which the `SuspenseList` children should be revealed.
83
- */
84
- revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']>;
85
- /**
86
- * The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
87
- */
88
- tail?: never;
89
- }
90
-
91
- export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
92
-
93
- /**
94
- * `SuspenseList` helps coordinate many components that can suspend by orchestrating the order
95
- * in which these components are revealed to the user.
96
- *
97
- * When multiple components need to fetch data, this data may arrive in an unpredictable order.
98
- * However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
99
- * until previous items have been displayed (this behavior is adjustable).
100
- *
101
- * @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
102
- * @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
103
- */
104
- export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
105
-
106
- export interface SuspenseConfig {
107
- busyDelayMs?: number;
108
- busyMinDurationMs?: number;
109
- }
110
-
111
- // undocumented, considered for removal
112
- export function unstable_withSuspenseConfig(
113
- scope: () => void | undefined,
114
- config: SuspenseConfig | null | undefined,
115
- ): void;
116
-
117
- // must be synchronous
118
- export type TransitionFunction = () => void | undefined;
119
- // strange definition to allow vscode to show documentation on the invocation
120
- export interface TransitionStartFunction {
121
- /**
122
- * State updates caused inside the callback are allowed to be deferred.
123
- *
124
- * **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
125
- *
126
- * @param callback A _synchronous_ function which causes state updates that can be deferred.
127
- */
128
- (callback: TransitionFunction): void;
129
- }
130
-
131
- /**
132
- * Returns a deferred version of the value that may “lag behind” it for at most `timeoutMs`.
133
- *
134
- * This is commonly used to keep the interface responsive when you have something that renders immediately
135
- * based on user input and something that needs to wait for a data fetch.
136
- *
137
- * A good example of this is a text input.
138
- *
139
- * @param value The value that is going to be deferred
140
- *
141
- * @see https://reactjs.org/docs/concurrent-mode-reference.html#usedeferredvalue
142
- */
143
- export function unstable_useDeferredValue<T>(value: T): T;
144
-
145
- /**
146
- * Allows components to avoid undesirable loading states by waiting for content to load
147
- * before transitioning to the next screen. It also allows components to defer slower,
148
- * data fetching updates until subsequent renders so that more crucial updates can be
149
- * rendered immediately.
150
- *
151
- * The `useTransition` hook returns two values in an array.
152
- *
153
- * The first is a function that takes a callback. We can use it to tell React which state we want to defer.
154
- * The seconda boolean. It’s React’s way of informing us whether we’re waiting for the transition to finish.
155
- *
156
- * **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
157
- *
158
- * @param config An optional object with `timeoutMs`
159
- *
160
- * @see https://reactjs.org/docs/concurrent-mode-reference.html#usetransition
161
- */
162
- export function unstable_useTransition(config?: SuspenseConfig | null): [TransitionStartFunction, boolean];
163
-
164
- const opaqueIdentifierBranding: unique symbol;
165
- /**
166
- * WARNING: Don't use this as a `string`.
167
- *
168
- * This is an opaque type that is not supposed to type-check structurally.
169
- * It is only valid if returned from React methods and passed to React e.g. `<button aria-labelledby={opaqueIdentifier} />`
170
- */
171
- // We can't create a type that would be rejected for string concatenation or `.toString()` calls.
172
- // So in order to not have to add `string | OpaqueIdentifier` to every react-dom host prop we intersect it with `string`.
173
- type OpaqueIdentifier = string & {
174
- readonly [opaqueIdentifierBranding]: unknown;
175
- // While this would cause `const stringified: string = opaqueIdentifier.toString()` to not type-check it also adds completions while typing.
176
- // It would also still allow string concatenation.
177
- // Unsure which is better. Not type-checking or not suggesting.
178
- // toString(): void;
179
- };
180
-
181
- export function unstable_useOpaqueIdentifier(): OpaqueIdentifier;
182
-
183
- /**
184
- * Similar to `useTransition` but allows uses where hooks are not available.
185
- *
186
- * @param callback A _synchronous_ function which causes state updates that can be deferred.
187
- */
188
- export function unstable_startTransition(scope: TransitionFunction): void;
189
- }