MCPcopy Create free account
hub / github.com/effect-app/libs / float

Function float

repos/effect/packages/effect/src/unstable/cli/Prompt.ts:938–968  ·  view source on GitHub ↗
(options: FloatOptions)

Source from the content-addressed store, hash-verified

936 initial: new globalThis.Date(),
937 dateMask: "YYYY-MM-DD HH:mm:ss",
938 validate: Effect.succeed,
939 ...options,
940 locales: {
941 ...defaultLocales,
942 ...options.locales
943 }
944 }
945 const dateParts = makeDateParts(opts.dateMask, opts.initial, opts.locales)
946 const initialCursorPosition = dateParts.findIndex((part) => !part.isToken())
947 const initialState: DateState = {
948 dateParts,
949 typed: "",
950 cursor: initialCursorPosition,
951 value: opts.initial,
952 error: Option.none()
953 }
954 return Custom(initialState, {
955 render: handleDateRender(opts),
956 process: handleDateProcess(opts),
957 clear: handleDateClear(opts)
958 })
959}
960
961/**
962 * Creates a file-system selection prompt and returns the selected path.
963 *
964 * **Details**
965 *
966 * The prompt can be configured to select files, directories, or either path
967 * type.
968 *
969 * You can also type to filter the listed entries. Every printable character is
970 * appended to the filter query, so navigation is bound to the arrow keys,
971 * `tab`, and the `Ctrl+P` / `Ctrl+N` chords used by `readline` and `fzf`

Callers

nothing calls this directly

Calls 6

handleRenderFloatFunction · 0.85
handleProcessFloatFunction · 0.85
handleNumberClearFunction · 0.85
customFunction · 0.70
failMethod · 0.45
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…