import { createContext, useContext } from "solid-js";
function createLexicalComposerContext(parent, theme) {
    let parentContext = null;
    if (parent != null) {
        parentContext = parent[1];
    }
    function getTheme() {
        if (theme != null) {
            return theme;
        }
        return parentContext != null ? parentContext.getTheme() : null;
    }
    return {
        getTheme,
    };
}
const LexicalComposerContext = createContext(null);
const useLexicalComposerContext = () => {
    const composerContext = useContext(LexicalComposerContext);
    if (!composerContext) {
        {
            throw Error(`useLexicalComposerContext: cannot find a LexicalComposerContext`);
        }
    }
    return composerContext;
};
export { LexicalComposerContext, createLexicalComposerContext, useLexicalComposerContext, };
