import type { BaseGenerator, GetGeneratorOptions } from '@yeoman/types'; import { type FileTransform } from 'mem-fs'; import { type MemFsEditorFile } from 'mem-fs-editor'; import type { BaseOptions, ComposeOptions, GeneratorPipelineOptions, Priority, Task, TaskOptions } from '../types.js'; import type Generator from '../index.js'; import type BaseGeneratorImpl from '../generator.js'; type TaskStatus = { cancelled: boolean; timestamp: Date; }; export declare abstract class TasksMixin { readonly _queues: Record; customLifecycle?: boolean; runningState?: { namespace: string; queueName: string; methodName: string; }; _taskStatus?: TaskStatus; /** * Register priorities for this generator */ registerPriorities(this: BaseGeneratorImpl, priorities: Priority[]): void; /** * Schedule methods on a run queue. * * @param method: Method to be scheduled or object with function properties. * @param methodName Name of the method (task) to be scheduled. * @param queueName Name of the queue to be scheduled on. * @param reject Reject callback. */ queueMethod(method: Task['method'], methodName: string, queueName: Task['queueName'], reject: Task['reject']): void; queueMethod(method: Record, methodName: string | Task['reject'], reject?: Task['reject']): void; /** * Schedule tasks from a group on a run queue. * * @param taskGroup: Object containing tasks. * @param taskOptions options. */ queueTaskGroup(this: BaseGeneratorImpl, taskGroup: Record, taskOptions: TaskOptions): void; /** * Get task sources property descriptors. */ getTaskSourcesPropertyDescriptors(this: BaseGeneratorImpl): any; /** * Extract tasks from a priority. * * @param name: The method name to schedule. */ extractTasksFromPriority(this: BaseGeneratorImpl, name: string, taskOptions?: TaskOptions): Task[]; /** * Extract tasks from group. * * @param group Task group. * @param taskOptions options. */ extractTasksFromGroup(this: BaseGeneratorImpl, group: Record, taskOptions: TaskOptions): Task[]; /** * Schedule a generator's method on a run queue. * * @param name: The method name to schedule. * @param taskOptions options. */ queueOwnTask(this: BaseGeneratorImpl, name: string, taskOptions: TaskOptions): void; /** * Get task names. */ getTaskNames(this: BaseGeneratorImpl): string[]; /** * Schedule every generator's methods on a run queue. */ queueOwnTasks(this: BaseGeneratorImpl, taskOptions: TaskOptions): void; /** * Schedule tasks on a run queue. * * @param task: Task to be queued. */ queueTask(this: BaseGeneratorImpl, task: Task): void; /** * Execute a task. * * @param task: Task to be executed. * @param args: Task arguments. * @param taskStatus. */ executeTask(this: BaseGeneratorImpl, task: Task, args?: any[] | ((generator: Generator) => any[]) | undefined, taskStatus?: TaskStatus | undefined): Promise; /** * Ignore cancellable tasks. */ cancelCancellableTasks(this: BaseGeneratorImpl): void; /** * Queue generator tasks. */ queueTasks(this: BaseGeneratorImpl): Promise; _queueTasks(this: BaseGeneratorImpl): Promise; /** * Start the generator again. */ startOver(this: BaseGeneratorImpl, options?: BaseOptions): void; /** * Compose this generator with another one. * @param generator The path to the generator module or an object (see examples) * @param args Arguments passed to the Generator * @param options The options passed to the Generator * @param immediately Boolean whether to queue the Generator immediately * @return The composed generator * * @example Using a peerDependency generator * await this.composeWith('bootstrap', { sass: true }); * * @example Using a direct dependency generator * await this.composeWith(path.resolve(_dirname, 'generator-bootstrap/app/main.js'), { sass: true }); * * @example Passing a Generator class * await this.composeWith({ Generator: MyGenerator, path: '../generator-bootstrap/app/main.js' }, { sass: true }); */ composeWith(generator: string | { Generator: any; path: string; }, immediately?: boolean): Promise; composeWith(generator: string[], immediately?: boolean): Promise; composeWith(generator: string | { Generator: any; path: string; }, options: Partial>, immediately?: boolean): Promise; composeWith(generator: string[], options: Partial>, immediately?: boolean): Promise; composeWith(generator: string | { Generator: any; path: string; }, args: string[], options?: Partial>, immediately?: boolean): Promise; composeWith(generator: string[], args: string[], options?: Partial>, immediately?: boolean): Promise; composeWith(generator: string, options?: ComposeOptions): Promise; private composeWithOptions; private composeLocallyWithOptions; private resolveGeneratorPath; pipeline(this: BaseGeneratorImpl, options?: GeneratorPipelineOptions, ...transforms: Array>): Promise; /** * Add a transform stream to the commit stream. * * Most usually, these transform stream will be Gulp plugins. * * @param streams An array of Transform stream * or a single one. * @return This generator */ queueTransformStream(this: BaseGeneratorImpl, options?: GeneratorPipelineOptions & { priorityToQueue?: string; }, ...transforms: Array>): BaseGeneratorImpl, BaseOptions, import("../types.js").BaseFeatures, Record, Record, Record>; } export {};