@platform/react.ssr
Version:
A lightweight SSR (server-side-rendering) system for react apps bundled with ParcelJS and hosted on S3.
51 lines (50 loc) • 1.43 kB
TypeScript
import { t } from '../common';
import { Route } from './Route';
export declare type ISiteArgs = {
index: number;
manifest: t.IManifest;
};
export declare class Site {
static formatMany(args: {
input: any;
baseUrl: string;
loadBundleManifest?: boolean;
}): Promise<t.ISiteManifest[]>;
static formatOne(args: {
input: any;
baseUrl: string;
loadBundleManifest?: boolean;
}): Promise<t.ISiteManifest | undefined>;
static create: (args: ISiteArgs) => Site;
private constructor();
readonly index: number;
private readonly manifest;
private _routes;
private _regexes;
private get def();
get name(): string;
get domain(): string[];
get bundle(): string;
get bundleUrl(): string;
get version(): string;
get size(): string;
get files(): t.IBundleFile[];
get routes(): Route[];
isMatch(domain: string | string[]): boolean;
route(pathname?: string): Route | undefined;
redirectUrl(pathname?: string): string;
toObject(): {
name: string;
domain: string[];
bundle: string;
routes: {
[key: string]: t.ISiteManifestRoute;
};
size: string;
bytes: number;
baseUrl: string;
files: t.IBundleFile[];
entries: t.IBundleEntryHtml[];
};
}
export declare function toDomainRegexes(domains: string[]): RegExp[];