Files
cocos4/@types/pal/screen-adapter.d.ts
T
PP d7067c29c8 deprecate interface in View module && support pal/screenManager (#8836)
* remove BrowserGetter

* deprecated view.adjustViewportMeta

* deprecate view.enableAutoFullScreen and view.isAutoFullScreenEnabled

* remove view._adjustSizeKeepCanvasSize

* remove view._convertMouseToLocation, view._convertTouchWidthScale and view._convertTouchesWithScale

* remove view._originalDesignResolutionSize

* deprecate cc.winSize and cc.visibleRect

update

* access local winSize

* access local visibleRect

* deprecate view.getVisibleOrigin view.getVisibleOriginInPixel

* Revert "deprecate view.getVisibleOrigin view.getVisibleOriginInPixel"

This reverts commit 1ae9e1d5c51d8c701eaa2e4a65cd4c17e5f6d971.

* Revert "deprecate cc.visibleRect"

* optimize screen module

update

* update

update

* optimize deprecation info

* rename pal/system to pal/systemInfo

* update pal/systemInfo access in engine layer

* support pal/screenManager

* update pal/screenManager access in engine layer

* fix bug

* optimize deprecation info

* fix auto fullscreen

* fix ci

* fix ci

* update change request

update

update

* fix CI
2021-07-09 18:57:03 +08:00

61 lines
2.2 KiB
TypeScript

declare module 'pal/screen-adapter' {
export interface SafeAreaEdge {
top: number;
bottom: number;
left: number;
right: number;
}
class ScreenAdapter {
/**
* Query whether fullscreen feature is supported on the current platform.
*/
public get supportFullScreen (): boolean;
/**
* Query the current fullscreen state.
*/
public get isFullScreen (): boolean;
/**
* Get the size of current window.
* On Web platform, this should be the size of game frame.
*/
public get windowSize (): import('cocos/core/math').Size;
/**
* Set the size of current window.
* On Web platform, this should be the size of game frame.
* @param {Size} Specify the size that the window need to resize to.
* @todo not implemented yet
*/
public set windowSize (size: import('cocos/core/math').Size);
/**
* Get the orientation of current game.
* Available on mobile related platform.
*/
public get orientation (): import('pal/screen-adapter/enum-type').Orientation;
/**
* Get the SafeAreaEdge based on the screen coordinate system.
* @return {SafeAreaEdge} An interface displaying the distance of the sides 'top', 'bottom', 'left' and 'right'.
*/
public get safeAreaEdge (): SafeAreaEdge;
/**
* Asynchronously request fullscreen
* If failed to request fullscreen, another attempt will be made to request fullscreen the next time a user interaction occurs.
* @returns Promise to request fullscreen
*/
public requestFullScreen (): Promise<void>;
/**
* Asynchronously exit fullscreen
* @returns Promise to exit fullscreen
*/
public exitFullScreen (): Promise<void>;
on (event: import('pal/screen-adapter/enum-type').PalScreenEvent, cb: (...args: any)=>void, target?: any);
off (event: import('pal/screen-adapter/enum-type').PalScreenEvent, cb?: (...args: any)=>void, target?: any);
}
export const screenAdapter: ScreenAdapter;
}