import { useCallback } from "react";
import { useTypescript } from "./use-typescript.js";
import { javascript } from "../_vendor/@codemirror/lang-javascript/dist-index.js";
function useLanguageExtensions(props) {
  const { id } = props;
  const { createWorker: createTsWorker } = useTypescript({
    id
  });
  const getLanguageExtensions = useCallback(async (initialContent = "") => {
    const langExtensions = [];
    langExtensions.push(
      javascript({
        jsx: true,
        typescript: true
      })
    );
    const tsExtension = await createTsWorker(initialContent);
    langExtensions.push(tsExtension);
    return langExtensions;
  }, [createTsWorker]);
  return {
    getLanguageExtensions
  };
}
export {
  useLanguageExtensions
};
//# sourceMappingURL=use-language-extensions.js.map
