/** * Copyright 2023-present DreamNum Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { IPoint } from '@univerjs/engine-render'; import { Disposable } from '@univerjs/core'; export interface IMobileCanvasGestureOptions { start: (point: IPoint) => 'pan' | 'object' | 'ignore'; tap: (point: IPoint) => void; pan: (delta: IPoint) => void; pinch: (factor: number, previousCenter: IPoint, center: IPoint) => void; finishObjectTransform: () => void; endPinch: () => void; } /** Routes touch browsing separately from the canvas's existing object manipulation. */ export declare class MobileCanvasGesture extends Disposable { private readonly _canvas; private readonly _options; private readonly _points; private _objectPointerId; private _cancellingObject; private _startPoint; private _moved; private _pinching; private _suppressClick; private _lastMoveTime; private _velocity; private _frame; constructor(_canvas: HTMLCanvasElement, _options: IMobileCanvasGestureOptions); private _point; private _consume; private _onDown; private _onMove; private _onEnd; private _startInertia; private _stopInertia; private _reset; private _cancelObjectPointer; }