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

Function custom

packages/effect/src/unstable/cli/Prompt.ts:800–817  ·  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

798 handlers: Handlers<State, Output, ProcessInput<A>>
799 ): Prompt<Output>
800} = <State, Output, A>(
801 initialState: State | Effect.Effect<State, never, Environment>,
802 ...args:
803 | [handlers: Handlers<State, Output, Terminal.UserInput>]
804 | [events: Queue.Dequeue<A, never>, handlers: Handlers<State, Output, ProcessInput<A>>]
805): Prompt<Output> => {
806 const [events, handlers] = args.length === 1
807 ? [undefined, args[0]] as const
808 : [args[0], args[1]] as const
809 const op = Object.create(proto)
810 op._tag = "Loop"
811 op.initialState = initialState
812 op.render = handlers.render
813 op.process = handlers.process
814 op.clear = handlers.clear
815 op.events = events
816 return op
817}
818
819/**
820 * 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
floatFunction · 0.70
integerFunction · 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