Aller au contenu

cli/utils/types

Ce contenu n’est pas encore disponible dans votre langue.

type EffectStepFn = (context: BaseContext, debug: boolean, dryRun?: boolean) => Effect.Effect<void, Error>;

Defined in: studiocms/packages/studiocms/src/cli/utils/types.ts:19^

Represents a function that performs an effectful step within a given context.

BaseContext

The base context in which the effect is executed.

boolean

Indicates whether debug mode is enabled.

boolean

Optional flag to indicate if the step should be executed as a dry run (no side effects).

Effect.Effect<void, Error>

An Effect that resolves to void or throws an Error.


type StepFn = (context: BaseContext, debug: boolean, dryRun?: boolean) => Promise<void>;

Defined in: studiocms/packages/studiocms/src/cli/utils/types.ts:9^

Represents a function that performs a step within a given context.

BaseContext

boolean

boolean

Promise<void>


type StepMap = Record<string, EffectStepFn>;

Defined in: studiocms/packages/studiocms/src/cli/utils/types.ts:34^

A mapping of step names to their corresponding effect step functions.

This type is used to associate a string key (typically the name or identifier of a step) with an EffectStepFn, which represents the function to execute for that step.

EffectStepFn

function appendOptionsToSteps(
options: string[],
steps: EffectStepFn[],
stepMap: StepMap): void;

Defined in: studiocms/packages/studiocms/src/cli/utils/types.ts:46^

Appends effect step functions to the provided steps array based on the given options.

Iterates over the options array, retrieves the corresponding step function from stepMap for each option, and pushes it to the steps array if it exists.

string[]

An array of option strings used to look up step functions.

EffectStepFn[]

The array of EffectStepFn to which matched step functions will be appended.

StepMap

A mapping of option strings to their corresponding EffectStepFn.

void