From dca1eee04d6344cb0b2e61f949c293b1d4a5d233 Mon Sep 17 00:00:00 2001 From: Dwarakaprasad Thakku Damodaran Date: Sat, 9 Mar 2024 09:23:06 -0500 Subject: [PATCH] feat(types): add call back function support to decide generator scheduling (#6) * add call back function support to deceide generator scheduling requiredby jhipster/generator-jhipster#25445 * incorporate review suggestions --- .../types/types/environment/methods-options.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/workspaces/types/types/environment/methods-options.d.ts b/workspaces/types/types/environment/methods-options.d.ts index 9e51efb..fa53690 100644 --- a/workspaces/types/types/environment/methods-options.d.ts +++ b/workspaces/types/types/environment/methods-options.d.ts @@ -81,4 +81,13 @@ export type InstantiateOptions = { generatorOptions?: Partial, 'env' | 'resolved' | 'namespace'>> | undefined; }; -export type ComposeOptions = InstantiateOptions & { schedule?: boolean }; +export type ComposeOptions = InstantiateOptions & SchedulingOptions; + +export type SchedulingOptions = { + /** + * Creates a new task to queue the composed generator tasks instead of queueing immediately. + * The task is queued in an Environment’s internal priority which is executed before any generator task. + * Function is accepted starting from Environment 4.4.0. + */ + schedule?: boolean | ((generator: G) => boolean); +};