MCPcopy Create free account
hub / github.com/Effect-TS/effect / Custom

Function Custom

packages/effect/src/cli/Prompt.ts:948–965  ·  view source on GitHub ↗
(
  initialState: State | Effect.Effect<State, never, Environment>,
  ...args:
    | [handlers: Handlers<State, Output, Terminal.UserInput>]
    | [events: Queue.Dequeue<A, never>, handlers: Handlers<State, Output, ProcessInput<A>>]
)

Source from the content-addressed store, hash-verified

946 handlers: Handlers<State, Output, ProcessInput<A>>
947 ): Prompt<Output>
948} = <State, Output, A>(
949 initialState: State | Effect.Effect<State, never, Environment>,
950 ...args:
951 | [handlers: Handlers<State, Output, Terminal.UserInput>]
952 | [events: Queue.Dequeue<A, never>, handlers: Handlers<State, Output, ProcessInput<A>>]
953): Prompt<Output> => {
954 const [events, handlers] = args.length === 1
955 ? [undefined, args[0]] as const
956 : [args[0], args[1]] as const
957 const op = Object.create(proto)
958 op._tag = "Loop"
959 op.initialState = initialState
960 op.render = handlers.render
961 op.process = handlers.process
962 op.clear = handlers.clear
963 op.events = events
964 return op
965}
966
967/**
968 * Creates a date prompt that lets the user edit a formatted date value and

Callers 10

ConfirmFunction · 0.70
DateFunction · 0.70
FileFunction · 0.70
NumberFunction · 0.70
IntFunction · 0.70
SelectFunction · 0.70
AutoCompleteFunction · 0.70
MultiSelectFunction · 0.70
ToggleFunction · 0.70
basePromptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected