mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
2
packages/core/index.d.ts
vendored
2
packages/core/index.d.ts
vendored
@@ -42,7 +42,7 @@ export type { ImageAssetOptions } from './image-asset';
|
||||
export { ImageSource } from './image-source';
|
||||
export { ModuleNameResolver, _setResolver } from './module-name-resolver';
|
||||
export type { ModuleListProvider, PlatformContext } from './module-name-resolver';
|
||||
export { isAndroid, isIOS, Screen, Device, platformNames } from './platform';
|
||||
export { isAndroid, isIOS, isVisionOS, isApple, Screen, Device, platformNames } from './platform';
|
||||
export type { IDevice } from './platform';
|
||||
export { profile, enable as profilingEnable, disable as profilingDisable, time as profilingTime, uptime as profilingUptime, start as profilingStart, stop as profilingStop, isRunning as profilingIsRunning, dumpProfiles as profilingDumpProfiles, resetProfiles as profilingResetProfiles, startCPUProfile as profilingStartCPU, stopCPUProfile as profilingStopCPU } from './profiling';
|
||||
export type { InstrumentationMode, TimerInfo } from './profiling';
|
||||
|
||||
@@ -33,7 +33,7 @@ export type { ImageAssetOptions } from './image-asset';
|
||||
export { ImageSource } from './image-source';
|
||||
export { ModuleNameResolver, _setResolver } from './module-name-resolver';
|
||||
export type { ModuleListProvider, PlatformContext } from './module-name-resolver';
|
||||
export { isAndroid, isIOS, Screen, Device, platformNames } from './platform';
|
||||
export { isAndroid, isIOS, isVisionOS, isApple, Screen, Device, platformNames } from './platform';
|
||||
export type { IDevice } from './platform';
|
||||
|
||||
// Profiling
|
||||
|
||||
@@ -5,6 +5,7 @@ export const platformNames = {
|
||||
android: 'Android',
|
||||
ios: 'iOS',
|
||||
visionos: 'visionOS',
|
||||
apple: 'apple',
|
||||
};
|
||||
|
||||
export const isAndroid = !!__ANDROID__;
|
||||
|
||||
@@ -17,6 +17,7 @@ import { xml2ui } from './xml2ui';
|
||||
export const ios = platformNames.ios.toLowerCase();
|
||||
export const android = platformNames.android.toLowerCase();
|
||||
export const visionos = platformNames.visionos.toLowerCase();
|
||||
export const apple = platformNames.apple.toLowerCase();
|
||||
export const defaultNameSpaceMatcher = /tns\.xsd$/i;
|
||||
|
||||
export interface LoadOptions {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { getComponentModule } from './component-builder';
|
||||
import type { ComponentModule } from './component-builder';
|
||||
import { Device } from '../../platform';
|
||||
import { profile } from '../../profiling';
|
||||
import { android, ios, visionos, loadCustomComponent, defaultNameSpaceMatcher, getExports, Builder } from './index';
|
||||
import { android, ios, visionos, apple, loadCustomComponent, defaultNameSpaceMatcher, getExports, Builder } from './index';
|
||||
|
||||
export namespace xml2ui {
|
||||
/**
|
||||
@@ -135,14 +135,15 @@ export namespace xml2ui {
|
||||
if (value) {
|
||||
const toLower = value.toLowerCase();
|
||||
|
||||
return toLower === android || toLower === ios || toLower === visionos;
|
||||
return toLower === android || toLower === ios || toLower === visionos || toLower === apple;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static isCurentPlatform(value: string): boolean {
|
||||
return value && value.toLowerCase() === Device.os.toLowerCase();
|
||||
value = value && value.toLowerCase();
|
||||
return value === apple ? __APPLE__ : value === Device.os.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user