2025-09-29 13:21:08 +08:00
|
|
|
/**
|
|
|
|
|
* 平台适配模块导出
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// 接口和类型
|
|
|
|
|
export type {
|
|
|
|
|
IPlatformAdapter,
|
|
|
|
|
PlatformWorker,
|
|
|
|
|
WorkerCreationOptions,
|
|
|
|
|
PlatformConfig,
|
2025-09-29 18:15:47 +08:00
|
|
|
PlatformDetectionResult
|
2025-09-29 13:21:08 +08:00
|
|
|
} from './IPlatformAdapter';
|
|
|
|
|
|
|
|
|
|
// 平台检测器
|
|
|
|
|
export { PlatformDetector } from './PlatformDetector';
|
|
|
|
|
|
|
|
|
|
// 平台管理器
|
|
|
|
|
export { PlatformManager } from './PlatformManager';
|
|
|
|
|
|
|
|
|
|
// 内部导入用于便利函数
|
|
|
|
|
import { PlatformManager } from './PlatformManager';
|
2025-09-29 18:15:47 +08:00
|
|
|
import type { IPlatformAdapter } from './IPlatformAdapter';
|
2025-09-29 13:21:08 +08:00
|
|
|
|
|
|
|
|
// 便利函数
|
2025-09-29 18:15:47 +08:00
|
|
|
export function registerPlatformAdapter(adapter: IPlatformAdapter) {
|
|
|
|
|
return PlatformManager.getInstance().registerAdapter(adapter);
|
2025-09-29 13:21:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getCurrentAdapter() {
|
|
|
|
|
return PlatformManager.getInstance().getAdapter();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getBasicWorkerConfig() {
|
|
|
|
|
return PlatformManager.getInstance().getBasicWorkerConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getFullPlatformConfig() {
|
|
|
|
|
return PlatformManager.getInstance().getFullPlatformConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function supportsFeature(feature: 'worker' | 'shared-array-buffer' | 'transferable-objects' | 'module-worker') {
|
|
|
|
|
return PlatformManager.getInstance().supportsFeature(feature);
|
2025-09-29 18:15:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function hasAdapter() {
|
|
|
|
|
return PlatformManager.getInstance().hasAdapter();
|
2025-09-29 13:21:08 +08:00
|
|
|
}
|