@yandex/ui
Version:
Yandex UI components
64 lines (63 loc) • 3.51 kB
TypeScript
import React, { ComponentType, Ref } from 'react';
export interface IWithAutoFocusProps {
/** Активное состояние. */
focused?: boolean;
/** Ссылка на нативный контрол. */
controlRef?: Ref<HTMLElement>;
}
export declare const withAutoFocus: <TProps extends IWithAutoFocusProps>(WrappedComponent: React.ComponentType<TProps>) => {
new (props: Readonly<TProps>): {
readonly controlRef: React.RefObject<HTMLElement>;
componentDidUpdate(prevProps: TProps): void;
render(): JSX.Element;
context: any;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callBack?: (() => void) | undefined): void;
readonly props: Readonly<TProps> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
};
new (props: TProps, context?: any): {
readonly controlRef: React.RefObject<HTMLElement>;
componentDidUpdate(prevProps: TProps): void;
render(): JSX.Element;
context: any;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callBack?: (() => void) | undefined): void;
readonly props: Readonly<TProps> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<TProps>, prevState: Readonly<{}>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<TProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<TProps>, nextState: Readonly<{}>, nextContext: any): void;
};
displayName: string;
contextType?: React.Context<any> | undefined;
};