UNPKG

@neurosity/sdk

Version:
48 lines (47 loc) 2.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPlatformHapticMotors = exports.supportsAccel = exports.supportsHaptics = exports.platformConfigByModelVersion = exports.platformFeaturesByModelVersion = exports.HAPTIC_P8 = exports.HAPTIC_P7 = exports.FEATURE_ACCEL = exports.FEATURE_HAPTICS = exports.MODEL_VERSION_3 = exports.MODEL_VERSION_2 = exports.MODEL_VERSION_1 = void 0; exports.MODEL_VERSION_1 = "1"; exports.MODEL_VERSION_2 = "2"; exports.MODEL_VERSION_3 = "3"; exports.FEATURE_HAPTICS = "haptics"; exports.FEATURE_ACCEL = "accel"; exports.HAPTIC_P7 = "P7"; exports.HAPTIC_P8 = "P8"; exports.platformFeaturesByModelVersion = { [exports.MODEL_VERSION_1]: [], [exports.MODEL_VERSION_2]: [exports.FEATURE_HAPTICS, exports.FEATURE_ACCEL], [exports.MODEL_VERSION_3]: [exports.FEATURE_HAPTICS, exports.FEATURE_ACCEL] }; exports.platformConfigByModelVersion = { [exports.MODEL_VERSION_1]: {}, [exports.MODEL_VERSION_2]: { motorByMotorName: { [exports.HAPTIC_P7]: [], [exports.HAPTIC_P8]: [] } }, [exports.MODEL_VERSION_3]: { motorByMotorName: { [exports.HAPTIC_P7]: [], [exports.HAPTIC_P8]: [] } } }; const supportsHaptics = (modelVersion) => { const platformFeaturesForModel = exports.platformFeaturesByModelVersion[modelVersion]; return platformFeaturesForModel.includes(exports.FEATURE_HAPTICS); }; exports.supportsHaptics = supportsHaptics; const supportsAccel = (modelVersion) => { const platformFeaturesForModel = exports.platformFeaturesByModelVersion[modelVersion]; return platformFeaturesForModel.includes(exports.FEATURE_ACCEL); }; exports.supportsAccel = supportsAccel; const getPlatformHapticMotors = (modelVersion) => { var _a; const platformConfigForModel = exports.platformConfigByModelVersion[modelVersion]; const platformMotorByMotorName = (_a = platformConfigForModel === null || platformConfigForModel === void 0 ? void 0 : platformConfigForModel.motorByMotorName) !== null && _a !== void 0 ? _a : {}; return Object.assign({}, platformMotorByMotorName); }; exports.getPlatformHapticMotors = getPlatformHapticMotors;