cli/utils/types
Esta página aún no está disponible en tu idioma.
Type Aliases
Section titled “Type Aliases”EffectStepFn()
Section titled “EffectStepFn()”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.
Parameters
Section titled “Parameters”context
Section titled “context”The base context in which the effect is executed.
boolean
Indicates whether debug mode is enabled.
dryRun?
Section titled “dryRun?”boolean
Optional flag to indicate if the step should be executed as a dry run (no side effects).
Returns
Section titled “Returns”Effect.Effect
<void
, Error
>
An Effect that resolves to void or throws an Error.
StepFn()
Section titled “StepFn()”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.
Parameters
Section titled “Parameters”context
Section titled “context”boolean
dryRun?
Section titled “dryRun?”boolean
Returns
Section titled “Returns”Promise
<void
>
StepMap
Section titled “StepMap”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.
Remarks
Section titled “Remarks”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
Functions
Section titled “Functions”appendOptionsToSteps()
Section titled “appendOptionsToSteps()”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.
Parameters
Section titled “Parameters”options
Section titled “options”string
[]
An array of option strings used to look up step functions.
The array of EffectStepFn
to which matched step functions will be appended.
stepMap
Section titled “stepMap”A mapping of option strings to their corresponding EffectStepFn
.
Returns
Section titled “Returns”void