chore: add export `ImageResponseOptions` (#48418)
Exports `ImageResponseOptions` from `next/server`.
## Rationale
Today I do this:
```ts
import { ImageResponseOptions } from "next/dist/compiled/@vercel/og/types";
import { ImageResponse } from "next/server";
export const config = { runtime: "edge" };
export const GET = async (req: Request) => {
const inter = await getFont({
family: "Inter",
weights: [400, 700],
});
const options: ImageResponseOptions = {
width: 1200,
height: 600,
fonts: [
{ name: "Inter", data: inter[400], weight: 400 },
{ name: "Inter", data: inter[700], weight: 700 },
],
};
if (someCond) {
return new ImageResponse(<>Some JSX</>, options);
}
// ...
return new ImageResponse(<>Some other JSX</>, options);
};
```
And I never like importing stuff from an internal path such as
`dist/compiled/...`.
Showing
Please
register
or
sign in
to comment