UNPKG

fumadocs-openapi

Version:

Generate MDX docs for your OpenAPI spec

32 lines (30 loc) 743 B
import { lazy } from "react"; import { jsx } from "react/jsx-runtime"; //#region src/scalar/index.tsx const Client = lazy(() => import("./client.js")); function APIPlayground({ path, method, ctx }) { return /* @__PURE__ */ jsx(Client, { method: method.method, path, spec: ctx.schema.bundled }); } /** * Enable Scalar for API playgrounds by wrapping your options inside. * * Requires `@scalar/api-client-react` to be installed, it imports the styles automatically. */ function withScalar(options = {}) { return { ...options, playground: { ...options.playground, render(props) { return /* @__PURE__ */ jsx(APIPlayground, { ...props }); } } }; } //#endregion export { withScalar }; //# sourceMappingURL=index.js.map