presta
Version:
Hyper minimal framework for the modern web.
23 lines (22 loc) • 1.06 kB
TypeScript
/**
* This is main export of the Presta library. It's used by most end-users
* within their applications, so we need to keep it as small as possible. It
* should mostly-re-export types and utils for end-user use.
*/
import type { PrestaConfig, Handler, Plugin } from './core';
export type Config = PrestaConfig;
export type { Event, Context, Handler, Response, Headers, Plugin, PluginContext, PluginInterface, Manifest, } from './core';
export declare enum Mode {
Dev = "dev",
Build = "build",
Serve = "serve"
}
export declare class HttpError extends Error {
statusCode: number;
constructor(message: string, statusCode?: number);
}
export declare const createConfig: (conf: Partial<Config>) => Partial<PrestaConfig>;
export declare const createPlugin: <T>(fn: (options: T) => Plugin) => (options: T) => Plugin;
export declare const createRoute: (route: string) => string;
export declare const createGetStaticPaths: (getStaticPaths: () => string[]) => () => string[];
export declare const createHandler: (handler: Handler) => Handler;