import { jsx as _jsx } from "react/jsx-runtime";
import React, { useMemo, useContext } from "react";
export const StliteKernelContext = React.createContext(undefined);
const Provider = StliteKernelContext.Provider;
export function StliteKernelProvider(props) {
    const { children, kernel } = props;
    const value = useMemo(() => {
        return {
            kernel,
        };
    }, [kernel]);
    return _jsx(Provider, Object.assign({ value: value }, { children: children }));
}
export function useStliteKernel() {
    const value = useContext(StliteKernelContext);
    if (value == null) {
        throw new Error("useStliteKernel() must be inside <StliteKernelProvider />");
    }
    return value.kernel;
}
//# sourceMappingURL=StliteKernelProvider.js.map