mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In aspnet-prerendering, simply type imports/exports by changing PrerenderingInterfaces to a regular module (not a .d.ts file)
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user