mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
d7067c29c8
* 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
55 lines
2.2 KiB
TypeScript
55 lines
2.2 KiB
TypeScript
// TODO: some interface need to be designed in a module called 'Application' and 'Network'
|
|
declare module 'pal/system-info' {
|
|
export interface SupportCapability {
|
|
readonly webp: boolean;
|
|
readonly gl: boolean;
|
|
readonly canvas: boolean;
|
|
readonly imageBitmap: boolean;
|
|
}
|
|
|
|
class SystemInfo {
|
|
public get networkType (): import('pal/system-info/enum-type/network-type').NetworkType;
|
|
public get isNative (): boolean;
|
|
public get isBrowser (): boolean;
|
|
public get isMobile (): boolean;
|
|
public get isLittleEndian (): boolean;
|
|
/**
|
|
* Platform is a spacial field which is related to the build platform you choose on the Builder Panel in Cocos Creator.
|
|
* It may point to an OS like Android or iOS.
|
|
* It may point to a phone brand like vivo or OPPO.
|
|
* Also it may point to an app channel like WeChat or ByteDance.
|
|
*/
|
|
public get platform (): import('pal/system-info/enum-type').Platform;
|
|
/**
|
|
* This is the language code typed as `Language`.
|
|
*/
|
|
public get language (): import('pal/system-info/enum-type').Language;
|
|
/**
|
|
* This is the native value return by platform
|
|
* The valid value can be 'zh-tw','en','en-us','fr','fr-fr','es-es' and so on.
|
|
*/
|
|
public get nativeLanguage (): string;
|
|
public get os (): import('pal/system-info/enum-type').OS;
|
|
public get osVersion (): string;
|
|
public get osMainVersion (): number;
|
|
public get browserType (): import('pal/system-info/enum-type').BrowserType;
|
|
public get browserVersion (): string;
|
|
public get pixelRatio (): number;
|
|
public get supportCapability (): SupportCapability;
|
|
public getBatteryLevel (): number;
|
|
|
|
public triggerGC (): void;
|
|
public openURL (url: string): void;
|
|
public now (): number;
|
|
public restartJSVM (): void;
|
|
|
|
public close ();
|
|
|
|
on (event: import('pal/system-info/enum-type').PalSystemEvent, cb: (...args: any)=>void, target?: any);
|
|
off (event: import('pal/system-info/enum-type').PalSystemEvent, cb?: (...args: any)=>void, target?: any);
|
|
// TODO: support onError
|
|
}
|
|
|
|
export const systemInfo: SystemInfo;
|
|
}
|