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 url from 'url';
import * as path from 'path'; import * as path from 'path';
import * as domain from 'domain'; import * as domain from 'domain';
import { run as domainTaskRun, baseUrl as domainTaskBaseUrl } from 'domain-task/main'; import { run as domainTaskRun, baseUrl as domainTaskBaseUrl } from 'domain-task/main';
import { BootFunc, BootFuncParams, BootModuleInfo, RenderToStringCallback, RenderToStringFunc } from './PrerenderingInterfaces';
const defaultTimeoutMilliseconds = 30 * 1000; 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; (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; (error: any, result?: RenderToStringResult): void;
} }
interface RenderToStringResult { export interface RenderToStringResult {
html: string; html: string;
statusCode?: number; statusCode?: number;
globals?: { [key: string]: any }; globals?: { [key: string]: any };
} }
interface RedirectResult { export interface RedirectResult {
redirectUrl: string; redirectUrl: string;
} }
interface BootFunc { export interface BootFunc {
(params: BootFuncParams): Promise<RenderToStringResult>; (params: BootFuncParams): Promise<RenderToStringResult>;
} }
interface BootFuncParams { export interface BootFuncParams {
location: any; // e.g., Location object containing information '/some/path' location: any; // e.g., Location object containing information '/some/path'
origin: string; // e.g., 'https://example.com:1234' origin: string; // e.g., 'https://example.com:1234'
url: string; // e.g., '/some/path' url: string; // e.g., '/some/path'
@@ -30,7 +30,7 @@ interface BootFuncParams {
data: any; // any custom object passed through from .NET data: any; // any custom object passed through from .NET
} }
interface BootModuleInfo { export interface BootModuleInfo {
moduleName: string; moduleName: string;
exportName?: string; exportName?: string;
webpackConfig?: string; webpackConfig?: string;

View File

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