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<{ ...@@ -51,10 +51,10 @@ export type AdapterOutputs = Array<{
export interface NextAdapter { export interface NextAdapter {
name: string name: string
modifyConfig( modifyConfig?: (
config: NextConfigComplete config: NextConfigComplete
): Promise<NextConfigComplete> | NextConfigComplete ) => Promise<NextConfigComplete> | NextConfigComplete
onBuildComplete(ctx: { onBuildComplete?: (ctx: {
routes: { routes: {
headers: Array<ManifestHeaderRoute> headers: Array<ManifestHeaderRoute>
redirects: Array<ManifestRedirectRoute> redirects: Array<ManifestRedirectRoute>
...@@ -66,7 +66,7 @@ export interface NextAdapter { ...@@ -66,7 +66,7 @@ export interface NextAdapter {
dynamicRoutes: Array<{}> dynamicRoutes: Array<{}>
} }
outputs: AdapterOutputs outputs: AdapterOutputs
}): Promise<void> | void }) => Promise<void> | void
} }
export type I18NDomains = readonly DomainLocale[] export type I18NDomains = readonly DomainLocale[]
......
...@@ -29,6 +29,8 @@ export type ServerRuntime = 'nodejs' | 'experimental-edge' | 'edge' | undefined ...@@ -29,6 +29,8 @@ export type ServerRuntime = 'nodejs' | 'experimental-edge' | 'edge' | undefined
// @ts-ignore This path is generated at build time and conflicts otherwise // @ts-ignore This path is generated at build time and conflicts otherwise
export { NextConfig } from './server/config' export { NextConfig } from './server/config'
export type { NextAdapter } from './server/config-shared'
export type { export type {
Metadata, Metadata,
MetadataRoute, MetadataRoute,
......
// @ts-check
/** @type {import('next').NextAdapter } */ /** @type {import('next').NextAdapter } */
const myAdapter = { const myAdapter = {
name: 'my-custom-adapter', 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