-
Notifications
You must be signed in to change notification settings - Fork 1
/
context.d.ts
41 lines (38 loc) · 1.7 KB
/
context.d.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
35
36
37
38
39
40
// @themost-framework 2.0 Codename Blueshift Copyright (c) 2017-2025, THEMOST LP All rights reserved
import {IncomingMessage, ServerResponse} from 'http';
import {HttpApplication} from "./app";
import {HttpConfiguration} from "./config";
import {DefaultDataContext} from '@themost/data';
export declare class HttpContext extends DefaultDataContext {
constructor(httpRequest : IncomingMessage, httpResponse : ServerResponse);
getApplication(): HttpApplication;
getConfiguration(): HttpConfiguration;
getParam(name : any): any;
hasParam(name : any): boolean;
init(): void;
cookie(name : string, value : any, expires? : Date, domain? : string, cookiePath? : string): void;
getCookie(name : string): any;
moment(p : any): void;
setCookie(name : string, value : any, expires? : Date, domain? : string, cpath? : string): void;
setLangCookie(lang : any): void;
removeCookie(name : string, domain? : string, cpath? : string): string;
unattended(fn : Function, callback : Function): void;
culture(value? : string): HttpContext;
validateAntiForgeryToken(csrfToken? : string): void;
writeFile(file : string): void;
is(method : string | Array<any>): boolean;
isPost(): boolean;
handle(method : string | Array<any>, fn : Function):HttpContext;
catch(callback : (() => void) | Function): HttpContext;
unhandle(fn : Function): HttpContext;
handlePost(fn : Function): HttpContext;
handleGet(fn : Function): HttpContext;
handlePut(fn : Function): HttpContext;
handleDelete(fn : Function): HttpContext;
currentHandler(value? : any): HttpContext;
translate(...text : string[]): string;
engine(extension : string): void;
request : IncomingMessage;
response: ServerResponse;
resolveUrl(appRelativeUrl: string): string;
}