ness
Version:
✪ No-effort static sites deployed to your AWS account.
126 lines (125 loc) • 3.15 kB
TypeScript
export declare type DynamicPageKeyValue = {
[key: string]: {
file: string;
regex: string;
};
};
export declare type OriginRequestApiHandlerManifest = {
apis: {
dynamic: DynamicPageKeyValue;
nonDynamic: {
[key: string]: string;
};
};
domainRedirects: {
[key: string]: string;
};
enableHTTPCompression: boolean;
authentication?: {
username: string;
password: string;
};
};
export declare type OriginRequestDefaultHandlerManifest = {
buildId: string;
logLambdaExecutionTimes: boolean;
pages: {
ssr: {
dynamic: DynamicPageKeyValue;
nonDynamic: {
[key: string]: string;
};
};
html: {
nonDynamic: {
[path: string]: string;
};
dynamic: DynamicPageKeyValue;
};
ssg: {
nonDynamic: {
[path: string]: unknown;
};
dynamic: {
[path: string]: unknown;
};
};
};
publicFiles: {
[key: string]: string;
};
trailingSlash: boolean;
enableHTTPCompression: boolean;
domainRedirects: {
[key: string]: string;
};
authentication?: {
username: string;
password: string;
};
};
export declare type OriginRequestImageHandlerManifest = {
enableHTTPCompression: boolean;
domainRedirects: {
[key: string]: string;
};
};
export declare type RedirectData = {
statusCode: number;
source: string;
destination: string;
regex: string;
internal?: boolean;
};
export declare type RewriteData = {
source: string;
destination: string;
regex: string;
};
export declare type Header = {
key: string;
value: string;
};
export declare type HeaderData = {
source: string;
headers: Header[];
regex: string;
};
export declare type I18nData = {
locales: string[];
defaultLocale: string;
};
export declare type RoutesManifest = {
basePath: string;
redirects: RedirectData[];
rewrites: RewriteData[];
headers: HeaderData[];
i18n?: I18nData;
};
declare type CacheConfig = Record<string, {
cacheControl: string;
path: string;
prefix: string;
}>;
/**
* We don't need to invalidate sub paths if a parent has a wild card
* invalidation. i.e. if `/users/*` exists, we don't need to invalidate `/users/details/*`
*/
export declare const reduceInvalidationPaths: (invalidationPaths: string[]) => string[];
export declare const readInvalidationPathsFromManifest: (manifest: OriginRequestDefaultHandlerManifest) => string[];
export declare type NextBuild = {
lambdaBuildDir: string;
defaultLambdaPath: string;
imageLambdaPath?: string;
apiLambdaPath?: string;
regenerationLambdaPath?: string;
assets: CacheConfig;
basePath: string;
staticPath: string;
dataPath: string;
imagePath?: string;
apiPath?: string;
invalidationPaths?: string[];
};
export declare const buildNextApp: (entry?: string) => Promise<NextBuild>;
export {};