191 lines
5.1 KiB
JavaScript
191 lines
5.1 KiB
JavaScript
// Module ID: 4227
|
|
// Function ID: 4228
|
|
// Name: setEnabled
|
|
// Dependencies: [5, 4228, 4229]
|
|
|
|
// Module 4227 (setEnabled)
|
|
import asyncGeneratorStep from "asyncGeneratorStep";
|
|
|
|
const require = arg1;
|
|
let closure_4 = { [arg1(4228).HapticFeedbackTypes.impactLight]: 0.3, [arg1(4228).HapticFeedbackTypes.impactMedium]: 0.6, [arg1(4228).HapticFeedbackTypes.impactHeavy]: 0.8, [arg1(4228).HapticFeedbackTypes.rigid]: 1, [arg1(4228).HapticFeedbackTypes.soft]: 0.1, [arg1(4228).HapticFeedbackTypes.selection]: 0.3 };
|
|
let closure_5 = { enableVibrateFallback: false, ignoreAndroidSystemSettings: false };
|
|
let c6 = true;
|
|
|
|
export default {
|
|
setEnabled(arg0) {
|
|
let closure_6 = arg0;
|
|
},
|
|
isEnabled() {
|
|
return c6;
|
|
},
|
|
trigger() {
|
|
let selection = arg0;
|
|
if (arg0 === undefined) {
|
|
selection = require(4228) /* isRingerSilent */.HapticFeedbackTypes.selection;
|
|
}
|
|
let obj = arg1;
|
|
if (arg1 === undefined) {
|
|
obj = {};
|
|
}
|
|
if (c6) {
|
|
try {
|
|
obj = {};
|
|
const merged = Object.assign(closure_5);
|
|
const merged1 = Object.assign(obj);
|
|
importDefault(4229).trigger(selection, obj);
|
|
const obj2 = importDefault(4229);
|
|
} catch (tmp12) {
|
|
const _console = console;
|
|
console.warn("RNReactNativeHapticFeedback: trigger failed \u2013", tmp12);
|
|
}
|
|
}
|
|
},
|
|
stop() {
|
|
if (c6) {
|
|
try {
|
|
importDefault(4229).stop();
|
|
const obj = importDefault(4229);
|
|
} catch (tmp4) {
|
|
const _console = console;
|
|
console.warn("RNReactNativeHapticFeedback: stop failed \u2013", tmp4);
|
|
}
|
|
}
|
|
},
|
|
isSupported() {
|
|
try {
|
|
return importDefault(4229).isSupported();
|
|
} catch (err) {
|
|
return false;
|
|
}
|
|
},
|
|
triggerPattern(arg0) {
|
|
let obj = arg1;
|
|
if (arg1 === undefined) {
|
|
obj = {};
|
|
}
|
|
if (c6) {
|
|
try {
|
|
obj = {};
|
|
const merged = Object.assign(closure_5);
|
|
const merged1 = Object.assign(obj);
|
|
importDefault(4229).triggerPattern(arg0, obj);
|
|
const obj2 = importDefault(4229);
|
|
} catch (tmp11) {
|
|
const _console = console;
|
|
console.warn("RNReactNativeHapticFeedback: triggerPattern failed \u2013", tmp11);
|
|
}
|
|
}
|
|
},
|
|
playAHAP(arg0) {
|
|
if (c6) {
|
|
try {
|
|
return importDefault(4229).playAHAP(arg0);
|
|
} catch (err) {
|
|
return Promise.resolve();
|
|
}
|
|
} else {
|
|
return Promise.resolve();
|
|
}
|
|
},
|
|
impact() {
|
|
let impactMedium = arg0;
|
|
if (arg0 === undefined) {
|
|
impactMedium = require(4228) /* isRingerSilent */.HapticFeedbackTypes.impactMedium;
|
|
}
|
|
let obj = arg2;
|
|
if (arg2 === undefined) {
|
|
obj = {};
|
|
}
|
|
if (c6) {
|
|
let num2 = table[impactMedium];
|
|
if (num2 == null) {
|
|
num2 = 0.5;
|
|
}
|
|
const _Math = Math;
|
|
const _Math2 = Math;
|
|
try {
|
|
obj = { time: 0, intensity: null, sharpness: null };
|
|
obj[1] = tmp7;
|
|
obj[2] = num2;
|
|
const items = [obj];
|
|
obj = {};
|
|
const merged = Object.assign(closure_5);
|
|
const merged1 = Object.assign(obj);
|
|
importDefault(4229).triggerPattern(items, obj);
|
|
const obj2 = importDefault(4229);
|
|
} catch (tmp17) {
|
|
const _console = tmp.console;
|
|
_console.warn("RNReactNativeHapticFeedback: impact failed \u2013", tmp17);
|
|
}
|
|
}
|
|
},
|
|
getSystemHapticStatus() {
|
|
return callback(function*() {
|
|
if (c0 === 2) {
|
|
c0 = 3;
|
|
HermesBuiltin.throwTypeError();
|
|
} else if (tmp5 === 3) {
|
|
if (arg0 === 1) {
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
let obj = { value: null, done: true };
|
|
obj[0] = arg1;
|
|
return obj;
|
|
} else {
|
|
return { value: "T", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c0 = 2;
|
|
if (0 === v0) {
|
|
if (arg0 === 1) {
|
|
c0 = 3;
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
c0 = 3;
|
|
obj = { value: null, done: true };
|
|
obj[0] = arg1;
|
|
return obj;
|
|
} else {
|
|
let table = 1;
|
|
let obj3 = v0(table[2]);
|
|
v0 = 2;
|
|
c0 = 1;
|
|
const obj1 = { value: null, done: false };
|
|
obj1[0] = obj3.getSystemHapticStatus();
|
|
return obj1;
|
|
}
|
|
} else if (1 === tmp6) {
|
|
table = 0;
|
|
c0 = 3;
|
|
const obj2 = { value: null, done: true };
|
|
obj2[0] = { vibrationEnabled: false, ringerMode: null };
|
|
return obj2;
|
|
} else if (arg0 === 1) {
|
|
c0 = 3;
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
table = 0;
|
|
c0 = 3;
|
|
obj3 = { value: null, done: true };
|
|
obj3[0] = arg1;
|
|
return obj3;
|
|
} else {
|
|
table = 0;
|
|
c0 = 3;
|
|
obj = { value: null, done: true };
|
|
obj[0] = arg1;
|
|
return obj;
|
|
}
|
|
} catch (tmp9) {
|
|
if (tmp3 === table) {
|
|
c0 = tmp2;
|
|
throw tmp9;
|
|
} else {
|
|
v0 = tmp;
|
|
}
|
|
}
|
|
}
|
|
})();
|
|
}
|
|
};
|