Skip to content

Commit

Permalink
Add types for geo lat and long
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Nov 19, 2021
1 parent a9dd61e commit fb60b86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/server/web/spec-extension/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { I18NConfig } from '../../config-shared'
import type { IResult } from 'next/dist/compiled/ua-parser-js'
import type { RequestData } from '../types'
import { NextURL } from '../next-url'
import { isBot } from '../../utils'
import { toNodeHeaders } from '../utils'
Expand All @@ -11,7 +12,7 @@ export const INTERNALS = Symbol('internal request')
export class NextRequest extends Request {
[INTERNALS]: {
cookieParser(): { [key: string]: string }
geo: { city?: string; country?: string; region?: string }
geo: RequestData['geo']
ip?: string
page?: { name?: string; params?: { [key: string]: string } }
ua?: UserAgent | null
Expand Down
2 changes: 2 additions & 0 deletions packages/next/server/web/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export interface RequestData {
city?: string
country?: string
region?: string
latitude?: string
longitude?: string
}
headers: NodeHeaders
ip?: string
Expand Down

0 comments on commit fb60b86

Please sign in to comment.