Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 19, 2022
1 parent c66f5b1 commit 2e4bc59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions packages/next/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import { createHeaderRoute, createRedirectRoute } from './server-route-utils'
import { PrerenderManifest } from '../build'
import { ImageConfigComplete } from '../shared/lib/image-config'
import { replaceBasePath } from './router-utils'
import { IncrementalCache } from './incremental-cache'

export type FindComponentsResult = {
components: LoadComponentsReturnType
Expand Down Expand Up @@ -170,7 +169,7 @@ export default abstract class Server {
}

protected responseCache: ResponseCache
protected incrementalCache: IncrementalCache
protected incrementalCache: any
protected router: Router
protected dynamicRoutes?: DynamicRoutes
protected customRoutes: CustomRoutes
Expand Down
10 changes: 7 additions & 3 deletions packages/next/server/incremental-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class IncrementalCache {
}

prerenderManifest: PrerenderManifest
cache?: LRUCache<string, IncrementalCacheEntry>
cache?: any
locales?: string[]
fs: CacheFs

Expand Down Expand Up @@ -67,7 +67,7 @@ export class IncrementalCache {
if (max) {
this.cache = new LRUCache({
max,
length({ value }) {
length({ value }: any) {
if (!value) {
return 25
} else if (value.kind === 'REDIRECT') {
Expand Down Expand Up @@ -109,7 +109,7 @@ export class IncrementalCache {
return revalidateAfter
}

getFallback(page: string): Promise<string> {
public getFallback(page: string): Promise<string> {
page = normalizePagePath(page)
return this.fs.readFile(this.getSeedPath(page, 'html'))
}
Expand Down Expand Up @@ -222,3 +222,7 @@ export class IncrementalCache {
}
}
}

type IncrementalCacheType = typeof IncrementalCache

export { IncrementalCacheType }
5 changes: 1 addition & 4 deletions packages/next/types/misc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,7 @@ declare module 'next/dist/compiled/lodash.curry' {
import m from 'lodash.curry'
export = m
}
declare module 'next/dist/compiled/lru-cache' {
import m from 'lru-cache'
export = m
}
declare module 'next/dist/compiled/lru-cache'
declare module 'next/dist/compiled/micromatch' {
import m from 'micromatch'
export = m
Expand Down

0 comments on commit 2e4bc59

Please sign in to comment.