function isBrowserEnvironment() {
    return typeof window !== 'undefined' && typeof document !== 'undefined';
}
function isNodeEnvironment() {
    return (typeof process !== 'undefined' && process.versions != null && process.versions.node != null);
}
function getRuntimeEnvironment() {
    if (isBrowserEnvironment())
        return 'browser';
    if (isNodeEnvironment())
        return 'node';
    return 'unknown';
}
function assertBrowserEnvironment() {
    if (!isBrowserEnvironment()) {
        throw new Error('This function requires a browser environment with DOM APIs. ' +
            'Current environment: ' +
            getRuntimeEnvironment());
    }
}
function assertNodeEnvironment() {
    if (!isNodeEnvironment()) {
        throw new Error('This function requires a Node.js environment. ' +
            'Current environment: ' +
            getRuntimeEnvironment());
    }
}

export { assertBrowserEnvironment, assertNodeEnvironment, getRuntimeEnvironment, isBrowserEnvironment, isNodeEnvironment };
//# sourceMappingURL=environment.mjs.map
