/// import { ParserOptions } from '@babel/core'; import { Statement } from '@babel/types'; import { EventEmitter } from 'events'; import path from 'path'; import { ParsedQs } from 'qs'; import { Readable } from 'stream'; import { Config } from '../config'; export declare const jsSrcRE: RegExp; export declare const urlRE: RegExp; export declare const cssPreprocessLangRE: RegExp; export declare const cssModuleRE: RegExp; export declare const isCSSRequest: (file: string) => boolean; export declare const isExternalUrl: (url: string) => boolean; /** * Check if a request is an import from js instead of a native resource request * i.e. differentiate * `import('/style.css')` * from * `` * * The ?import query is injected by serverPluginModuleRewrite. */ export declare const isImportRequest: (ctx: any) => boolean; export declare function generateCodeFrame(source: string, start?: number, end?: number): string; /** * Read already set body on a Koa context and normalize it into a string. * Useful in post-processing middlewares. */ export declare function readBody(stream: Readable | Buffer | string | null): Promise; export declare const parseWithQuery: (id: string) => { path: string; query: ParsedQs; }; export declare function readFile(p: string): Promise; export declare function flatten(arr: T[][]): T[]; export declare function needsPrebundle(config: Config, p: string): boolean; export declare const babelParserOpts: ParserOptions; export declare function parse(source: string, sourceFilename?: string): Statement[]; export declare const jsTypeRegex: RegExp; export declare function appendQuery(url: string, query: string): string; export declare function partition(ary: T[], callback: (x: T) => boolean): [T[], T[]]; export declare class Lock extends EventEmitter { private READY_EVENT; isReady: boolean; constructor(); ready(): void; lock(): void; wait(): Promise; } export declare function prepareError(err: Error): { message: string; stack: string; name: string; }; export declare const sleep: (t: any) => Promise; export declare function isEmpty(map: any): boolean; export declare function computeDuration(startTime: number, interval?: string): string; export declare function makeLegalIdentifier(str: any): any; //# sourceMappingURL=utils.d.ts.map