@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
63 lines • 2.11 kB
TypeScript
import * as React from 'react';
export interface InputProviderProps {
provideIntent?: boolean;
container?: HTMLElement | React.RefObject<HTMLElement>;
}
export declare enum InputType {
Initial = "initial",
Keyboard = "keyboard",
Mouse = "mouse",
Pointer = "pointer",
Touch = "touch"
}
export declare enum InputEventType {
KeyDown = "keydown",
KeyUp = "keyup",
MouseDown = "mousedown",
MouseMove = "mousemove",
Wheel = "wheel",
MouseWheel = "mousewheel",
PointerDown = "pointerdown",
PointerMove = "pointermove",
TouchStart = "touchstart"
}
type InputEvent = Event | React.KeyboardEvent | React.MouseEvent | React.TouchEvent | React.PointerEvent;
export declare const inputEventMap: {
keydown: InputType;
keyup: InputType;
mousedown: InputType;
mousemove: InputType;
wheel: InputType;
mousewheel: InputType;
pointerdown: InputType;
pointermove: InputType;
touchstart: InputType;
};
/**
* This component takes heavy inspiration from what-input (https://github.com/ten1seven/what-input)
*/
export declare class InputProvider extends React.Component<React.PropsWithChildren<InputProviderProps>> {
private eventTimer;
private currentInput;
private currentIntent;
private supportsPassive;
private isBuffering;
private isScrolling;
private mousePosX;
private mousePosY;
private deferInputTracking;
constructor(props: any);
provideIntent: boolean | undefined;
getContainer(container?: HTMLElement | React.RefObject<HTMLElement>): HTMLElement;
componentDidMount(): void;
updateAttributes(): void;
componentWillUnmount(): void;
enableListeners(enable: boolean): void;
setInput(event: InputEvent): void;
setIntent(event: InputEvent): void;
eventBuffer(event: Event): void;
detectScrolling(event: React.MouseEvent): void;
render(): string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null;
}
export default InputProvider;
//# sourceMappingURL=InputProvider.d.ts.map