UNPKG

1.25 kBTypeScriptView Raw
1/**
2 * @license
3 * MOST Web Framework 2.0 Codename Blueshift
4 * Copyright (c) 2017, THEMOST LP All rights reserved
5 *
6 * Use of this source code is governed by an BSD-3-Clause license that can be
7 * found in the LICENSE file at https://themost.io/license
8 */
9import {HttpContext} from "../context";
10import {HttpViewEngine} from "../types";
11import {IncomingMessage, ServerResponse} from "http";
12import * as angular from "angular";
13import IModule = angular.IModule;
14
15export declare class NgApplication {
16 useService(serviceCtor: Function): NgApplication;
17 hasService(serviceCtor: Function): any;
18 getService(serviceCtor: Function): any;
19}
20
21export declare class NgContext {
22 application: NgApplication;
23 request: IncomingMessage;
24 response: ServerResponse;
25 getApplication(): NgApplication;
26}
27
28export declare class NgEngine extends HttpViewEngine {
29 constructor(context: HttpContext);
30
31 context: HttpContext;
32 getContext(): HttpContext;
33 render(filename: string, data: any, callback: (err?: Error, res?: string) => void);
34 renderString(str: string, data?: any): Promise<any>;
35 bootstrap(bootstrapFunc: (angular: angular.IAngularStatic) => IModule): NgEngine;
36
37}
38
39export declare function createInstance(): NgEngine;