mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
f433551d1d
* 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 commit ba8a6c0e2e4fa6b2015ae438a4c9a5da94b9bf46. * Revert "export deviceManager from gfx" This reverts commit 14b26ca0e3f6e0dce32c37bd668c65193dbd366f. * Revert "support device-manager" This reverts commit 010a910e56e1ee2fe9726629fca163fc24ed5b37. # Conflicts: # pal/system-info/enum-type/feature.ts * update update * use INPUT_TOUCH for sys.capabilities * update
53 lines
2.2 KiB
TypeScript
53 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 type IFeatureMap = {
|
|
[feature in import('pal/system-info/enum-type').Feature]: 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 hasFeature (feature: import('pal/system-info/enum-type').Feature): boolean;
|
|
|
|
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;
|
|
}
|