1
0
mirror of synced 2025-12-23 11:54:18 -05:00

Port next.js to TypeScript (#51438)

This commit is contained in:
Peter Bengtsson
2024-06-26 20:05:28 -04:00
committed by GitHub
parent b8707aa934
commit 616fa83d53
5 changed files with 49 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
import type { Request } from 'express'
import type { Failbot } from '@github/failbot'
import type enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.d.ts'
@@ -11,7 +12,7 @@ export type ExtendedRequest = Request & {
context?: Context
language?: string
userLanguage?: string
// Add more properties here as needed
FailBot?: Failbot
}
// TODO: Make this type from inference using AJV based on the schema.
@@ -164,6 +165,8 @@ export type Context = Features & {
productGroups?: ProductGroup[]
featuredLinks?: FeaturedLinksExpanded
currentLearningTrack?: LearningTrack | null
renderedPage?: string
miniTocItems?: string | undefined
}
export type LearningTracks = {
[group: string]: {
@@ -349,6 +352,10 @@ export type Page = {
autogenerated?: string
featuredLinks?: FeaturedLinksExpanded
redirect_from?: string[]
showMiniToc?: boolean
effectiveDate?: string
fullTitle?: string
render: (context: Context) => Promise<string>
}
type ChangeLog = {