"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLocationAction = exports.useHeaderStatus = exports.useOveringNode = exports.useSelectedNode = exports.getSharedFromMain = void 0;
const use_behaviorsubject_1 = require("@rcp/use.behaviorsubject");
const pipe_1 = require("../../shared/pipe");
function getSharedFromMain() {
    const shared = (0, pipe_1.getByRemoteById)('shared', 'main');
    if (!shared) {
        throw new Error(`未找到来自父窗口共享资源`);
    }
    return shared;
}
exports.getSharedFromMain = getSharedFromMain;
function useSelectedNode() {
    const { selectedNodeSubject } = getSharedFromMain();
    return (0, use_behaviorsubject_1.useBehaviorSubject)(selectedNodeSubject);
}
exports.useSelectedNode = useSelectedNode;
function useOveringNode() {
    const { overingNodeSubject } = getSharedFromMain();
    return (0, use_behaviorsubject_1.useBehaviorSubject)(overingNodeSubject);
}
exports.useOveringNode = useOveringNode;
function useHeaderStatus() {
    const { headerStatusSubject } = getSharedFromMain();
    return (0, use_behaviorsubject_1.useBehaviorSubject)(headerStatusSubject);
}
exports.useHeaderStatus = useHeaderStatus;
function useLocationAction() {
    const { locationActionSubject } = getSharedFromMain();
    return (0, use_behaviorsubject_1.useBehaviorSubject)(locationActionSubject);
}
exports.useLocationAction = useLocationAction;
//# sourceMappingURL=get-from-main.js.map