Skip to content

Commit

Permalink
Add types for geo lat and long (#31624)
Browse files Browse the repository at this point in the history
Fixes #31620

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
  • Loading branch information
huozhi authored Nov 19, 2021
1 parent a9dd61e commit dab7b40
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 dab7b40

Please sign in to comment.