UNPKG

woltlab-compiler

Version:

A compiler for WoltLab-Package Archives and WoltLab-Package Components

69 lines (68 loc) 1.75 kB
/** * Provides the functionality to compile a component. */ export declare abstract class Compiler<T> { /** * The item to compile. */ private item; /** * The path to save the compiled item to. */ private destinationPath; /** * Initializes a new instance of the `Compiler<T>` class. * * @param item * The item to compile. */ constructor(item: T); /** * Gets the item to compile. */ readonly Item: T; /** * Gets or sets the path to save the compiled item to. */ DestinationPath: string; /** * Compiles the item. */ Execute(): Promise<void>; /** * Compiles the item. */ protected abstract Compile(): Promise<void>; /** * Copies files using `EJS`. * * @param source * The source to copy the files from. * * @param destination * The destination to copy the files to. * * @param context * The context to use. */ protected CopyTemplate(source: string, destination: string, context?: { [key: string]: any; }): Promise<void>; /** * Joins the paths and returns the path contained by the destination-folder. * * @param path * The path that is to be joined. */ protected MakeDestinationPath(...path: string[]): string; /** * Compresses a folder and saves the result to a specified file. * * @param source * The folder that is to be compressed. * * @param destination * The filename to save the compressed file to. */ protected Compress(source: string, destination: string): Promise<void>; }