Skip to content

Commit

Permalink
incorporate review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarakaprasad committed Mar 9, 2024
1 parent 9f3970a commit cb4c8dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions workspaces/types/types/environment/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type {
BaseGeneratorMeta,
InstantiateOptions,
ComposeOptions,
SchedulingOptions,
} from './methods-options.js';

export type EnvironmentConstructor<A extends InputOutputAdapter = InputOutputAdapter> = new (
Expand Down Expand Up @@ -150,7 +149,7 @@ export type BaseEnvironment<A = InputOutputAdapter, S extends Store<MemFsEditorF
*/
getVersion(dependency: string): string | undefined;

queueGenerator<G extends BaseGenerator = BaseGenerator>(generator: G, queueOptions?: SchedulingOptions): Promise<G>;
queueGenerator<G extends BaseGenerator = BaseGenerator>(generator: G, queueOptions?: { schedule?: boolean }): Promise<G>;

rootGenerator<G extends BaseGenerator = BaseGenerator>(): G;

Expand Down
8 changes: 6 additions & 2 deletions workspaces/types/types/environment/methods-options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ export type InstantiateOptions<G extends BaseGenerator = BaseGenerator> = {
generatorOptions?: Partial<Omit<GetGeneratorOptions<G>, 'env' | 'resolved' | 'namespace'>> | undefined;
};

export type ComposeOptions<G extends BaseGenerator = BaseGenerator> = InstantiateOptions<G> & SchedulingOptions;
export type ComposeOptions<G extends BaseGenerator = BaseGenerator> = InstantiateOptions<G> & SchedulingOptions<G>;

export type SchedulingOptions<G extends BaseGenerator = BaseGenerator> = {
/** Schedule can be a simple boolean or a function defined in the generator that returns a boolean */
/**
* 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);
};

0 comments on commit cb4c8dc

Please sign in to comment.