reboost
Version:
A super fast dev server for rapid web development
44 lines (43 loc) • 2.48 kB
TypeScript
import Koa from 'koa';
import { RawSourceMap } from 'source-map';
import http from 'http';
import { ReboostInstance } from './index';
export declare type DeepRequire<T> = T extends Record<string, any> ? {
[P in keyof T]-?: DeepRequire<T[P]>;
} : T;
export declare type DeepFrozen<T> = T extends Record<string, any> ? {
readonly [P in keyof T]: DeepFrozen<T[P]>;
} : T extends any[] ? readonly T[] : T;
export declare type PromiseType<T extends Promise<any>> = Parameters<Parameters<T['then']>[0]>[0];
export declare const toPosix: (pathString: string) => string;
export declare const uniqueID: (length?: number) => string;
export declare const isPlainObject: (data: any) => boolean;
export declare const merge: <T extends Record<string, any>>(source: T, target: Record<string, any>) => T;
export declare const clone: <T = any>(object: T) => T;
export declare const ensureDir: (dirPath: string) => void;
export declare const isDirectory: (dirPath: string) => boolean;
export declare const rmDir: (dirPath: string) => void;
export declare const deepFreeze: (obj: any) => any;
export declare const observable: <T extends Record<string, any>>(object: T, onChange: () => void) => T;
export declare const objectPaths: (object: Record<string, any>, pPath?: string) => string[];
declare type ExcludePathObject = {
[key: string]: ExcludePathObject;
};
export declare const serializeObject: (object: Record<string, any>, excludePaths?: string[] | ExcludePathObject, stringify?: boolean, pPath?: string) => string;
export declare const bind: <T extends Function>(func: T, bindTo: ThisParameterType<T>) => OmitThisParameter<T>;
export declare const diff: <T>(oldA: T[], newA: T[]) => {
added: T[];
removed: T[];
};
export declare const getTimestamp: () => string;
export declare const isVersionLessThan: (version: string, toCompareWith: string) => boolean;
export declare const onServerCreated: (app: Koa, cb: (server: http.Server) => void) => void;
export declare const getExternalHost: (instance: ReboostInstance) => Promise<string | void>;
export declare const getReadableHRTime: ([seconds, nanoseconds]: [number, number]) => string;
/**
* Forked version of merge-source-map
* Original author KATO Kei
* Licensed under MIT License - https://github.com/keik/merge-source-map/blob/master/LICENSE
*/
export declare const mergeSourceMaps: (oldMap: RawSourceMap, newMap: RawSourceMap) => Promise<RawSourceMap>;
export {};