In aspnet-prerendering, simply type imports/exports by changing PrerenderingInterfaces to a regular module (not a .d.ts file)

This commit is contained in:
Steve Sanderson
2017-06-20 15:07:11 +01:00
parent 48bca777fe
commit fcd3cf9dd7
3 changed files with 9 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
/// <reference path="./PrerenderingInterfaces.d.ts" />
import * as url from 'url';
import * as path from 'path';
import * as domain from 'domain';
import { run as domainTaskRun, baseUrl as domainTaskBaseUrl } from 'domain-task/main';
import { BootFunc, BootFuncParams, BootModuleInfo, RenderToStringCallback, RenderToStringFunc } from './PrerenderingInterfaces';
const defaultTimeoutMilliseconds = 30 * 1000;

View File

@@ -1,26 +1,26 @@
interface RenderToStringFunc {
export interface RenderToStringFunc {
(callback: RenderToStringCallback, applicationBasePath: string, bootModule: BootModuleInfo, absoluteRequestUrl: string, requestPathAndQuery: string, customDataParameter: any, overrideTimeoutMilliseconds: number, requestPathBase: string): void;
}
interface RenderToStringCallback {
export interface RenderToStringCallback {
(error: any, result?: RenderToStringResult): void;
}
interface RenderToStringResult {
export interface RenderToStringResult {
html: string;
statusCode?: number;
globals?: { [key: string]: any };
}
interface RedirectResult {
export interface RedirectResult {
redirectUrl: string;
}
interface BootFunc {
export interface BootFunc {
(params: BootFuncParams): Promise<RenderToStringResult>;
}
interface BootFuncParams {
export interface BootFuncParams {
location: any; // e.g., Location object containing information '/some/path'
origin: string; // e.g., 'https://example.com:1234'
url: string; // e.g., '/some/path'
@@ -30,7 +30,7 @@ interface BootFuncParams {
data: any; // any custom object passed through from .NET
}
interface BootModuleInfo {
export interface BootModuleInfo {
moduleName: string;
exportName?: string;
webpackConfig?: string;

View File

@@ -1,5 +1,4 @@
/// <reference path="./PrerenderingInterfaces.d.ts" />
import { RenderToStringResult, RedirectResult } from './PrerenderingInterfaces';
export * from './Prerendering';
export type RenderResult = RenderToStringResult | RedirectResult;