Move non-state methods into MouseService

Fixes #5756
This commit is contained in:
Daniel Imms
2026-03-11 10:49:55 +09:00
parent d63445be94
commit 5f3a4646be
8 changed files with 190 additions and 327 deletions
+6 -32
View File
@@ -43,43 +43,17 @@ export interface IMouseStateService {
addProtocol(name: string, protocol: ICoreMouseProtocol): void;
addEncoding(name: string, encoding: CoreMouseEncoding): void;
reset(): void;
/**
* Triggers a mouse event to be sent.
*
* Returns true if the event passed all protocol restrictions and a report
* was sent, otherwise false. The return value may be used to decide whether
* the default event action in the bowser component should be omitted.
*
* Note: The method will change values of the given event object
* to fullfill protocol and encoding restrictions.
*/
triggerMouseEvent(event: ICoreMouseEvent): boolean;
setCustomWheelEventHandler(customWheelEventHandler: ((event: WheelEvent) => boolean) | undefined): void;
allowCustomWheelEvent(ev: WheelEvent): boolean;
/**
* Event to announce changes in mouse tracking.
*/
onProtocolChange: IEvent<CoreMouseEventType>;
/**
* Human readable version of mouse events.
*/
explainEvents(events: CoreMouseEventType): { [event: string]: boolean };
/**
* Process wheel event taking partial scroll into account.
*/
consumeWheelEvent(ev: WheelEvent, cellHeight?: number, dpr?: number): number;
/**
* Sets a custom wheel event handler that can veto wheel processing.
*/
setCustomWheelEventHandler(customWheelEventHandler: ((event: WheelEvent) => boolean) | undefined): void;
/**
* Checks whether a wheel event should be processed.
*/
allowCustomWheelEvent(ev: WheelEvent): boolean;
restrictMouseEvent(event: ICoreMouseEvent): boolean;
encodeMouseEvent(event: ICoreMouseEvent): string;
readonly isDefaultEncoding: boolean;
readonly isPixelEncoding: boolean;
}
export const ICoreService = createDecorator<ICoreService>('CoreService');