UNPKG

1.98 kBTypeScriptView Raw
1// Type definitions for react-is 17.0
2// Project: https://reactjs.org/
3// Definitions by: Avi Vahl <https://github.com/AviVahl>
4// Christian Chown <https://github.com/christianchown>
5// Sebastian Silbermann <https://github.com/eps1lon>
6// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7// TypeScript Version: 2.8
8
9// NOTE: Users of the React 18 alpha should add a reference
10// to 'react-is/next' in their project. See next.d.ts's top comment
11// for reference and documentation on how exactly to do it.
12
13export as namespace ReactIs;
14
15import {
16 LazyExoticComponent,
17 MemoExoticComponent,
18 ReactElement,
19 ReactType
20} from "react";
21
22export function typeOf(value: any): symbol | undefined;
23export function isValidElementType(value: any): value is ReactType;
24export function isAsyncMode(value: any): value is ReactElement;
25export function isContextConsumer(value: any): value is ReactElement;
26export function isContextProvider(value: any): value is ReactElement;
27export function isElement(value: any): value is ReactElement;
28export function isForwardRef(value: any): value is ReactElement;
29export function isFragment(value: any): value is ReactElement;
30export function isLazy(value: any): value is LazyExoticComponent<any>;
31export function isMemo(value: any): value is MemoExoticComponent<any>;
32export function isProfiler(value: any): value is ReactElement;
33export function isPortal(value: any): value is ReactElement;
34export function isStrictMode(value: any): value is ReactElement;
35export function isSuspense(value: any): value is ReactElement;
36
37export const AsyncMode: symbol;
38export const ContextConsumer: symbol;
39export const ContextProvider: symbol;
40export const Element: symbol;
41export const ForwardRef: symbol;
42export const Fragment: symbol;
43export const Lazy: symbol;
44export const Memo: symbol;
45export const Portal: symbol;
46export const Profiler: symbol;
47export const StrictMode: symbol;
48export const Suspense: symbol;