decord/source/stores/NetworkStore.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

53 lines
1.8 KiB
TypeScript

// Module ID: 4654
// Function ID: 4655
// Name: NetworkStore
// Dependencies: [1074, 504, 1461, 573, 2]
// Module 4654 (NetworkStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import NetworkUtilsDefault from "NetworkUtils" /* 1461 */;
import Constants from "Constants" /* 1074 */;
import size from "module_2" /* 2 */;
function handleConnectionInfoChange(type) {
if (null != type.type) {
UNKNOWN = type.type;
} else {
UNKNOWN = NetworkConnectionTypes.UNKNOWN;
}
UNKNOWN2 = type.effectiveSpeed;
if (UNKNOWN2 == null) {
UNKNOWN2 = NetworkConnectionSpeeds.UNKNOWN;
}
serviceProvider = type.serviceProvider;
networkStoreClass.emitChange();
}
const NetworkConnectionTypes = Constants.NetworkConnectionTypes;
const NetworkConnectionSpeeds = Constants.NetworkConnectionSpeeds;
let UNKNOWN = NetworkConnectionTypes.UNKNOWN;
let UNKNOWN2 = NetworkConnectionSpeeds.UNKNOWN;
let serviceProvider = null;
const Store = initializeDefault.Store;
class NetworkStoreClass extends Store {
}
const prototype = NetworkStoreClass.prototype;
prototype["initialize"] = function initialize() {
const networkInformation = NetworkUtilsDefault.getNetworkInformation();
networkInformation.then(handleConnectionInfoChange);
NetworkUtilsDefault.addChangeCallback(handleConnectionInfoChange);
};
prototype["getType"] = function getType() {
return UNKNOWN;
};
prototype["getEffectiveConnectionSpeed"] = function getEffectiveConnectionSpeed() {
return UNKNOWN2;
};
prototype["getServiceProvider"] = function getServiceProvider() {
return serviceProvider;
};
NetworkStoreClass.displayName = "NetworkStore";
const networkStoreClass = new NetworkStoreClass(DispatcherDefault, {});
const result = size.fileFinishedImporting("stores/NetworkStore.tsx");
export default networkStoreClass;