-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrequest.ts
34 lines (32 loc) · 1.04 KB
/
request.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { App } from './app.ts'
import type { CookieMap, RangesSpecifier } from './deps.ts'
import type { Middleware, Protocol } from './types.ts'
export interface ReqWithUrlAndConn extends Request {
conn: Deno.Conn
_urlObject: URL
}
export interface THRequest extends ReqWithUrlAndConn {
path: string
range: () => -1 | -2 | RangesSpecifier | undefined
query: URLSearchParams
params: Record<string, string>
protocol: Protocol
xhr: boolean
hostname?: string
ip?: string
ips?: string[]
subdomains?: string[]
accepts: (...types: string[]) => string | string[] | undefined
acceptsEncodings: (...encodings: string[]) => string | string[] | undefined
// acceptsCharsets: (...charsets: string[]) => string | undefined
acceptsLanguages: (...languages: string[]) => string | string[] | undefined
is: (...types: string[]) => string | boolean
get: (header: string) => string | string[] | undefined
cookies: CookieMap
secret?: string | string[]
fresh?: boolean
stale?: boolean
secure: boolean
route?: Middleware
app?: App
}