From 9f3970a7e1148b527da395ece0ca662c024e4f39 Mon Sep 17 00:00:00 2001 From: dwarakaprasad Date: Fri, 8 Mar 2024 23:43:47 -0500 Subject: [PATCH] add call back function support to deceide generator scheduling requiredby jhipster/generator-jhipster#25445 --- workspaces/types/types/environment/environment.d.ts | 3 ++- workspaces/types/types/environment/methods-options.d.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/workspaces/types/types/environment/environment.d.ts b/workspaces/types/types/environment/environment.d.ts index f60d49c..bcaeaf9 100644 --- a/workspaces/types/types/environment/environment.d.ts +++ b/workspaces/types/types/environment/environment.d.ts @@ -13,6 +13,7 @@ import type { BaseGeneratorMeta, InstantiateOptions, ComposeOptions, + SchedulingOptions, } from './methods-options.js'; export type EnvironmentConstructor = new ( @@ -149,7 +150,7 @@ export type BaseEnvironment(generator: G, queueOptions?: { schedule?: boolean }): Promise; + queueGenerator(generator: G, queueOptions?: SchedulingOptions): Promise; rootGenerator(): G; diff --git a/workspaces/types/types/environment/methods-options.d.ts b/workspaces/types/types/environment/methods-options.d.ts index 9e51efb..ea75a52 100644 --- a/workspaces/types/types/environment/methods-options.d.ts +++ b/workspaces/types/types/environment/methods-options.d.ts @@ -81,4 +81,9 @@ export type InstantiateOptions = { generatorOptions?: Partial, 'env' | 'resolved' | 'namespace'>> | undefined; }; -export type ComposeOptions = InstantiateOptions & { schedule?: boolean }; +export type ComposeOptions = InstantiateOptions & SchedulingOptions; + +export type SchedulingOptions = { + /** Schedule can be a simple boolean or a function defined in the generator that returns a boolean */ + schedule?: boolean | ((generator: G) => boolean); +};