decord/source/13760_hasStateResponsePlugin.js
2026-08-12 06:57:52 +00:00

124 lines
3.5 KiB
JavaScript

// Module ID: 13760
// Function ID: 13761
// Name: hasStateResponsePlugin
// Dependencies: []
// Module 13760 (hasStateResponsePlugin)
arg5.assertHasStateResponsePlugin = undefined;
arg5.default = undefined;
arg5.hasStateResponsePlugin = undefined;
arg5.default = () => (arg0) => {
let closure_0 = arg0;
const features = {
stateActionComplete(name, action) {
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
return closure_0.send("state.action.complete", { name, action }, flag);
},
stateValuesResponse(path, value) {
let flag = arg2;
if (arg2 === undefined) {
flag = true;
}
return closure_0.send("state.values.response", { path, value, valid: flag });
},
stateKeysResponse(path, keys) {
let flag = arg2;
if (arg2 === undefined) {
flag = true;
}
return closure_0.send("state.keys.response", { path, keys, valid: flag });
},
stateValuesChange(arg0) {
let sendResult = arg0.length > 0;
if (sendResult) {
const obj = { changes: null };
obj[0] = arg0;
sendResult = closure_0.send("state.values.change", obj);
}
return sendResult;
},
stateBackupResponse(state) {
return closure_0.send("state.backup.response", { state });
}
};
return { features };
};
function hasStateResponsePlugin(stateActionComplete) {
let tmp = stateActionComplete;
if (stateActionComplete) {
tmp = "stateActionComplete" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateActionComplete === "function";
}
if (tmp) {
tmp = "stateValuesResponse" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateValuesResponse === "function";
}
if (tmp) {
tmp = "stateKeysResponse" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateKeysResponse === "function";
}
if (tmp) {
tmp = "stateValuesChange" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateValuesChange === "function";
}
if (tmp) {
tmp = "stateBackupResponse" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateBackupResponse === "function";
}
return tmp;
}
arg5.hasStateResponsePlugin = hasStateResponsePlugin;
arg5.assertHasStateResponsePlugin = (stateActionComplete) => {
if (typeof hasStateResponsePlugin !== "function") {
HermesBuiltin.throwTypeError();
}
let tmp = stateActionComplete;
if (stateActionComplete) {
tmp = "stateActionComplete" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateActionComplete === "function";
}
if (tmp) {
tmp = "stateValuesResponse" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateValuesResponse === "function";
}
if (tmp) {
tmp = "stateKeysResponse" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateKeysResponse === "function";
}
if (tmp) {
tmp = "stateValuesChange" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateValuesChange === "function";
}
if (tmp) {
tmp = "stateBackupResponse" in stateActionComplete;
}
if (tmp) {
tmp = typeof stateActionComplete.stateBackupResponse === "function";
}
if (!tmp) {
const _Error = Error;
const error = new Error("This Reactotron client has not had the state responses plugin applied to it. Make sure that you add `use(stateResponse())` before adding this plugin.");
throw error;
}
};