-
Notifications
You must be signed in to change notification settings - Fork 1
/
mvc.d.ts
113 lines (81 loc) · 2.74 KB
/
mvc.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// @themost-framework 2.0 Codename Blueshift Copyright (c) 2017-2025, THEMOST LP All rights reserved
import {HttpContext} from "./context";
import {HtmlWriter} from "@themost/common";
import {HttpViewEngineConfiguration} from "./config";
export declare class HttpResult {
/**
* @constructor
*/
constructor();
contentType?: string;
contentEncoding?: string;
status(status?: number): HttpResult;
public execute(context: HttpContext, callback: (err?: Error) => void);
}
export declare class HttpContentResult extends HttpResult {
constructor(content: string|Buffer);
data: any;
}
export declare class HttpJsonResult extends HttpResult {
constructor(data: any);
data: any;
}
export declare class HttpXmlResult extends HttpResult {
constructor(data: any);
data: any;
}
export declare class HttpJavascriptResult extends HttpResult {
constructor(data: any);
data: any;
}
export declare class HttpViewResult extends HttpResult {
constructor(name?: string, data?: any);
setName(name: string): HttpViewResult;
static resolveViewPath(context: HttpContext, controller: string, view: string, engine: HttpViewEngineConfiguration, callback: (err?: Error, res?: string) => void);
}
export declare class HttpFileResult extends HttpResult {
constructor(physicalPath: string, fileName: string);
physicalPath: string;
fileName: string;
}
export declare class HttpRedirectResult extends HttpResult {
constructor(url: string);
url: string;
}
export declare class HttpEmptyResult extends HttpResult {
constructor();
}
export declare class HttpController {
context: HttpContext;
constructor(context: HttpContext);
view(data?: any): HttpViewResult;
html(data?: any): HttpViewResult;
htm(data?: any): HttpViewResult;
js(script?: string): HttpJavascriptResult;
jsvar(name: string, obj: any): HttpJavascriptResult;
result(data?: any): HttpResult;
content(data?: any): HttpContentResult;
json(data?: any): HttpJsonResult;
xml(data?: any): HttpXmlResult;
file(physicalPath: string, fileName: string): HttpFileResult;
redirect(url: string): HttpRedirectResult;
empty(): HttpEmptyResult;
toPromise(resolver: (resolve: void, reject?: void) => Promise<any>): Promise<any>;
next(): HttpNextResult;
}
export declare class HttpViewContext {
constructor(context: HttpContext);
body?: string;
title?: string;
layout?: string;
data?: any;
context: HttpContext;
readonly writer: HtmlWriter;
readonly model: any;
init(): void;
render(url: string, callback: (err?: Error, res?: any) => void);
translate(key: string): string;
}
export declare class HttpNextResult extends HttpResult {
constructor();
}