import { BulldogConfig } from './BulldogConfig'; import { Process } from './processes/Process'; /** * Object of tag names */ export interface ITags { [x: string]: boolean; } /** * A child tree */ export interface ITreeChild extends ITree { time: number; } /** * Transformed tree */ export interface ITransformed { path: string; isFolder: boolean; creator: string; time: number; tags: ITags; transformId: string; transformData?: Record; } export interface ITree { tags: ITags; files?: { [x: string]: ITreeChild; }; isFolder?: boolean; parent: string; path: string; state: string; transformed?: ITransformed[]; } export declare class Bulldog { /** * If true cached tree will be used * @defaultValue true */ private cache; /** * If true the output folder will be cleared before use. * @defaultValue true */ private clear; /** * The directory to be processed */ private entry; /** * The directory to save the assets */ private output; /** * If true then output will be checked to see if it was modified * @defaultValue false */ private checkOutputModified; /** * Determines * @defaultValue true */ private verbose; /** * A hash of child trees */ private hash; /** * Array of glob patterns to be ignored when processed */ private ignore; /** * A hash of file locations to be ignored */ private ignoreHash; /** * The current tree */ private tree; /** * The cached tree */ private cachedTree; /** * TODO */ private dirty; /** * TODO */ private currentDirty; /** * Bulldog face animation */ private bulldogFace; /** * PAth to store the cached tree */ private CACHE_TREE_PATH; /** * Manages processes and changes in assets */ private processor; /** * A signature to identify the cache */ private sig; /** * If the tree is currently being processed */ private processingTree; private _watcher; private _finishPromise; private _finishResolve; /** * Start the application! * * @param config - bulldog config file used to customize this instance of Bulldog. */ constructor(config: BulldogConfig); /** * Adds a process to the stack. * * @param process - Process to be run. * @returns This instance of Bulldog. */ add(process: T): this; /** * Creates an empty tree. * @returns Returns an empty tree. */ createRootNode(): ITree; /** * Recursively checks all folders in a directory to check if a folder had been modified. Will cause assets to be recompiled if true. * @param modifiedTime - The time the directory was last modified. * @param dir - Directory to be checked if modified. * @returns If the folder was modified. */ checkIfFolderModified(modifiedTime: number, dir: string): boolean; /** * Starts Bulldog. */ run(): Promise; /** * Watches for changes in the input directory. Reprocesses the tree on change. */ watch(): Promise; /** * this will stop bulldog from watching files * it will make sure to finish its process and writing to the cache before it does! */ stop(): Promise; /** * a promise that lets you know bulldog has finished processing and is now idle, waiting for any new changes */ finishedProcessing(): Promise; /** * Recursively walks through the input directory. Creates a tree from its children. * @param dir - Directory to be walked through. * @param branch - * @param firstRun - */ walk(dir: string, branch: ITree, firstRun?: boolean): void; /** * Modifies the state of the tree to be `modified` * @param tree - Tree to be made dirty */ markDirty(tree: ITree): void; /** * Logs the state of the tree. Skipped if verbose is true. * @param tree - Tree to be read. * @param indent - Spacing for console log1 */ read(tree: ITree, indent?: string): void; /** * Extracts the tags from the folders name and returns an object with those tags * @param fileName - Name of folder * @returns An object of tags associated with the folder */ extractTags(fileName: string): ITags; /** * Compares changes between two trees * @param tree1 - Tree to be compared * @param tree2 - Tree to be compared */ compareChanges(tree1: ITree, tree2: ITree): void; /** * Marks a tree for deletion. * @param tree - The tree to be marked as deleted */ markAsDeleted(tree: ITree): void; /** * Removes deleted files from the cached tree. * * @param tree - Tree that the files will be removed from. */ removeDeletesFromTree(tree: ITree): void; /** * Starts processing the tree. Periodically attempts to re=process if tree is dirty */ processTree(): void; /** * Determines whether the path should be ignored based on an array of glob patterns * * @param relativePath - Path to be checked * @returns If the path should be ignored */ shouldIgnore(relativePath: string): boolean; } //# sourceMappingURL=Bulldog.d.ts.map