import { NonceInfo, InitProps } from "./types"; /** * Load CDN map * * @param cdnMap CDN map * @returns cdn Map, if not found, return undefined */ export declare function loadCdnMap(cdnMap: string): any; /** * get * * @param file - string to wrap * @param data - string go before fragment * @returns if found, return request's path name, if not, return false */ export declare function mapCdn(file: string, data: Record): string | boolean; /** * Wrap a string fragment with prefix and postfix * If fragment is falsy, then return empty string `""` * * @param fragment - string to wrap * @param prefix - string go before fragment * @param postfix - go after fragment * @returns wrapped string */ export declare function wrapStringFragment(fragment: string, prefix?: string, postfix?: string): string; export declare function nonceGenerator(_?: string): string; /** * generate nonce token * * @param token init props * @param fallback nonce fallback * @param tag nonce token tag or nonce generator tag * @returns an object with generated string token and nonce info */ export declare function generateNonce(token: Partial<{ props: InitProps; }>, fallback?: NonceInfo, tag?: string): { attr: string; nonce?: NonceInfo; }; /** * Join a base url with path parts * * @param baseUrl - base url (protocol, host, port, first path parts) * @param pathParts - other path parts. the first one start with ? or & causes * the remaining parts to be treated as query params * @returns full URL */ export declare function urlJoin(baseUrl: string, ...pathParts: string[]): string; export declare const SSR_PIPELINES: unique symbol; /** * Stringify a JSON object and replace some tags to avoid XSS: * - `` => `</script>` * * @param obj - object to stringify * @returns JSON string of object */ export declare function safeStringifyJson(obj: any): string; /** * Wait for a condition and execute rest of the code. * @param conditionFunction - A function that returns conditions to be waited for. * @param maxWait - Max duration (in ms) to wait before promise resolves to avoid indefinite wait. * @returns A promise that resolves after given condition in conditionFunction is satisfied or after the max wait time. */ export declare function until(conditionFunction: any, maxWait: any): Promise;