UNPKG

@uifabric/experiments

Version:

Experimental React components for building experiences for Microsoft 365.

10 lines (8 loc) 137 kB
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[8],{ /***/ "../../node_modules/raw-loader/index.js!../../node_modules/@types/react/index.d.ts": /*!**********************************************************************************************************!*\ !*** /mnt/vss/_work/1/s/node_modules/raw-loader!/mnt/vss/_work/1/s/node_modules/@types/react/index.d.ts ***! \**********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"// Type definitions for React 16.8\\n// Project: http://facebook.github.io/react/\\n// Definitions by: Asana <https://asana.com>\\n// AssureSign <http://www.assuresign.com>\\n// Microsoft <https://microsoft.com>\\n// John Reilly <https://github.com/johnnyreilly>\\n// Benoit Benezech <https://github.com/bbenezech>\\n// Patricio Zavolinsky <https://github.com/pzavolinsky>\\n// Digiguru <https://github.com/digiguru>\\n// Eric Anderson <https://github.com/ericanderson>\\n// Dovydas Navickas <https://github.com/DovydasNavickas>\\n// Stéphane Goetz <https://github.com/onigoetz>\\n// Josh Rutherford <https://github.com/theruther4d>\\n// Guilherme Hübner <https://github.com/guilhermehubner>\\n// Ferdy Budhidharma <https://github.com/ferdaber>\\n// Johann Rakotoharisoa <https://github.com/jrakotoharisoa>\\n// Olivier Pascal <https://github.com/pascaloliv>\\n// Martin Hochel <https://github.com/hotell>\\n// Frank Li <https://github.com/franklixuefei>\\n// Jessica Franco <https://github.com/Jessidhia>\\n// Saransh Kataria <https://github.com/saranshkataria>\\n// Kanitkorn Sujautra <https://github.com/lukyth>\\n// Sebastian Silbermann <https://github.com/eps1lon>\\n// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\\n// TypeScript Version: 2.8\\n\\n/// <reference path=\\\"global.d.ts\\\" />\\n\\nimport * as CSS from 'csstype';\\nimport * as PropTypes from 'prop-types';\\n\\ntype NativeAnimationEvent = AnimationEvent;\\ntype NativeClipboardEvent = ClipboardEvent;\\ntype NativeCompositionEvent = CompositionEvent;\\ntype NativeDragEvent = DragEvent;\\ntype NativeFocusEvent = FocusEvent;\\ntype NativeKeyboardEvent = KeyboardEvent;\\ntype NativeMouseEvent = MouseEvent;\\ntype NativeTouchEvent = TouchEvent;\\ntype NativePointerEvent = PointerEvent;\\ntype NativeTransitionEvent = TransitionEvent;\\ntype NativeUIEvent = UIEvent;\\ntype NativeWheelEvent = WheelEvent;\\n\\n/**\\n * defined in scheduler/tracing\\n */\\ninterface SchedulerInteraction {\\n id: number;\\n name: string;\\n timestamp: number;\\n}\\n\\n// tslint:disable-next-line:export-just-namespace\\nexport = React;\\nexport as namespace React;\\n\\ndeclare namespace React {\\n //\\n // React Elements\\n // ----------------------------------------------------------------------\\n\\n type ElementType<P = any> =\\n {\\n [K in keyof JSX.IntrinsicElements]: P extends JSX.IntrinsicElements[K] ? K : never\\n }[keyof JSX.IntrinsicElements] |\\n ComponentType<P>;\\n /**\\n * @deprecated Please use `ElementType`\\n */\\n type ReactType<P = any> = ElementType<P>;\\n type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;\\n\\n type JSXElementConstructor<P> =\\n | ((props: P) => ReactElement | null)\\n | (new (props: P) => Component<P, any>);\\n\\n type Key = string | number;\\n\\n interface RefObject<T> {\\n readonly current: T | null;\\n }\\n\\n type Ref<T> = { bivarianceHack(instance: T | null): void }[\\\"bivarianceHack\\\"] | RefObject<T> | null;\\n type LegacyRef<T> = string | Ref<T>;\\n\\n type ComponentState = any;\\n\\n interface Attributes {\\n key?: Key;\\n }\\n interface RefAttributes<T> extends Attributes {\\n ref?: Ref<T>;\\n }\\n interface ClassAttributes<T> extends Attributes {\\n ref?: LegacyRef<T>;\\n }\\n\\n interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {\\n type: T;\\n props: P;\\n key: Key | null;\\n }\\n\\n interface ReactComponentElement<\\n T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,\\n P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, 'key' | 'ref'>>\\n > extends ReactElement<P, T> { }\\n\\n /**\\n * @deprecated Please use `FunctionComponentElement`\\n */\\n type SFCElement<P> = FunctionComponentElement<P>;\\n\\n interface FunctionComponentElement<P> extends ReactElement<P, FunctionComponent<P>> {\\n ref?: 'ref' extends keyof P ? P extends { ref?: infer R } ? R : never : never;\\n }\\n\\n type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;\\n interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P, ComponentClass<P>> {\\n ref?: LegacyRef<T>;\\n }\\n\\n type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;\\n\\n // string fallback for custom web-components\\n interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element> extends ReactElement<P, string> {\\n ref: LegacyRef<T>;\\n }\\n\\n // ReactHTML for ReactHTMLElement\\n // tslint:disable-next-line:no-empty-interface\\n interface ReactHTMLElement<T extends HTMLElement> extends DetailedReactHTMLElement<AllHTMLAttributes<T>, T> { }\\n\\n interface DetailedReactHTMLElement<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMElement<P, T> {\\n type: keyof ReactHTML;\\n }\\n\\n // ReactSVG for ReactSVGElement\\n interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {\\n type: keyof ReactSVG;\\n }\\n\\n interface ReactPortal extends ReactElement {\\n key: Key | null;\\n children: ReactNode;\\n }\\n\\n //\\n // Factories\\n // ----------------------------------------------------------------------\\n\\n type Factory<P> = (props?: Attributes & P, ...children: ReactNode[]) => ReactElement<P>;\\n\\n /**\\n * @deprecated Please use `FunctionComponentFactory`\\n */\\n type SFCFactory<P> = FunctionComponentFactory<P>;\\n\\n type FunctionComponentFactory<P> = (props?: Attributes & P, ...children: ReactNode[]) => FunctionComponentElement<P>;\\n\\n type ComponentFactory<P, T extends Component<P, ComponentState>> =\\n (props?: ClassAttributes<T> & P, ...children: ReactNode[]) => CElement<P, T>;\\n\\n type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;\\n type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;\\n\\n type DOMFactory<P extends DOMAttributes<T>, T extends Element> =\\n (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]) => DOMElement<P, T>;\\n\\n // tslint:disable-next-line:no-empty-interface\\n interface HTMLFactory<T extends HTMLElement> extends DetailedHTMLFactory<AllHTMLAttributes<T>, T> {}\\n\\n interface DetailedHTMLFactory<P extends HTMLAttributes<T>, T extends HTMLElement> extends DOMFactory<P, T> {\\n (props?: ClassAttributes<T> & P | null, ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;\\n }\\n\\n interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {\\n (props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null, ...children: ReactNode[]): ReactSVGElement;\\n }\\n\\n //\\n // React Nodes\\n // http://facebook.github.io/react/docs/glossary.html\\n // ----------------------------------------------------------------------\\n\\n type ReactText = string | number;\\n type ReactChild = ReactElement | ReactText;\\n\\n interface ReactNodeArray extends Array<ReactNode> {}\\n type ReactFragment = {} | ReactNodeArray;\\n type ReactNode = ReactChild | ReactFragment | ReactPortal | boolean | null | undefined;\\n\\n //\\n // Top Level API\\n // ----------------------------------------------------------------------\\n\\n // DOM Elements\\n function createFactory<T extends HTMLElement>(\\n type: keyof ReactHTML): HTMLFactory<T>;\\n function createFactory(\\n type: keyof ReactSVG): SVGFactory;\\n function createFactory<P extends DOMAttributes<T>, T extends Element>(\\n type: string): DOMFactory<P, T>;\\n\\n // Custom components\\n function createFactory<P>(type: FunctionComponent<P>): FunctionComponentFactory<P>;\\n function createFactory<P>(\\n type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>): CFactory<P, ClassicComponent<P, ComponentState>>;\\n function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(\\n type: ClassType<P, T, C>): CFactory<P, T>;\\n function createFactory<P>(type: ComponentClass<P>): Factory<P>;\\n\\n // DOM Elements\\n // TODO: generalize this to everything in `keyof ReactHTML`, not just \\\"input\\\"\\n function createElement(\\n type: \\\"input\\\",\\n props?: InputHTMLAttributes<HTMLInputElement> & ClassAttributes<HTMLInputElement> | null,\\n ...children: ReactNode[]): DetailedReactHTMLElement<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;\\n function createElement<P extends HTMLAttributes<T>, T extends HTMLElement>(\\n type: keyof ReactHTML,\\n props?: ClassAttributes<T> & P | null,\\n ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;\\n function createElement<P extends SVGAttributes<T>, T extends SVGElement>(\\n type: keyof ReactSVG,\\n props?: ClassAttributes<T> & P | null,\\n ...children: ReactNode[]): ReactSVGElement;\\n function createElement<P extends DOMAttributes<T>, T extends Element>(\\n type: string,\\n props?: ClassAttributes<T> & P | null,\\n ...children: ReactNode[]): DOMElement<P, T>;\\n\\n // Custom components\\n\\n function createElement<P extends {}>(\\n type: FunctionComponent<P>,\\n props?: Attributes & P | null,\\n ...children: ReactNode[]): FunctionComponentElement<P>;\\n function createElement<P extends {}>(\\n type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>,\\n props?: ClassAttributes<ClassicComponent<P, ComponentState>> & P | null,\\n ...children: ReactNode[]): CElement<P, ClassicComponent<P, ComponentState>>;\\n function createElement<P extends {}, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(\\n type: ClassType<P, T, C>,\\n props?: ClassAttributes<T> & P | null,\\n ...children: ReactNode[]): CElement<P, T>;\\n function createElement<P extends {}>(\\n type: FunctionComponent<P> | ComponentClass<P> | string,\\n props?: Attributes & P | null,\\n ...children: ReactNode[]): ReactElement<P>;\\n\\n // DOM Elements\\n // ReactHTMLElement\\n function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(\\n element: DetailedReactHTMLElement<P, T>,\\n props?: P,\\n ...children: ReactNode[]): DetailedReactHTMLElement<P, T>;\\n // ReactHTMLElement, less specific\\n function cloneElement<P extends HTMLAttributes<T>, T extends HTMLElement>(\\n element: ReactHTMLElement<T>,\\n props?: P,\\n ...children: ReactNode[]): ReactHTMLElement<T>;\\n // SVGElement\\n function cloneElement<P extends SVGAttributes<T>, T extends SVGElement>(\\n element: ReactSVGElement,\\n props?: P,\\n ...children: ReactNode[]): ReactSVGElement;\\n // DOM Element (has to be the last, because type checking stops at first overload that fits)\\n function cloneElement<P extends DOMAttributes<T>, T extends Element>(\\n element: DOMElement<P, T>,\\n props?: DOMAttributes<T> & P,\\n ...children: ReactNode[]): DOMElement<P, T>;\\n\\n // Custom components\\n function cloneElement<P>(\\n element: FunctionComponentElement<P>,\\n props?: Partial<P> & Attributes,\\n ...children: ReactNode[]): FunctionComponentElement<P>;\\n function cloneElement<P, T extends Component<P, ComponentState>>(\\n element: CElement<P, T>,\\n props?: Partial<P> & ClassAttributes<T>,\\n ...children: ReactNode[]): CElement<P, T>;\\n function cloneElement<P>(\\n element: ReactElement<P>,\\n props?: Partial<P> & Attributes,\\n ...children: ReactNode[]): ReactElement<P>;\\n\\n // Context via RenderProps\\n interface ProviderProps<T> {\\n value: T;\\n children?: ReactNode;\\n }\\n\\n interface ConsumerProps<T> {\\n children: (value: T) => ReactNode;\\n unstable_observedBits?: number;\\n }\\n\\n // TODO: similar to how Fragment is actually a symbol, the values returned from createContext,\\n // forwardRef and memo are actually objects that are treated specially by the renderer; see:\\n // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/ReactContext.js#L35-L48\\n // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/forwardRef.js#L42-L45\\n // https://github.com/facebook/react/blob/v16.6.0/packages/react/src/memo.js#L27-L31\\n // However, we have no way of telling the JSX parser that it's a JSX element type or its props other than\\n // by pretending to be a normal component.\\n //\\n // We don't just use ComponentType or SFC types because you are not supposed to attach statics to this\\n // object, but rather to the original function.\\n interface ExoticComponent<P = {}> {\\n /**\\n * **NOTE**: Exotic components are not callable.\\n */\\n (props: P): (ReactElement|null);\\n readonly $$typeof: symbol;\\n }\\n\\n interface NamedExoticComponent<P = {}> extends ExoticComponent<P> {\\n displayName?: string;\\n }\\n\\n interface ProviderExoticComponent<P> extends ExoticComponent<P> {\\n propTypes?: WeakValidationMap<P>;\\n }\\n\\n type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;\\n\\n // NOTE: only the Context object itself can get a displayName\\n // https://github.com/facebook/react-devtools/blob/e0b854e4c/backend/attachRendererFiber.js#L310-L325\\n type Provider<T> = ProviderExoticComponent<ProviderProps<T>>;\\n type Consumer<T> = ExoticComponent<ConsumerProps<T>>;\\n interface Context<T> {\\n Provider: Provider<T>;\\n Consumer: Consumer<T>;\\n displayName?: string;\\n }\\n function createContext<T>(\\n defaultValue: T,\\n calculateChangedBits?: (prev: T, next: T) => number\\n ): Context<T>;\\n\\n function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;\\n\\n const Children: ReactChildren;\\n const Fragment: ExoticComponent<{ children?: ReactNode }>;\\n const StrictMode: ExoticComponent<{ children?: ReactNode }>;\\n\\n interface SuspenseProps {\\n children?: ReactNode;\\n\\n /** A fallback react tree to show when a Suspense child (like React.lazy) suspends */\\n fallback: NonNullable<ReactNode>|null;\\n\\n // I tried looking at the code but I have no idea what it does.\\n // https://github.com/facebook/react/issues/13206#issuecomment-432489986\\n /**\\n * Not implemented yet, requires unstable_ConcurrentMode\\n */\\n // maxDuration?: number;\\n }\\n /**\\n * This feature is not yet available for server-side rendering.\\n * Suspense support will be added in a later release.\\n */\\n const Suspense: ExoticComponent<SuspenseProps>;\\n const version: string;\\n\\n /**\\n * {@link https://github.com/bvaughn/rfcs/blob/profiler/text/0000-profiler.md#detailed-design | API}\\n */\\n type ProfilerOnRenderCallback = (\\n id: string,\\n phase: \\\"mount\\\" | \\\"update\\\",\\n actualDuration: number,\\n baseDuration: number,\\n startTime: number,\\n commitTime: number,\\n interactions: Set<SchedulerInteraction>,\\n ) => void;\\n interface ProfilerProps {\\n children?: ReactNode;\\n id: string;\\n onRender: ProfilerOnRenderCallback;\\n }\\n\\n const unstable_Profiler: ExoticComponent<ProfilerProps>;\\n\\n //\\n // Component API\\n // ----------------------------------------------------------------------\\n\\n type ReactInstance = Component<any> | Element;\\n\\n // Base component for plain JS classes\\n // tslint:disable-next-line:no-empty-interface\\n interface Component<P = {}, S = {}, SS = any> extends ComponentLifecycle<P, S, SS> { }\\n class Component<P, S> {\\n // tslint won't let me format the sample code in a way that vscode likes it :(\\n /**\\n * If set, `this.context` will be set at runtime to the current value of the given Context.\\n *\\n * Usage:\\n *\\n * ```ts\\n * type MyContext = number\\n * const Ctx = React.createContext<MyContext>(0)\\n *\\n * class Foo extends React.Component {\\n * static contextType = Ctx\\n * context!: React.ContextType<typeof Ctx>\\n * render () {\\n * return <>My context's value: {this.context}</>;\\n * }\\n * }\\n * ```\\n *\\n * @see https://reactjs.org/docs/context.html#classcontexttype\\n */\\n static contextType?: Context<any>;\\n\\n /**\\n * If using the new style context, re-declare this in your class to be the\\n * `React.ContextType` of your `static contextType`.\\n *\\n * ```ts\\n * static contextType = MyContext\\n * context!: React.ContextType<typeof MyContext>\\n * ```\\n *\\n * @deprecated if used without a type annotation, or without static contextType\\n * @see https://reactjs.org/docs/legacy-context.html\\n */\\n // TODO (TypeScript 3.0): unknown\\n context: any;\\n\\n constructor(props: Readonly<P>);\\n /**\\n * @deprecated\\n * @see https://reactjs.org/docs/legacy-context.html\\n */\\n constructor(props: P, context?: any);\\n\\n // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.\\n // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257\\n // Also, the ` | S` allows intellisense to not be dumbisense\\n setState<K extends keyof S>(\\n state: ((prevState: Readonly<S>, props: Readonly<P>) => (Pick<S, K> | S | null)) | (Pick<S, K> | S | null),\\n callback?: () => void\\n ): void;\\n\\n forceUpdate(callBack?: () => void): void;\\n render(): ReactNode;\\n\\n // React.Props<T> is now deprecated, which means that the `children`\\n // property is not available on `P` by default, even though you can\\n // always pass children as variadic arguments to `createElement`.\\n // In the future, if we can define its call signature conditionally\\n // on the existence of `children` in `P`, then we should remove this.\\n readonly props: Readonly<P> & Readonly<{ children?: ReactNode }>;\\n state: Readonly<S>;\\n /**\\n * @deprecated\\n * https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs\\n */\\n refs: {\\n [key: string]: ReactInstance\\n };\\n }\\n\\n class PureComponent<P = {}, S = {}, SS = any> extends Component<P, S, SS> { }\\n\\n interface ClassicComponent<P = {}, S = {}> extends Component<P, S> {\\n replaceState(nextState: S, callback?: () => void): void;\\n isMounted(): boolean;\\n getInitialState?(): S;\\n }\\n\\n interface ChildContextProvider<CC> {\\n getChildContext(): CC;\\n }\\n\\n //\\n // Class Interfaces\\n // ----------------------------------------------------------------------\\n\\n /**\\n * @deprecated as of recent React versions, function components can no\\n * longer be considered 'stateless'. Please use `FunctionComponent` instead.\\n *\\n * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html)\\n */\\n type SFC<P = {}> = FunctionComponent<P>;\\n\\n /**\\n * @deprecated as of recent React versions, function components can no\\n * longer be considered 'stateless'. Please use `FunctionComponent` instead.\\n *\\n * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html)\\n */\\n type StatelessComponent<P = {}> = FunctionComponent<P>;\\n\\n type FC<P = {}> = FunctionComponent<P>;\\n\\n interface FunctionComponent<P = {}> {\\n (props: PropsWithChildren<P>, context?: any): ReactElement | null;\\n propTypes?: WeakValidationMap<P>;\\n contextTypes?: ValidationMap<any>;\\n defaultProps?: Partial<P>;\\n displayName?: string;\\n }\\n\\n interface RefForwardingComponent<T, P = {}> {\\n (props: PropsWithChildren<P>, ref: Ref<T>): ReactElement | null;\\n propTypes?: WeakValidationMap<P>;\\n contextTypes?: ValidationMap<any>;\\n defaultProps?: Partial<P>;\\n displayName?: string;\\n }\\n\\n interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {\\n new (props: P, context?: any): Component<P, S>;\\n propTypes?: WeakValidationMap<P>;\\n contextType?: Context<any>;\\n contextTypes?: ValidationMap<any>;\\n childContextTypes?: ValidationMap<any>;\\n defaultProps?: Partial<P>;\\n displayName?: string;\\n }\\n\\n interface ClassicComponentClass<P = {}> extends ComponentClass<P> {\\n new (props: P, context?: any): ClassicComponent<P, ComponentState>;\\n getDefaultProps?(): P;\\n }\\n\\n /**\\n * We use an intersection type to infer multiple type parameters from\\n * a single argument, which is useful for many top-level API defs.\\n * See https://github.com/Microsoft/TypeScript/issues/7234 for more info.\\n */\\n type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =\\n C &\\n (new (props: P, context?: any) => T);\\n\\n //\\n // Component Specs and Lifecycle\\n // ----------------------------------------------------------------------\\n\\n // This should actually be something like `Lifecycle<P, S> | DeprecatedLifecycle<P, S>`,\\n // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle\\n // methods are present.\\n interface ComponentLifecycle<P, S, SS = any> extends NewLifecycle<P, S, SS>, DeprecatedLifecycle<P, S> {\\n /**\\n * Called immediately after a component is mounted. Setting state here will trigger re-rendering.\\n */\\n componentDidMount?(): void;\\n /**\\n * Called to determine whether the change in props and state should trigger a re-render.\\n *\\n * `Component` always returns true.\\n * `PureComponent` implements a shallow comparison on props and state and returns true if any\\n * props or states have changed.\\n *\\n * If false is returned, `Component#render`, `componentWillUpdate`\\n * and `componentDidUpdate` will not be called.\\n */\\n shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;\\n /**\\n * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as\\n * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.\\n */\\n componentWillUnmount?(): void;\\n /**\\n * Catches exceptions generated in descendant components. Unhandled exceptions will cause\\n * the entire component tree to unmount.\\n */\\n componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;\\n }\\n\\n // Unfortunately, we have no way of declaring that the component constructor must implement this\\n interface StaticLifecycle<P, S> {\\n getDerivedStateFromProps?: GetDerivedStateFromProps<P, S>;\\n getDerivedStateFromError?: GetDerivedStateFromError<P, S>;\\n }\\n\\n type GetDerivedStateFromProps<P, S> =\\n /**\\n * Returns an update to a component's state based on its new props and old state.\\n *\\n * Note: its presence prevents any of the deprecated lifecycle methods from being invoked\\n */\\n (nextProps: Readonly<P>, prevState: S) => Partial<S> | null;\\n\\n type GetDerivedStateFromError<P, S> =\\n /**\\n * This lifecycle is invoked after an error has been thrown by a descendant component.\\n * It receives the error that was thrown as a parameter and should return a value to update state.\\n *\\n * Note: its presence prevents any of the deprecated lifecycle methods from being invoked\\n */\\n (error: any) => Partial<S> | null;\\n\\n // This should be \\\"infer SS\\\" but can't use it yet\\n interface NewLifecycle<P, S, SS> {\\n /**\\n * Runs before React applies the result of `render` to the document, and\\n * returns an object to be given to componentDidUpdate. Useful for saving\\n * things such as scroll position before `render` causes changes to it.\\n *\\n * Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated\\n * lifecycle events from running.\\n */\\n getSnapshotBeforeUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>): SS | null;\\n /**\\n * Called immediately after updating occurs. Not called for the initial render.\\n *\\n * The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.\\n */\\n componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot?: SS): void;\\n }\\n\\n interface DeprecatedLifecycle<P, S> {\\n /**\\n * Called immediately before mounting occurs, and before `Component#render`.\\n * Avoid introducing any side-effects or subscriptions in this method.\\n *\\n * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps\\n * prevents this from being invoked.\\n *\\n * @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path\\n */\\n componentWillMount?(): void;\\n /**\\n * Called immediately before mounting occurs, and before `Component#render`.\\n * Avoid introducing any side-effects or subscriptions in this method.\\n *\\n * This method will not stop working in React 17.\\n *\\n * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps\\n * prevents this from being invoked.\\n *\\n * @deprecated 16.3, use componentDidMount or the constructor instead\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path\\n */\\n UNSAFE_componentWillMount?(): void;\\n /**\\n * Called when the component may be receiving new props.\\n * React may call this even if props have not changed, so be sure to compare new and existing\\n * props if you only want to handle changes.\\n *\\n * Calling `Component#setState` generally does not trigger this method.\\n *\\n * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps\\n * prevents this from being invoked.\\n *\\n * @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path\\n */\\n componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;\\n /**\\n * Called when the component may be receiving new props.\\n * React may call this even if props have not changed, so be sure to compare new and existing\\n * props if you only want to handle changes.\\n *\\n * Calling `Component#setState` generally does not trigger this method.\\n *\\n * This method will not stop working in React 17.\\n *\\n * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps\\n * prevents this from being invoked.\\n *\\n * @deprecated 16.3, use static getDerivedStateFromProps instead\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path\\n */\\n UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;\\n /**\\n * Called immediately before rendering when new props or state is received. Not called for the initial render.\\n *\\n * Note: You cannot call `Component#setState` here.\\n *\\n * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps\\n * prevents this from being invoked.\\n *\\n * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path\\n */\\n componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;\\n /**\\n * Called immediately before rendering when new props or state is received. Not called for the initial render.\\n *\\n * Note: You cannot call `Component#setState` here.\\n *\\n * This method will not stop working in React 17.\\n *\\n * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps\\n * prevents this from being invoked.\\n *\\n * @deprecated 16.3, use getSnapshotBeforeUpdate instead\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update\\n * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path\\n */\\n UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;\\n }\\n\\n interface Mixin<P, S> extends ComponentLifecycle<P, S> {\\n mixins?: Array<Mixin<P, S>>;\\n statics?: {\\n [key: string]: any;\\n };\\n\\n displayName?: string;\\n propTypes?: ValidationMap<any>;\\n contextTypes?: ValidationMap<any>;\\n childContextTypes?: ValidationMap<any>;\\n\\n getDefaultProps?(): P;\\n getInitialState?(): S;\\n }\\n\\n interface ComponentSpec<P, S> extends Mixin<P, S> {\\n render(): ReactNode;\\n\\n [propertyName: string]: any;\\n }\\n\\n function createRef<T>(): RefObject<T>;\\n\\n // will show `ForwardRef(${Component.displayName || Component.name})` in devtools by default,\\n // but can be given its own specific name\\n interface ForwardRefExoticComponent<P> extends NamedExoticComponent<P> {\\n defaultProps?: Partial<P>;\\n }\\n\\n function forwardRef<T, P = {}>(Component: RefForwardingComponent<T, P>): ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;\\n\\n /** Ensures that the props do not include ref at all */\\n type PropsWithoutRef<P> =\\n // Just Pick would be sufficient for this, but I'm trying to avoid unnecessary mapping over union types\\n // https://github.com/Microsoft/TypeScript/issues/28339\\n 'ref' extends keyof P\\n ? Pick<P, Exclude<keyof P, 'ref'>>\\n : P;\\n /** Ensures that the props do not include string ref, which cannot be forwarded */\\n type PropsWithRef<P> =\\n // Just \\\"P extends { ref?: infer R }\\\" looks sufficient, but R will infer as {} if P is {}.\\n 'ref' extends keyof P\\n ? P extends { ref?: infer R }\\n ? string extends R\\n ? PropsWithoutRef<P> & { ref?: Exclude<R, string> }\\n : P\\n : P\\n : P;\\n\\n type PropsWithChildren<P> = P & { children?: ReactNode };\\n\\n /**\\n * NOTE: prefer ComponentPropsWithRef, if the ref is forwarded,\\n * or ComponentPropsWithoutRef when refs are not supported.\\n */\\n type ComponentProps<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> =\\n T extends JSXElementConstructor<infer P>\\n ? P\\n : T extends keyof JSX.IntrinsicElements\\n ? JSX.IntrinsicElements[T]\\n : {};\\n type ComponentPropsWithRef<T extends ElementType> =\\n T extends ComponentClass<infer P>\\n ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>\\n : PropsWithRef<ComponentProps<T>>;\\n type ComponentPropsWithoutRef<T extends ElementType> =\\n PropsWithoutRef<ComponentProps<T>>;\\n\\n // will show `Memo(${Component.displayName || Component.name})` in devtools by default,\\n // but can be given its own specific name\\n type MemoExoticComponent<T extends ComponentType<any>> = NamedExoticComponent<ComponentPropsWithRef<T>> & {\\n readonly type: T;\\n };\\n\\n function memo<P extends object>(\\n Component: SFC<P>,\\n propsAreEqual?: (prevProps: Readonly<PropsWithChildren<P>>, nextProps: Readonly<PropsWithChildren<P>>) => boolean\\n ): NamedExoticComponent<P>;\\n function memo<T extends ComponentType<any>>(\\n Component: T,\\n propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean\\n ): MemoExoticComponent<T>;\\n\\n type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {\\n readonly _result: T;\\n };\\n\\n function lazy<T extends ComponentType<any>>(\\n factory: () => Promise<{ default: T }>\\n ): LazyExoticComponent<T>;\\n\\n //\\n // React Hooks\\n // ----------------------------------------------------------------------\\n\\n // based on the code in https://github.com/facebook/react/pull/13968\\n\\n // Unlike the class component setState, the updates are not allowed to be partial\\n type SetStateAction<S> = S | ((prevState: S) => S);\\n // this technically does accept a second argument, but it's already under a deprecation warning\\n // and it's not even released so probably better to not define it.\\n type Dispatch<A> = (value: A) => void;\\n // Unlike redux, the actions _can_ be anything\\n type Reducer<S, A> = (prevState: S, action: A) => S;\\n // types used to try and prevent the compiler from reducing S\\n // to a supertype common with the second argument to useReducer()\\n type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any> ? S : never;\\n type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<any, infer A> ? A : never;\\n // The identity check is done with the SameValue algorithm (Object.is), which is stricter than ===\\n // TODO (TypeScript 3.0): ReadonlyArray<unknown>\\n type DependencyList = ReadonlyArray<any>;\\n\\n // NOTE: callbacks are _only_ allowed to return either void, or a destructor.\\n // The destructor is itself only allowed to return void.\\n type EffectCallback = () => (void | (() => void | undefined));\\n\\n interface MutableRefObject<T> {\\n current: T;\\n }\\n\\n // This will technically work if you give a Consumer<T> or Provider<T> but it's deprecated and warns\\n /**\\n * Accepts a context object (the value returned from `React.createContext`) and returns the current\\n * context value, as given by the nearest context provider for the given context.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\\n */\\n function useContext<T>(context: Context<T>/*, (not public API) observedBits?: number|boolean */): T;\\n /**\\n * Returns a stateful value, and a function to update it.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\\n */\\n function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];\\n // convenience overload when first argument is ommitted\\n /**\\n * Returns a stateful value, and a function to update it.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\\n */\\n function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];\\n /**\\n * An alternative to `useState`.\\n *\\n * `useReducer` is usually preferable to `useState` when you have complex state logic that involves\\n * multiple sub-values. It also lets you optimize performance for components that trigger deep\\n * updates because you can pass `dispatch` down instead of callbacks.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\\n */\\n // overload where \\\"I\\\" may be a subset of ReducerState<R>; used to provide autocompletion.\\n // If \\\"I\\\" matches ReducerState<R> exactly then the last overload will allow initializer to be ommitted.\\n // the last overload effectively behaves as if the identity function (x => x) is the initializer.\\n function useReducer<R extends Reducer<any, any>, I>(\\n reducer: R,\\n initializerArg: I & ReducerState<R>,\\n initializer: (arg: I & ReducerState<R>) => ReducerState<R>\\n ): [ReducerState<R>, Dispatch<ReducerAction<R>>];\\n /**\\n * An alternative to `useState`.\\n *\\n * `useReducer` is usually preferable to `useState` when you have complex state logic that involves\\n * multiple sub-values. It also lets you optimize performance for components that trigger deep\\n * updates because you can pass `dispatch` down instead of callbacks.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\\n */\\n // overload for free \\\"I\\\"; all goes as long as initializer converts it into \\\"ReducerState<R>\\\".\\n function useReducer<R extends Reducer<any, any>, I>(\\n reducer: R,\\n initializerArg: I,\\n initializer: (arg: I) => ReducerState<R>\\n ): [ReducerState<R>, Dispatch<ReducerAction<R>>];\\n /**\\n * An alternative to `useState`.\\n *\\n * `useReducer` is usually preferable to `useState` when you have complex state logic that involves\\n * multiple sub-values. It also lets you optimize performance for components that trigger deep\\n * updates because you can pass `dispatch` down instead of callbacks.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\\n */\\n\\n // I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.\\n // The Flow types do have an overload for 3-ary invocation with undefined initializer.\\n\\n // NOTE: without the ReducerState indirection, TypeScript would reduce S to be the most common\\n // supertype between the reducer's return type and the initialState (or the initializer's return type),\\n // which would prevent autocompletion from ever working.\\n\\n // TODO: double-check if this weird overload logic is necessary. It is possible it's either a bug\\n // in older versions, or a regression in newer versions of the typescript completion service.\\n function useReducer<R extends Reducer<any, any>>(\\n reducer: R,\\n initialState: ReducerState<R>,\\n initializer?: undefined\\n ): [ReducerState<R>, Dispatch<ReducerAction<R>>];\\n /**\\n * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument\\n * (`initialValue`). The returned object will persist for the full lifetime of the component.\\n *\\n * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable\\n * value around similar to how you’d use instance fields in classes.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#useref\\n */\\n // TODO (TypeScript 3.0): <T extends unknown>\\n function useRef<T>(initialValue: T): MutableRefObject<T>;\\n // convenience overload for refs given as a ref prop as they typically start with a null value\\n /**\\n * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument\\n * (`initialValue`). The returned object will persist for the full lifetime of the component.\\n *\\n * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable\\n * value around similar to how you’d use instance fields in classes.\\n *\\n * Usage note: if you need the result of useRef to be directly mutable, include `| null` in the type\\n * of the generic argument.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#useref\\n */\\n // TODO (TypeScript 3.0): <T extends unknown>\\n function useRef<T>(initialValue: T|null): RefObject<T>;\\n // convenience overload for potentially undefined initialValue / call with 0 arguments\\n // has a default to stop it from defaulting to {} instead\\n /**\\n * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument\\n * (`initialValue`). The returned object will persist for the full lifetime of the component.\\n *\\n * Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable\\n * value around similar to how you’d use instance fields in classes.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#useref\\n */\\n // TODO (TypeScript 3.0): <T extends unknown>\\n function useRef<T = undefined>(): MutableRefObject<T | undefined>;\\n /**\\n * The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations.\\n * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside\\n * `useLayoutEffect` will be flushed synchronously, before the browser has a chance to paint.\\n *\\n * Prefer the standard `useEffect` when possible to avoid blocking visual updates.\\n *\\n * If you’re migrating code from a class component, `useLayoutEffect` fires in the same phase as\\n * `componentDidMount` and `componentDidUpdate`.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\\n */\\n function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;\\n /**\\n * Accepts a function that contains imperative, possibly effectful code.\\n *\\n * @param effect Imperative function that can return a cleanup function\\n * @param deps If present, effect will only activate if the values in the list change.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\\n */\\n function useEffect(effect: EffectCallback, deps?: DependencyList): void;\\n // NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>\\n /**\\n * `useImperativeHandle` customizes the instance value that is exposed to parent components when using\\n * `ref`. As always, imperative code using refs should be avoided in most cases.\\n *\\n * `useImperativeHandle` should be used with `React.forwardRef`.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\\n */\\n function useImperativeHandle<T, R extends T>(ref: Ref<T>|undefined, init: () => R, deps?: DependencyList): void;\\n // I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key\\n // useCallback(X) is identical to just using X, useMemo(() => Y) is identical to just using Y.\\n /**\\n * `useCallback` will return a memoized version of the callback that only changes if one of the `inputs`\\n * has changed.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\\n */\\n // TODO (TypeScript 3.0): <T extends (...args: never[]) => unknown>\\n function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;\\n /**\\n * `useMemo` will only recompute the memoized value when one of the `deps` has changed.\\n *\\n * Usage note: if calling `useMemo` with a referentially stable function, also give it as the input in\\n * the second argument.\\n *\\n * ```ts\\n * function expensive () { ... }\\n *\\n * function Component () {\\n * const expensiveResult = useMemo(expensive, [expensive])\\n * return ...\\n * }\\n * ```\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\\n */\\n // allow undefined, but don't make it optional as that is very likely a mistake\\n function useMemo<T>(factory: () => T, deps: DependencyList | undefined): T;\\n /**\\n * `useDebugValue` can be used to display a label for custom hooks in React DevTools.\\n *\\n * NOTE: We don’t recommend adding debug values to every custom hook.\\n * It’s most valuable for custom hooks that are part of shared libraries.\\n *\\n * @version 16.8.0\\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\\n */\\n // the name of the custom hook is itself derived from the function name at runtime:\\n // it's just the function name without the \\\"use\\\" prefix.\\n function useDebugValue<T>(value: T, format?: (value: T) => any): void;\\n\\n //\\n // Event System\\n // ----------------------------------------------------------------------\\n // TODO: change any to unknown when moving to TS v3\\n interface BaseSyntheticEvent<E = object, C = any, T = any> {\\n nativeEvent: E;\\n currentTarget: C;\\n target: T;\\n bubbles: boolean;\\n cancelable: boolean;\\n defaultPrevented: boolean;\\n eventPhase: number;\\n isTrusted: boolean;\\n preventDefault(): void;\\n isDefaultPrevented(): boolean;\\n stopPropagation(): void;\\n isPropagationStopped(): boolean;\\n persist(): void;\\n timeStamp: number;\\n type: string;\\n }\\n\\n /**\\n * currentTarget - a reference to the element on which the event listener is registered.\\n *\\n * target - a reference to the element from which the event was originally dispatched.\\n * This might be a child element to the element on which the event listener is registered.\\n * If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12239\\n */\\n interface SyntheticEvent<T = Element, E = Event> extends BaseSyntheticEvent<E, EventTarget & T, EventTarget> {}\\n\\n interface ClipboardEvent<T = Element> extends SyntheticEvent<T, NativeClipboardEvent> {\\n clipboardData: DataTransfer;\\n }\\n\\n interface CompositionEvent<T = Element> extends SyntheticEvent<T, NativeCompositionEvent> {\\n data: string;\\n }\\n\\n interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> {\\n dataTransfer: DataTransfer;\\n }\\n\\n interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> {\\n pointerId: number;\\n pressure: number;\\n tiltX: number;\\n tiltY: number;\\n width: number;\\n height: number;\\n pointerType: 'mouse' | 'pen' | 'touch';\\n isPrimary: boolean;\\n }\\n\\n interface FocusEvent<T = Element> extends SyntheticEvent<T, NativeFocusEvent> {\\n relatedTarget: EventTarget;\\n target: EventTarget & T;\\n }\\n\\n // tslint:disable-next-line:no-empty-in