"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const react = require("react");
const useTypescript = require("./use-typescript.cjs");
const index = require("../_vendor/@codemirror/lang-javascript/dist-index.cjs");
function useLanguageExtensions(props) {
  const { id } = props;
  const { createWorker: createTsWorker } = useTypescript.useTypescript({
    id
  });
  const getLanguageExtensions = react.useCallback(async (initialContent = "") => {
    const langExtensions = [];
    langExtensions.push(
      index.javascript({
        jsx: true,
        typescript: true
      })
    );
    const tsExtension = await createTsWorker(initialContent);
    langExtensions.push(tsExtension);
    return langExtensions;
  }, [createTsWorker]);
  return {
    getLanguageExtensions
  };
}
exports.useLanguageExtensions = useLanguageExtensions;
//# sourceMappingURL=use-language-extensions.cjs.map
