Unverified Commit 8b7f4c50 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update NextAdapter type and re-export (#81692)

Just fixes up the type and re-exports it so it can be imported directly
from `next`. Also fixes test file not being type checked which didn't
catch missing optional fields.
parent d884398d
......@@ -51,10 +51,10 @@ export type AdapterOutputs = Array<{
export interface NextAdapter {
name: string
modifyConfig(
modifyConfig?: (
config: NextConfigComplete
): Promise<NextConfigComplete> | NextConfigComplete
onBuildComplete(ctx: {
) => Promise<NextConfigComplete> | NextConfigComplete
onBuildComplete?: (ctx: {
routes: {
headers: Array<ManifestHeaderRoute>
redirects: Array<ManifestRedirectRoute>
......@@ -66,7 +66,7 @@ export interface NextAdapter {
dynamicRoutes: Array<{}>
}
outputs: AdapterOutputs
}): Promise<void> | void
}) => Promise<void> | void
}
export type I18NDomains = readonly DomainLocale[]
......
......@@ -29,6 +29,8 @@ export type ServerRuntime = 'nodejs' | 'experimental-edge' | 'edge' | undefined
// @ts-ignore This path is generated at build time and conflicts otherwise
export { NextConfig } from './server/config'
export type { NextAdapter } from './server/config-shared'
export type {
Metadata,
MetadataRoute,
......
// @ts-check
/** @type {import('next').NextAdapter } */
const myAdapter = {
name: 'my-custom-adapter',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment