@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
76 lines • 4.66 kB
TypeScript
/** @packageDocumentation
* @module Common
*/
import * as React from "react";
/** Properties for [[withIsPressed]] React higher-order component
* @public
* @deprecated in 4.15.0. Props of deprecated {@link withIsPressed} HOC.
*/
export interface WithIsPressedProps {
/** initial value for pressed status */
isPressed?: boolean;
/** callback function for [isPressed] change */
onIsPressedChange?: (isPressed: boolean) => void;
}
/** withIsPressed is a React higher-order component that adds pointer and mouse events.
* @public
* @deprecated in 4.15.0. Not used by AppUI.
*/
export declare const withIsPressed: <ComponentProps extends object>(Component: React.ComponentType<ComponentProps>) => {
new (props: ComponentProps & WithIsPressedProps): {
handleOnPointerDown: () => void;
handleOnPointerUp: () => void;
handleOnMouseLeave: () => void;
changeIsPressed: (isPressed: boolean) => void;
render(): React.JSX.Element;
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps & WithIsPressedProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<ComponentProps & WithIsPressedProps>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentProps & WithIsPressedProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<ComponentProps & WithIsPressedProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextState: Readonly<{}>, nextContext: any): void;
};
new (props: ComponentProps & WithIsPressedProps, context: any): {
handleOnPointerDown: () => void;
handleOnPointerUp: () => void;
handleOnMouseLeave: () => void;
changeIsPressed: (isPressed: boolean) => void;
render(): React.JSX.Element;
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps & WithIsPressedProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<ComponentProps & WithIsPressedProps>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentProps & WithIsPressedProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<ComponentProps & WithIsPressedProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps & WithIsPressedProps>, nextState: Readonly<{}>, nextContext: any): void;
};
contextType?: React.Context<any> | undefined;
};
//# sourceMappingURL=withIsPressed.d.ts.map