UNPKG

@niuee/board

Version:

<h1 align="center"> board </h1> <p align="center"> board supercharges your html canvas element giving it the capabilities to pan, zoom, rotate, and much more. </p> <p align="center"> <a href="https://www.npmjs.com/package/@niuee/board">

43 lines (42 loc) 1.84 kB
import { InputFlowControl } from "./interface"; import { Point } from "../util/misc"; import { ObservableBoardCamera } from "../board-camera"; import { PanControlStateMachine } from "./pan-control-state-machine"; import { ZoomControlStateMachine } from "./zoom-control-state-machine"; import { CameraRig } from "../board-camera/camera-rig"; /** * @description The flow control with animation and lock input. * * This is a customized input flow control that suits a specific use case. * * You can use the default one ({@link SimpleRelayFlowControl}) instead or implement your own. * * The internal ruleset on which input is used and which is ignored is controlled by the state machines. * * @category Input Flow Control */ export declare class FlowControlWithAnimationAndLockInput implements InputFlowControl { private _panStateMachine; private _zoomStateMachine; constructor(panStateMachine: PanControlStateMachine, zoomStateMachine: ZoomControlStateMachine); notifyPanToAnimationInput(target: Point): void; notifyPanInput(delta: Point): void; notifyZoomInput(delta: number, at: Point): void; notifyZoomInputAnimation(targetZoom: number, at?: Point): void; notifyZoomInputAnimationWorld(targetZoom: number, at?: Point): void; notifyRotationInput(delta: number): void; initatePanTransition(): void; initateZoomTransition(): void; } /** * @description Create a flow control that allows animation and lock inputs. * * @category Input Flow Control */ export declare function createFlowControlWithAnimationAndLock(camera: ObservableBoardCamera): InputFlowControl; /** * @description Create a default flow control with a camera rig. * * @category Input Flow Control */ export declare function createFlowControlWithAnimationAndLockWithCameraRig(cameraRig: CameraRig): InputFlowControl;