UNPKG

@react-financial-charts/utils

Version:
60 lines (59 loc) 4 kB
import * as React from "react"; import { Props as AutoSizerProps } from "react-virtualized-auto-sizer"; export interface WithSizeProps { readonly width: number; readonly height: number; } export declare const withSize: (props?: Omit<AutoSizerProps, "children">) => <TProps extends WithSizeProps>(OriginalComponent: React.ComponentClass<TProps, any>) => { new (props: Omit<TProps, "height" | "width"> | Readonly<Omit<TProps, "height" | "width">>): { render(): JSX.Element; context: any; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<TProps, "height" | "width">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly<Omit<TProps, "height" | "width">> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<TProps, "height" | "width">>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly<Omit<TProps, "height" | "width">>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: Omit<TProps, "height" | "width">, context: any): { render(): JSX.Element; context: any; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<TProps, "height" | "width">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly<Omit<TProps, "height" | "width">> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<TProps, "height" | "width">>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly<Omit<TProps, "height" | "width">>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextState: Readonly<{}>, nextContext: any): void; }; contextType?: React.Context<any> | undefined; };