2022-02-17 19:21:40 +01:00
|
|
|
import type { BuildManifest } from '../../server/get-page-files'
|
2022-02-18 20:07:19 +01:00
|
|
|
import type { NEXT_DATA } from './utils'
|
2022-02-17 19:21:40 +01:00
|
|
|
|
|
|
|
import { createContext } from 'react'
|
|
|
|
|
|
|
|
export type HtmlProps = {
|
|
|
|
__NEXT_DATA__: NEXT_DATA
|
|
|
|
dangerousAsPath: string
|
|
|
|
docComponentsRendered: {
|
|
|
|
Html?: boolean
|
|
|
|
Main?: boolean
|
|
|
|
Head?: boolean
|
|
|
|
NextScript?: boolean
|
|
|
|
}
|
|
|
|
buildManifest: BuildManifest
|
|
|
|
ampPath: string
|
|
|
|
inAmpMode: boolean
|
|
|
|
hybridAmp: boolean
|
|
|
|
isDevelopment: boolean
|
|
|
|
dynamicImports: string[]
|
|
|
|
assetPrefix?: string
|
|
|
|
canonicalBase: string
|
|
|
|
headTags: any[]
|
|
|
|
unstable_runtimeJS?: false
|
|
|
|
unstable_JsPreload?: false
|
|
|
|
devOnlyCacheBusterQueryString: string
|
2022-03-11 23:26:46 +01:00
|
|
|
scriptLoader: {
|
|
|
|
afterInteractive?: string[]
|
|
|
|
beforeInteractive?: any[]
|
|
|
|
worker?: any[]
|
|
|
|
}
|
2022-02-17 19:21:40 +01:00
|
|
|
locale?: string
|
|
|
|
disableOptimizedLoading?: boolean
|
|
|
|
styles?: React.ReactElement[] | React.ReactFragment
|
|
|
|
head?: Array<JSX.Element | null>
|
|
|
|
crossOrigin?: string
|
|
|
|
optimizeCss?: boolean
|
|
|
|
optimizeFonts?: boolean
|
2022-03-11 23:26:46 +01:00
|
|
|
nextScriptWorkers?: boolean
|
2022-02-17 19:21:40 +01:00
|
|
|
runtime?: 'edge' | 'nodejs'
|
2022-03-26 00:05:35 +01:00
|
|
|
hasConcurrentFeatures?: boolean
|
2022-02-17 19:21:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export const HtmlContext = createContext<HtmlProps>(null as any)
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
|
|
HtmlContext.displayName = 'HtmlContext'
|
|
|
|
}
|