mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-07 00:02:53 +08:00
* support feature query in pal/system-info * support sys.hasFeature and deprecate sys.capabilities * remove deprecated usage * support input feature query update * IMAGE_BITMAP * INPUT_TOUCH * WEBGL * support WEB_VIEW, VIDEO_PLAYER, SAFE_AREA query * rename INPUT_XXX to EVENT_XXX * support device-manager update update update * add NOTE * export deviceManager from gfx * fix circular dependency * fix wechat devtools update * Revert "fix circular dependency" This reverts commitba8a6c0e2e. * Revert "export deviceManager from gfx" This reverts commit14b26ca0e3. * Revert "support device-manager" This reverts commit010a910e56. # Conflicts: # pal/system-info/enum-type/feature.ts * update update * use INPUT_TOUCH for sys.capabilities * update
69 lines
2.2 KiB
TypeScript
69 lines
2.2 KiB
TypeScript
declare module 'pal/input' {
|
|
type TouchCallback = (res: import('cocos/input/types').EventTouch) => void;
|
|
/**
|
|
* Class designed for touch input.
|
|
*/
|
|
export class TouchInputSource {
|
|
/**
|
|
* Register the touch event callback.
|
|
*/
|
|
public on (eventType: import('cocos/input/types/event-enum').InputEventType, callback: TouchCallback, target?: any);
|
|
}
|
|
|
|
type MouseCallback = (res: import('cocos/input/types').EventMouse) => void;
|
|
/**
|
|
* Class designed for mouse input.
|
|
*/
|
|
export class MouseInputSource {
|
|
/**
|
|
* Register the mouse event callback.
|
|
*/
|
|
public on (eventType: import('cocos/input/types/event-enum').InputEventType, callback: MouseCallback, target?: any);
|
|
}
|
|
|
|
type KeyboardCallback = (res: import('cocos/input/types').EventKeyboard) => void;
|
|
/**
|
|
* Class Designed for keyboard input.
|
|
*/
|
|
export class KeyboardInputSource {
|
|
/**
|
|
* Register the keyboard event callback.
|
|
*/
|
|
public on (eventType: import('cocos/input/types/event-enum').InputEventType, callback: KeyboardCallback, target?: any);
|
|
}
|
|
|
|
/**
|
|
* Class designed for gamepad input
|
|
*/
|
|
export class GamepadInputSource {
|
|
// TODO: add more details for GamepadInputSource class
|
|
}
|
|
|
|
type AccelerometerCallback = (res: import('cocos/input/types').EventAcceleration) => void;
|
|
/**
|
|
* Class designed for accelerometer input
|
|
*/
|
|
export class AccelerometerInputSource {
|
|
/**
|
|
* Asynchronously start the accelerometer.
|
|
* TODO: return a promise.
|
|
*/
|
|
public start ();
|
|
/**
|
|
* Stop the accelerometer.
|
|
* TODO: return a promise.
|
|
*/
|
|
public stop ();
|
|
/**
|
|
* Set interval of the accelerometer callback.
|
|
* The interval is in mile seconds.
|
|
* @param intervalInMileSeconds interval in mile seconds.
|
|
*/
|
|
public setInterval (intervalInMileSeconds: number);
|
|
/**
|
|
* Register the acceleration event callback.
|
|
*/
|
|
public on (eventType: import('cocos/input/types/event-enum').InputEventType, callback: AccelerometerCallback, target?: any);
|
|
}
|
|
}
|