Unverified Commit dab7b406 authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Add types for geo lat and long (#31624)

Fixes #31620

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
parent a9dd61e8
import type { I18NConfig } from '../../config-shared' import type { I18NConfig } from '../../config-shared'
import type { IResult } from 'next/dist/compiled/ua-parser-js' import type { IResult } from 'next/dist/compiled/ua-parser-js'
import type { RequestData } from '../types'
import { NextURL } from '../next-url' import { NextURL } from '../next-url'
import { isBot } from '../../utils' import { isBot } from '../../utils'
import { toNodeHeaders } from '../utils' import { toNodeHeaders } from '../utils'
...@@ -11,7 +12,7 @@ export const INTERNALS = Symbol('internal request') ...@@ -11,7 +12,7 @@ export const INTERNALS = Symbol('internal request')
export class NextRequest extends Request { export class NextRequest extends Request {
[INTERNALS]: { [INTERNALS]: {
cookieParser(): { [key: string]: string } cookieParser(): { [key: string]: string }
geo: { city?: string; country?: string; region?: string } geo: RequestData['geo']
ip?: string ip?: string
page?: { name?: string; params?: { [key: string]: string } } page?: { name?: string; params?: { [key: string]: string } }
ua?: UserAgent | null ua?: UserAgent | null
......
...@@ -9,6 +9,8 @@ export interface RequestData { ...@@ -9,6 +9,8 @@ export interface RequestData {
city?: string city?: string
country?: string country?: string
region?: string region?: string
latitude?: string
longitude?: string
} }
headers: NodeHeaders headers: NodeHeaders
ip?: string ip?: string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment