39302141b5
## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using fixes #33829 - [x] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import type { BuildManifest } from '../../server/get-page-files'
|
|
import type { NEXT_DATA } from './utils'
|
|
|
|
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
|
|
scriptLoader: {
|
|
afterInteractive?: string[]
|
|
beforeInteractive?: any[]
|
|
worker?: any[]
|
|
}
|
|
locale?: string
|
|
disableOptimizedLoading?: boolean
|
|
styles?: React.ReactElement[] | React.ReactFragment
|
|
head?: Array<JSX.Element | null>
|
|
crossOrigin?: string
|
|
optimizeCss?: boolean
|
|
optimizeFonts?: boolean
|
|
nextScriptWorkers?: boolean
|
|
runtime?: 'edge' | 'nodejs'
|
|
hasConcurrentFeatures?: boolean
|
|
largePageDataBytes?: number
|
|
}
|
|
|
|
export const HtmlContext = createContext<HtmlProps>(null as any)
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
HtmlContext.displayName = 'HtmlContext'
|
|
}
|