import * as Promise from 'bluebird'; import * as debug from 'debug'; /** * Plugin defaults. */ export declare const defaults: { basePath: string; stylesheetPath: null; spritePath: string; relativeTo: string; filterBy: never[]; groupBy: never[]; retina: boolean; hooks: { onSaveSpritesheet: null; onUpdateRule: null; }; spritesmith: { engine: string; algorithm: string; padding: number; engineOpts: {}; exportOpts: {}; }; svgsprite: { mode: { css: { dimensions: boolean; bust: boolean; render: { css: boolean; }; }; }; shape: { id: { generator(name: any, file: any): string; }; }; svg: { precision: number; }; }; verbose: boolean; }; /** * Prepares the filter functions. * @param {Object} opts * @param {Result} result * @return */ export declare function prepareFilterBy(opts: any): void; /** * Prepares the group functions. * @param {Object} opts * @return */ export declare function prepareGroupBy(opts: any): void; /** * Walks the given CSS string and extracts all images * that can be converted to sprite. * @param {Node} root * @param {Object} opts * @param {Result} result * @return {Promise} */ export declare function extractImages(root: any, opts: any): any; /** * Apply filterBy functions over collection of exported images. * @param {Object} opts * @param {Array} images * @return {Promise} */ export declare function applyFilterBy(opts: any, images: any): Promise; /** * Apply groupBy functions over collection of exported images. * @param {Object} opts * @param {Array} images * @return {Promise} */ export declare function applyGroupBy(opts: any, images: any): Promise; /** * Replaces the background declarations that needs to be updated * with a sprite image. * @param {Node} root * @param {Object} opts * @param {Array} images * @return {Promise} */ export declare function setTokens(root: any, opts: any, images: any): Promise; /** * Process the images through spritesmith module. * @param {Object} opts * @param {Array} images * @return {Promise} */ export declare function runSpritesmith(opts: any, images: any): Promise; /** * Saves the spritesheets to the disk. * @param {Object} opts * @param {Array} images * @param {Array} spritesheets * @return {Promise} */ export declare function saveSpritesheets(opts: any, images: any, spritesheets: any): Promise; /** * Map spritesheet props to every image. * @param {Object} opts * @param {Array} images * @param {Array} spritesheets * @return {Promise} */ export declare function mapSpritesheetProps(opts: any, images: any, spritesheets: any): Promise; /** * Updates the CSS references. * @param {Node} root * @param {Object} opts * @param {Array} images * @param {Array} spritesheets * @return {Promise} */ export declare function updateReferences(root: any, opts: any, images: any, spritesheets: any): Promise; /** * Update an single CSS rule. * @param {Node} rule * @param {Node} token * @param {Object} image * @return */ export declare function updateRule(rule: any, token: any, image: any): void; /** * Checks for image url in the given CSS rules. * @param {String} rule * @return {Boolean} */ export declare function hasImageInRule(rule: any): boolean; /** * Extracts the url of image from the given rule. * @param {String} rule * @return {Array} */ export declare function getImageUrl(rule: any): string[]; /** * Checks whether the image is supported. * @param {String} url * @return {Boolean} */ export declare function isImageSupported(url: any): boolean; /** * Checks whether the image is retina. * @param {String} url * @return {Boolean} */ export declare function isRetinaImage(url: any): boolean; /** * Extracts the retina ratio of image. * @param {String} url * @return {Number} */ export declare function getRetinaRatio(url: any): number; /** * Extracts the color from background declaration. * @param {String} declValue * @return {String?} */ export declare function getColor(declValue: any): null; /** * Simple helper to avoid collisions with group names. * @param {Boolean} toggle * @return {Function} */ export declare function maskGroup(toggle?: boolean): (value: any) => any; /** * Generate the filepath to the sprite. * @param {Object} opts * @param {Object} spritesheet * @return {String} */ export declare function makeSpritesheetPath(opts: any, { groups, extension }: any): string; /** * Check whether the comment is token that * should be replaced with background declarations. * @param {String} commentValue * @return {Boolean} */ export declare function isToken(commentValue: any): boolean; /** * Create a logger that can be disabled in runtime. * * @param {Boolean} enabled * @return {Function} */ export declare function createLogger(enabled: any): debug.Debugger;