@shell-shock/plugin-prompts 0.3.13 → 0.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.1.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.3.14-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -21,26 +21,6 @@ defu = require_runtime.__toESM(defu);
21
21
  function BasePromptDeclarations() {
22
22
  const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
23
23
  return [
24
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
25
- heading: "A utility function to pause execution for a specified duration, which can be used in prompt interactions to create delays or timeouts. The function returns a promise that resolves after the specified duration in milliseconds, allowing it to be used with async/await syntax for easier handling of asynchronous prompt logic.",
26
- get children() {
27
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
28
- name: "duration",
29
- children: `The duration to sleep in milliseconds.`
30
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves after the specified duration, allowing for asynchronous delays in prompt interactions.` })];
31
- }
32
- }),
33
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
34
- "export": true,
35
- name: "sleep",
36
- parameters: [{
37
- name: "duration",
38
- type: "number"
39
- }],
40
- returnType: "Promise<void>",
41
- children: _alloy_js_core.code`return new Promise((resolve) => setTimeout(resolve, duration)); `
42
- }),
43
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
44
24
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_type_declaration.TypeDeclaration, {
45
25
  "export": true,
46
26
  name: "PromptParser",
@@ -1 +1 @@
1
- {"version":3,"file":"prompts-builtin.d.cts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"mappings":";;;;UA8CiB,mBAAA,SAA4B,IAAA,CAC3C,gBAAA;;AADF;;iBAQgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;AAAtC;iBAu1BgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;;iBAoPtB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AApbzC;;;AAAA,iBAixBgB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;AA7VxC;;iBAykBgB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;;;AA5OzC;iBAwagB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AAAA,iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA,QAAA;;;AA/P1C;iBAsTgB,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,eAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"prompts-builtin.d.cts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"mappings":";;;;UA8CiB,mBAAA,SAA4B,IAAA,CAC3C,gBAAA;;AADF;;iBAQgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;AAAtC;iBAy0BgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;;iBAoPtB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AApbzC;;;AAAA,iBAixBgB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;AA7VxC;;iBAykBgB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;;;AA5OzC;iBAwagB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AAAA,iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA,QAAA;;;AA/P1C;iBAsTgB,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,eAAA,CAAA,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompts-builtin.d.mts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"mappings":";;;;UA8CiB,mBAAA,SAA4B,IAAA,CAC3C,gBAAA;;AADF;;iBAQgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;AAAtC;iBAu1BgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;;iBAoPtB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AApbzC;;;AAAA,iBAixBgB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;AA7VxC;;iBAykBgB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;;;AA5OzC;iBAwagB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AAAA,iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA,QAAA;;;AA/P1C;iBAsTgB,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,eAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"prompts-builtin.d.mts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"mappings":";;;;UA8CiB,mBAAA,SAA4B,IAAA,CAC3C,gBAAA;;AADF;;iBAQgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;AAAtC;iBAy0BgB,sBAAA,CAAA,GAAsB,eAAA,CAAA,QAAA;;;;iBAoPtB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AApbzC;;;AAAA,iBAixBgB,wBAAA,CAAA,GAAwB,eAAA,CAAA,QAAA;;AA7VxC;;iBAykBgB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;;;AA5OzC;iBAwagB,yBAAA,CAAA,GAAyB,eAAA,CAAA,QAAA;AAAA,iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA,QAAA;;;AA/P1C;iBAsTgB,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,eAAA,CAAA,QAAA"}
@@ -18,26 +18,6 @@ import defu from "defu";
18
18
  function BasePromptDeclarations() {
19
19
  const theme = useTheme();
20
20
  return [
21
- createComponent(TSDoc, {
22
- heading: "A utility function to pause execution for a specified duration, which can be used in prompt interactions to create delays or timeouts. The function returns a promise that resolves after the specified duration in milliseconds, allowing it to be used with async/await syntax for easier handling of asynchronous prompt logic.",
23
- get children() {
24
- return [createComponent(TSDocParam, {
25
- name: "duration",
26
- children: `The duration to sleep in milliseconds.`
27
- }), createComponent(TSDocReturns, { children: `A promise that resolves after the specified duration, allowing for asynchronous delays in prompt interactions.` })];
28
- }
29
- }),
30
- createComponent(FunctionDeclaration, {
31
- "export": true,
32
- name: "sleep",
33
- parameters: [{
34
- name: "duration",
35
- type: "number"
36
- }],
37
- returnType: "Promise<void>",
38
- children: code`return new Promise((resolve) => setTimeout(resolve, duration)); `
39
- }),
40
- createComponent(Spacing, {}),
41
21
  createComponent(TypeDeclaration, {
42
22
  "export": true,
43
23
  name: "PromptParser",
@@ -1 +1 @@
1
- {"version":3,"file":"prompts-builtin.mjs","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n ClassDeclaration,\n ClassField,\n ClassMethod,\n ClassPropertyGet\n} from \"@powerlines/plugin-alloy/typescript/components/class-declaration\";\nimport {\n InterfaceDeclaration,\n InterfaceMember\n} from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocExample,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypeDeclaration } from \"@powerlines/plugin-alloy/typescript/components/type-declaration\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport defu from \"defu\";\n\nexport interface PromptsBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {}\n\n/**\n * A component that generates TypeScript declarations for built-in prompt types and related utilities, such as the base Prompt class, specific prompt types like TextPrompt and SelectPrompt, and utility functions for handling prompt cancellations. This component serves as a central place to define the types and interfaces for prompts used in the Shell Shock CLI, providing a consistent API for creating and managing prompts throughout the application.\n */\nexport function BasePromptDeclarations() {\n const theme = useTheme();\n\n return (\n <>\n <TSDoc heading=\"A utility function to pause execution for a specified duration, which can be used in prompt interactions to create delays or timeouts. The function returns a promise that resolves after the specified duration in milliseconds, allowing it to be used with async/await syntax for easier handling of asynchronous prompt logic.\">\n <TSDocParam name=\"duration\">\n {`The duration to sleep in milliseconds.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves after the specified duration, allowing for asynchronous delays in prompt interactions.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"sleep\"\n parameters={[{ name: \"duration\", type: \"number\" }]}\n returnType=\"Promise<void>\">{code`return new Promise((resolve) => setTimeout(resolve, duration)); `}</FunctionDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"PromptParser\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}\n doc=\"A type for a custom prompt input parser, which can be used to create custom input styles for prompts. The function should return the parsed value for the given input string.\">\n {code`(this: Prompt<TValue>, input: string) => TValue; `}\n </TypeDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"PromptFormatter\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}\n doc=\"A type for a custom prompt input formatter, which can be used to create custom display styles for prompts. The function should return the formatted string to display for the given input value.\">\n {code`(this: Prompt<TValue>, input: TValue) => string; `}\n </TypeDeclaration>\n <Spacing />\n <FunctionDeclaration\n export\n name=\"noMask\"\n doc=\"A built-in prompt mask function that just returns the input as is, making it invisible\"\n parameters={[{ name: \"input\", type: \"string\" }]}\n returnType=\"string\">\n {code`return input; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n export\n name=\"invisibleMask\"\n doc=\"A built-in prompt mask function that makes input invisible\"\n parameters={[{ name: \"input\", type: \"string\" }]}\n returnType=\"string\">\n {code`return \" \".repeat(input.length); `}\n </FunctionDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"PromptState\"\n doc=\"The current state of a prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"value\"\n type=\"TValue\"\n doc=\"The current value of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isError\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is in an error state\"\n />\n <Spacing />\n <InterfaceMember\n name=\"errorMessage\"\n optional\n type=\"string\"\n doc=\"If the prompt is in an error state, this will contain the error message to display\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isSubmitted\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is submitted\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isCancelled\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is cancelled\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isCompleted\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is completed, which can be used to indicate that the prompt interaction is finished regardless of whether it was submitted or cancelled\"\n />\n <Spacing />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"PromptConfig\"\n doc=\"Configuration options for creating a prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"input\"\n optional\n type=\"NodeJS.ReadStream\"\n doc=\"The readable stream to use for prompt input, defaults to process.stdin\"\n />\n <Spacing />\n <InterfaceMember\n name=\"output\"\n optional\n type=\"NodeJS.WriteStream\"\n doc=\"The writable stream to use for prompt output, defaults to process.stdout\"\n />\n <Spacing />\n <InterfaceMember\n name=\"message\"\n type=\"string\"\n doc=\"The prompt message to display\"\n />\n <Spacing />\n <InterfaceMember\n name=\"description\"\n optional\n type=\"string\"\n doc=\"The prompt description message to display\"\n />\n <Spacing />\n <InterfaceMember\n name=\"initialValue\"\n optional\n type=\"TValue\"\n doc=\"The initial value of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"validate\"\n optional\n type=\"(value: TValue) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>\"\n doc=\"A validation function that returns true if the input is valid, false or a string error message if the input is invalid\"\n />\n <Spacing />\n <InterfaceMember\n name=\"parse\"\n optional\n type=\"PromptParser<TValue>\"\n doc=\"A function that parses the input value and returns the parsed result or throws an error if the input is invalid\"\n />\n <Spacing />\n <InterfaceMember\n name=\"format\"\n optional\n type=\"PromptFormatter<TValue>\"\n doc=\"A function that formats the input value and returns the formatted result or throws an error if the input is invalid\"\n />\n <Spacing />\n <InterfaceMember\n name=\"mask\"\n optional\n type=\"(input: string) => string\"\n doc=\"A function that masks the input value and returns the masked result. This can be used to create password inputs or other sensitive input types where the actual input value should not be displayed. If not provided, the prompt will display the input as is without masking.\"\n />\n <Spacing />\n <InterfaceMember\n name=\"maskCompleted\"\n optional\n type=\"(input: string) => string\"\n doc=\"A function that masks the value submitted by the user so that it can then be used in the console output or elsewhere without exposing sensitive information. If not provided, the prompt will use the same mask function for both input and submitted value masking.\"\n />\n <Spacing />\n <InterfaceMember\n name=\"defaultErrorMessage\"\n optional\n type=\"string\"\n doc=\"The default error message to display when validation fails\"\n />\n <Spacing />\n <InterfaceMember\n name=\"timeout\"\n optional\n type=\"number\"\n doc=\"The timeout duration in milliseconds for the prompt. If none is provided, the prompt will not time out.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n abstract\n name=\"Prompt\"\n doc=\"Base prompt class that other prompt types can extend from\"\n extends=\"EventEmitter\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <ClassField name=\"readline\" isPrivateMember type=\"readline.Interface\" />\n <hbr />\n <ClassField name=\"value\" isPrivateMember optional type=\"TValue\" />\n <hbr />\n <ClassField name=\"isKeyPressed\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isDirty\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isClosed\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <Spacing />\n <ClassField name=\"initialValue\" abstract protected type=\"TValue\" />\n <hbr />\n <ClassField name=\"input\" protected type=\"NodeJS.ReadStream\">\n {code`process.stdin; `}\n </ClassField>\n <hbr />\n <ClassField name=\"output\" protected type=\"NodeJS.WriteStream\">\n {code`process.stdout; `}\n </ClassField>\n <hbr />\n <ClassField name=\"message\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"description\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"errorMessage\" protected type=\"string | null\">\n {code`null; `}\n </ClassField>\n <hbr />\n <ClassField name=\"defaultErrorMessage\" protected type=\"string\">\n {code`\"An invalid value was provided\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isSubmitted\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isCancelled\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isInitial\" protected type=\"boolean\">\n {code`true; `}\n </ClassField>\n <hbr />\n <ClassField name=\"consoleOutput\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"consoleStatus\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"displayValue\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField\n name=\"validate\"\n protected\n type=\"(value: TValue) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>\">\n {code`() => true; `}\n </ClassField>\n <hbr />\n <ClassField name=\"parse\" protected type=\"PromptParser<TValue>\">\n {code`(value: string) => value as TValue; `}\n </ClassField>\n <hbr />\n <ClassField name=\"format\" protected type=\"PromptFormatter<TValue>\">\n {code`(value: TValue) => String(value); `}\n </ClassField>\n <hbr />\n <ClassField name=\"mask\" protected type=\"(input: string) => string\">\n {code`noMask; `}\n </ClassField>\n <hbr />\n <ClassField\n name=\"maskCompleted\"\n protected\n type=\"(input: string) => string\">\n {code`this.mask; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursor\" protected type=\"number\">\n {code`0; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <Spacing />\n {code`constructor(protected config: PromptConfig<TValue>) {\n super();\n\n if (config.input) {\n this.input = config.input;\n }\n if (config.output) {\n this.output = config.output;\n }\n if (config.defaultErrorMessage) {\n this.defaultErrorMessage = config.defaultErrorMessage;\n }\n if (config.description) {\n this.description = config.description;\n }\n if (config.validate) {\n this.validate = config.validate;\n }\n if (config.parse) {\n this.parse = config.parse.bind(this);\n }\n if (config.format) {\n this.format = config.format.bind(this);\n }\n\n if (config.maskCompleted) {\n this.maskCompleted = config.maskCompleted;\n }\n if (config.mask) {\n this.mask = config.mask;\n }\n\n if (config.timeout !== undefined && !Number.isNaN(config.timeout)) {\n setTimeout(() => {\n if (!this.isCompleted) {\n this.cancel();\n }\n }, config.timeout);\n }\n\n this.message = config.message;\n\n this.#readline = readline.createInterface({\n input: this.input,\n escapeCodeTimeout: 50\n });\n readline.emitKeypressEvents(this.input, this.#readline);\n\n if (this.input.isTTY) {\n this.input.setRawMode(true);\n }\n\n this.input.on(\"keypress\", this.keypress.bind(this));\n }\n\n [Symbol.dispose]() {\n this.close();\n } `}\n <Spacing />\n <ClassPropertyGet\n public\n name=\"value\"\n type=\"TValue\"\n doc=\"A getter for the prompt value that returns the current value or the initial value if the current value is not set\">\n {code`return this.#value || this.initialValue; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet public name=\"isError\" type=\"boolean\">\n {code`return !!this.errorMessage; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"isSelect\" type=\"boolean\">\n {code`return false; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"isCompleted\" type=\"boolean\">\n {code`return this.isCancelled || this.isSubmitted; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"isPlaceholder\" type=\"boolean\">\n {code`return (this.displayValue === this.format(this.initialValue) && !this.#isDirty) || !this.#isKeyPressed; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"status\" type=\"string\">\n {code`return this.isSubmitted ? \"\" : \\` \\\\n \\${\n colors.italic(\n this.isError\n ? colors.text.prompt.description.error(splitText(this.errorMessage, \"3/4\").join(\"\\\\n\"))\n : this.isCancelled\n ? colors.text.prompt.description.cancelled(splitText(\"Input was cancelled by user\", \"3/4\").join(\"\\\\n\"))\n : this.description\n ? colors.text.prompt.description.active(splitText(this.description, \"3/4\").join(\"\\\\n\"))\n : \"\"\n )\n }\\`; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet\n doc=\"A property to check if the cursor is at the start\"\n name=\"isCursorAtStart\"\n protected\n type=\"boolean\">\n {code`return this.cursor <= 0 || (this.isPlaceholder && this.cursor <= 1); `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet\n doc=\"A property to check if the cursor is at the end\"\n name=\"isCursorAtEnd\"\n protected\n type=\"boolean\">\n {code`return this.cursor >= this.displayValue.length || (this.isPlaceholder && this.cursor >= this.displayValue.length - 1); `}\n </ClassPropertyGet>\n <Spacing />\n <ClassMethod\n doc=\"A method to change the prompt value, which also updates the display value and fires a state update event. This method can be called by subclasses whenever the prompt value needs to be updated based on user input or other interactions.\"\n name=\"changeValue\"\n protected\n parameters={[{ name: \"value\", type: \"TValue\" }]}>\n {code`const previousValue = this.value;\n\n let updatedValue = value;\n if (value === undefined || value === \"\") {\n updatedValue = this.initialValue;\n } else {\n updatedValue = value;\n }\n\n this.displayValue = this.mask(this.format(updatedValue));\n this.#value = updatedValue;\n\n if (!this.#isDirty && this.#value !== this.initialValue) {\n this.#isDirty = true;\n }\n\n this.onChange(previousValue);\n setTimeout(() => {\n Promise.resolve(this.checkValidations(updatedValue)).then(() => this.sync());\n }, 0);\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to emit the current state\"\n name=\"sync\"\n protected>\n {code`this.emit(\"state\", {\n value: this.value,\n errorMessage: this.errorMessage,\n isError: this.isError,\n isSubmitted: this.isSubmitted,\n isCancelled: this.isCancelled,\n isCompleted: this.isCompleted\n });\n this.render(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod doc=\"A method to ring the bell\" name=\"bell\" protected>\n {code`this.output.write(beep); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n protected\n returnType=\"string\">\n {code`return this.isPlaceholder\n ? colors.text.prompt.input.disabled(this.displayValue)\n : this.isError\n ? colors.text.prompt.input.error(this.displayValue)\n : this.isSubmitted\n ? colors.text.prompt.input.submitted(this.maskCompleted(this.displayValue))\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.maskCompleted(this.displayValue))\n : colors.bold(colors.text.prompt.input.active(this.displayValue)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle changes in the prompt value\"\n name=\"onChange\"\n protected\n parameters={[\n {\n name: \"previousValue\",\n type: \"TValue\"\n }\n ]}>\n {code` // can be implemented by subclasses to handle value changes if needed, this method is called whenever the prompt value changes and receives the previous value as an argument for reference`}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (!action) {\n this.bell();\n } else if (typeof (this as any)[action] === \"function\") {\n (this as any)[action](key);\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to close the prompt and clean up resources, which also emits a submit or cancel event based on the prompt state. This method should be called when the prompt interaction is finished and the prompt needs to be closed.\"\n name=\"close\"\n async\n protected>\n {code`if (this.#isClosed) {\n return;\n }\n\n this.output.write(cursor.show);\n this.input.removeListener(\"keypress\", this.keypress);\n\n if (this.input.isTTY) {\n this.input.setRawMode(false);\n }\n\n this.#readline.close();\n this.emit(this.isSubmitted ? \"submit\" : \"cancel\", this.value);\n this.#isClosed = true; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to validate the prompt input using the provided validator function, which updates the error message and error state based on the validation result. This method is called whenever the prompt value changes and needs to be validated.\"\n name=\"checkValidations\"\n async\n protected\n parameters={[\n {\n name: \"value\",\n type: \"TValue\"\n }\n ]}>\n {code`let result = await this.validate(value);\n if (typeof result === \"string\") {\n this.errorMessage = result;\n } else if (typeof result === \"boolean\") {\n this.errorMessage = result ? null : this.defaultErrorMessage;\n } else {\n this.errorMessage = null;\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to route key press events to specific prompt actions based on the key pressed. This method maps various key combinations and keys to corresponding actions that can be handled by the prompt, such as submitting, cancelling, navigating, etc.\"\n name=\"getAction\"\n protected\n parameters={[{ name: \"key\", type: \"readline.Key\" }]}\n returnType=\"string | false\">\n {code`if (key.meta && key.name !== \"escape\") {\n return false;\n }\n\n let action: string | undefined;\n if (key.ctrl) {\n if (key.name === \"a\") action = \"first\";\n if (key.name === \"c\") action = \"cancel\";\n if (key.name === \"d\") action = \"cancel\";\n if (key.name === \"e\") action = \"last\";\n if (key.name === \"g\") action = \"reset\";\n }\n\n if (key.name === \"return\") action = \"submit\";\n if (key.name === \"enter\") action = \"submit\";\n if (key.name === \"backspace\") action = \"backspace\";\n if (key.name === \"delete\") action = \"delete\";\n if (key.name === \"cancel\") action = \"cancel\";\n if (key.name === \"escape\") action = \"cancel\";\n if (key.name === \"tab\") action = \"next\";\n if (key.name === \"pagedown\") action = \"nextPage\";\n if (key.name === \"pageup\") action = \"prevPage\";\n if (key.name === \"home\") action = \"home\";\n if (key.name === \"end\") action = \"end\";\n\n if (key.name === \"up\") action = \"up\";\n if (key.name === \"down\") action = \"down\";\n if (key.name === \"right\") action = \"right\";\n if (key.name === \"left\") action = \"left\";\n\n return action || false; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left or right by a \\`count\\` of positions\"\n name=\"moveCursor\"\n parameters={[\n {\n name: \"count\",\n type: \"number\"\n }\n ]}\n protected>\n {code`if (this.cursor + count < 0) {\n this.cursor = 0;\n } else if (this.cursor + count > this.displayValue.length) {\n this.cursor = this.displayValue.length;\n } else {\n this.cursor += count;\n }\n\n `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to remove the character backward of the cursor\"\n name=\"backspace\"\n protected>\n {code`if (this.isCursorAtStart) {\n return this.bell();\n }\n\n if (this.displayValue === \"\") {\n return this.bell();\n }\n\n const isCursorAtEnd = this.isCursorAtEnd && this.displayValue.length === this.cursor;\n\n this.changeValue(this.parse(\\`\\${\n this.displayValue.slice(0, this.cursor - 1)\n }\\${\n this.displayValue.slice(this.cursor)\n }\\`));\n\n this.moveCursor(isCursorAtEnd ? -1 : -2);\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to remove the character forward of the cursor\"\n name=\"delete\"\n protected>\n {code`if (this.isCursorAtEnd) {\n return this.bell();\n }\n\n this.changeValue(this.parse(\\`\\${\n this.displayValue.slice(0, this.cursor)\n }\\${\n this.displayValue.slice(this.cursor + 1)\n }\\`));\n\n if (!this.isCursorAtStart) {\n this.moveCursor(-1);\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to reset the prompt input\"\n name=\"reset\"\n protected>\n {code`this.changeValue(this.initialValue);\n this.cursor = 0;\n\n this.errorMessage = null;\n this.isCancelled = false;\n this.isSubmitted = false;\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to cancel the prompt input\"\n name=\"cancel\"\n protected>\n {code`this.errorMessage = null;\n this.isCancelled = true;\n this.isSubmitted = false;\n\n this.sync();\n this.output.write(\"\\\\n\");\n this.close(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to submit the prompt input\"\n name=\"submit\"\n async\n protected>\n {code`this.cursor = this.displayValue.length;\n\n await this.checkValidations(this.value);\n if (this.isError) {\n this.sync();\n this.bell();\n } else {\n this.isSubmitted = true;\n this.isCancelled = false;\n\n this.sync();\n this.output.write(\"\\\\n\");\n this.close();\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod doc=\"A method to render the prompt\" name=\"render\" private>\n {code`if (this.#isClosed) {\n return;\n }\n\n if (!this.isInitial) {\n if (this.consoleStatus) {\n this.output.write(cursor.down(stripAnsi(this.consoleStatus).split(/\\\\r?\\\\n/).map(line => Math.ceil(line.length / this.output.columns)).reduce((a, b) => a + b) - 1) + clear(this.consoleStatus, this.output.columns));\n }\n\n this.output.write(clear(this.consoleOutput, this.output.columns));\n } else if (this.cursorHidden) {\n this.output.write(cursor.hide);\n }\n\n this.consoleOutput = \\` \\${\n this.isSubmitted\n ? colors.text.prompt.icon.submitted(\"${\n theme.icons.prompt.submitted\n }\")\n : this.isCancelled\n ? colors.text.prompt.icon.cancelled(\"${\n theme.icons.prompt.cancelled\n }\")\n : this.isError\n ? colors.text.prompt.icon.error(\"${theme.icons.prompt.error}\")\n : colors.text.prompt.icon.active(\"${theme.icons.prompt.active}\")\n } \\${\n this.isCompleted\n ? colors.text.prompt.message.submitted(this.message)\n : colors.bold(colors.text.prompt.message.active(this.message))\n } \\${\n colors.border.app.divider.tertiary(\n this.isCompleted\n ? (process.platform === \"win32\" ? \"...\" : \"…\")\n : (process.platform === \"win32\" ? \"»\" : \"›\")\n )\n } \\`;\n this.consoleOutput += this.onRender();\n\n if (this.isInitial) {\n this.isInitial = false;\n }\n\n this.output.write(erase.line + cursor.to(0) + this.consoleOutput + (this.status ? cursor.save + this.status + cursor.restore + cursor.move(this.displayValue.length - (this.displayValue.length - this.cursor) - this.displayValue.length, 0) : cursor.save));\n this.consoleStatus = this.status; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"keypress\"\n private\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`if (this.#isClosed) {\n return;\n }\n\n if (!this.#isKeyPressed) {\n this.#isKeyPressed = true;\n }\n\n return this.onKeyPress(char, key); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"PromptFactoryConfig\"\n extends=\"PromptConfig<TValue>\"\n doc=\"Configuration options for creating a prompt with a prompt factory function\"\n typeParameters={[{ name: \"TValue\", default: \"string\" }]}>\n <InterfaceMember\n name=\"onState\"\n optional\n type=\"(state: PromptState<TValue>) => any\"\n doc=\"A function that is called when the prompt state changes, useful for updating the prompt message or other properties dynamically\"\n />\n <Spacing />\n <InterfaceMember\n name=\"onSubmit\"\n optional\n type=\"(value: TValue) => any\"\n doc=\"A function that is called when the prompt is submitted, useful for handling the submitted value or performing actions based on the prompt state\"\n />\n <Spacing />\n <InterfaceMember\n name=\"onCancel\"\n optional\n type=\"(event: any) => any\"\n doc=\"A function that is called when the prompt is canceled, useful for handling the canceled value or performing actions based on the prompt state\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"A unique symbol used to indicate that a prompt was cancelled, which can be returned from a prompt function to signal that the prompt interaction should be cancelled and any pending promises should be rejected with this symbol. This allows for a consistent way to handle prompt cancellations across different prompt types and interactions.\" />\n <VarDeclaration export name=\"CANCEL_SYMBOL\">\n {code`Symbol(\"shell-shock:prompts:cancel\"); `}\n </VarDeclaration>\n <Spacing />\n <TSDoc heading=\"A utility function to check if a given value is the {@link CANCEL_SYMBOL | cancel symbol}, which can be used to determine if a prompt interaction was cancelled based on the value returned from a prompt factory function. This function checks if the provided value is strictly equal to the {@link CANCEL_SYMBOL | CANCEL_SYMBOL}, allowing for a consistent way to handle prompt cancellations across different prompt types and interactions.\">\n <TSDocParam name=\"value\">{`The value to check.`}</TSDocParam>\n <TSDocReturns>\n {`A boolean indicating whether the provided value is the {@link CANCEL_SYMBOL | cancel symbol}, which can be used to determine if a prompt interaction was cancelled.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"isCancel\"\n export\n parameters={[\n {\n name: \"value\",\n type: \"any\"\n }\n ]}\n returnType=\"value is typeof CANCEL_SYMBOL\">\n {code`return value === CANCEL_SYMBOL; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * Declarations for a text-based prompt that allows users to input and edit text, with support for cursor movement, deletion, and custom masking. This prompt type can be used for various text input scenarios, such as entering a username, password, or any other string input. The TextPrompt class extends the base Prompt class and implements specific logic for handling text input and editing interactions.\n */\nexport function TextPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n name=\"StringPromptConfig\"\n extends=\"PromptConfig<string>\"\n doc=\"Configuration options for creating a text-based prompt\">\n <InterfaceMember\n name=\"initialValue\"\n optional\n type=\"string\"\n doc=\"The initial value of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"mask\"\n optional\n type=\"(input: string) => string\"\n doc=\"A function that masks the input value and returns the masked result\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n name=\"StringPrompt\"\n doc=\"A prompt for text input\"\n extends=\"Prompt<string>\">\n <ClassField name=\"isInvalid\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"initialValue\" protected override type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: StringPromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n if (this.initialValue) {\n this.changeValue(this.initialValue);\n }\n\n this.cursor = 0;\n this.sync();\n this.last();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"A method to handle onKeyPress events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if (!char || char.length === 0) {\n return this.bell();\n }\n\n this.changeValue(\\`\\${\n this.displayValue.slice(0, this.cursor)\n }\\${char}\\${\n this.displayValue.slice(this.cursor)\n }\\`);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle changes in the prompt value\"\n name=\"onChange\"\n override\n protected\n parameters={[\n {\n name: \"previousValue\",\n type: \"string\"\n }\n ]}>\n {code`this.#isInvalid = false;\n this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to reset the prompt input\"\n name=\"reset\"\n override\n protected>\n {code`this.cursor = Number(!!this.initialValue);\n super.reset(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to validate the prompt input\"\n name=\"checkValidations\"\n override\n async\n protected>\n {code`await super.checkValidations(this.value);\n this.#isInvalid = this.isError; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end of the input\"\n name=\"next\"\n protected>\n {code`this.changeValue(this.initialValue);\n this.cursor = this.displayValue.length;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the start\"\n name=\"first\"\n protected>\n {code`this.cursor = 0;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end\"\n name=\"last\"\n protected>\n {code`this.cursor = this.displayValue.length;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left\"\n name=\"left\"\n protected>\n {code`if (this.cursor <= 0) {\n return this.bell();\n }\n\n this.moveCursor(-1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the right\"\n name=\"right\"\n protected>\n {code`if (this.cursor >= this.displayValue.length) {\n return this.bell();\n }\n\n this.moveCursor(1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isPlaceholder\n ? colors.text.prompt.input.disabled(this.displayValue)\n : this.#isInvalid\n ? colors.text.prompt.input.error(this.displayValue)\n : this.isSubmitted\n ? colors.text.prompt.input.submitted(this.displayValue)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.displayValue)\n : colors.bold(colors.text.prompt.input.active(this.displayValue)); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"A type definition for the configuration options to pass to the text prompt, which extends the base PromptConfig with additional options specific to text prompts. This type can be used when creating a text prompt using the {@link text | text prompt factory function} or when manually creating an instance of the TextPrompt class. The TextConfig type includes all the properties of the base PromptConfig, such as message, description, initialValue, validate, parse, format, mask, etc., as well as any additional properties that are specific to text prompts.\" />\n <TypeDeclaration name=\"TextConfig\" export>\n {code`PromptFactoryConfig<string> & StringPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a text prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocRemarks>\n {code`This function can be used to easily create and run a text prompt without needing to manually create an instance of the TextPrompt class and handle its events. The function accepts a configuration object that extends the base PromptFactoryConfig with additional options specific to text prompts, such as the initial value and mask function. The returned promise allows for easy handling of the prompt result using async/await syntax or traditional promise chaining.`}\n </TSDocRemarks>\n <TSDocExample>\n {`import { text, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const name = await text({\n message: \"What is your name?\",\n description: \"Please enter your full name\",\n validate: value => value.trim().length > 0 || \"Name cannot be empty\"\n });\n if (isCancel(name)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"Hello, \" + name + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the text prompt, which extends the base PromptConfig with additional options specific to text prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"text\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"TextConfig\"\n }\n ]}\n returnType=\"Promise<string | symbol>\">\n {code`return new Promise<string | symbol>((response, reject) => {\n const prompt = new StringPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * Declarations for a select prompt that allows users to choose from a list of options, with support for pagination, option descriptions, and disabled options. This prompt type can be used for scenarios where the user needs to select one option from a predefined list, such as choosing a color, selecting a file, or picking an item from a menu. The SelectPrompt class extends the base Prompt class and implements specific logic for handling option selection and navigation interactions.\n */\nexport function SelectPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n name=\"PromptOptionConfig\"\n doc=\"Configuration for an option the user can select from the select prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"label\"\n optional\n type=\"string\"\n doc=\"The message label for the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"icon\"\n optional\n type=\"string\"\n doc=\"An icon for the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"value\"\n type=\"TValue\"\n doc=\"The value of the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"description\"\n optional\n type=\"string\"\n doc=\"The description of the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"selected\"\n optional\n type=\"boolean\"\n doc=\"Whether the option is selected\"\n />\n <Spacing />\n <InterfaceMember\n name=\"disabled\"\n optional\n type=\"boolean\"\n doc=\"Whether the option is disabled\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"PromptOption\"\n extends=\"PromptOptionConfig<TValue>\"\n doc=\"An option the user can select from the select prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"label\"\n type=\"string\"\n doc=\"The message label for the option\"\n />\n <InterfaceMember\n name=\"index\"\n type=\"number\"\n doc=\"The index of the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"selected\"\n type=\"boolean\"\n doc=\"Whether the option is selected\"\n />\n <Spacing />\n <InterfaceMember\n name=\"disabled\"\n type=\"boolean\"\n doc=\"Whether the option is disabled\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"SelectPromptConfig\"\n extends=\"PromptConfig<TValue>\"\n doc=\"An options object for configuring a select prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"hint\"\n optional\n type=\"string\"\n doc=\"A hint to display to the user\"\n />\n <Spacing />\n <InterfaceMember\n name=\"options\"\n type=\"Array<string | PromptOptionConfig<TValue>>\"\n doc=\"The options available for the select prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"optionsPerPage\"\n optional\n type=\"number\"\n doc=\"The number of options to display per page, defaults to 8\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n name=\"SelectPrompt\"\n doc=\"A prompt for selecting an option from a list\"\n extends=\"Prompt<TValue>\"\n typeParameters={[{ name: \"TValue\", default: \"string\" }]}>\n <ClassField name=\"initialValue\" protected override type=\"TValue\" />\n <hbr />\n <ClassField name=\"optionsPerPage\" protected type=\"number\">\n {code`8; `}\n </ClassField>\n <hbr />\n <ClassField name=\"options\" protected type=\"PromptOption<TValue>[]\">\n {code`[]; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected override type=\"boolean\">\n {code`true; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: SelectPromptConfig<TValue>) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue as TValue;\n } else {\n this.initialValue = undefined as unknown as TValue;\n }\n\n this.options = config.options.map((opt, index) => {\n let option = {} as Partial<PromptOption<TValue>>;\n if (typeof opt === \"string\") {\n option = { label: opt, value: opt as TValue, selected: false, disabled: false };\n } else if (typeof opt === \"object\") {\n option = opt;\n } else {\n throw new Error(\\`Invalid option provided to SelectPrompt at index #\\${index}\\`);\n }\n\n return {\n label: String(option.value) || \"\",\n ...option,\n description: option.description,\n selected: !!option.selected || (this.initialValue !== undefined && option.value === this.initialValue),\n disabled: !!option.disabled\n } as PromptOption<TValue>;\n }).sort((a, b) => a.label.localeCompare(b.label)).map((option, index) => ({ ...option, index }));\n\n const selected = this.options.findIndex(option => option.selected);\n if (selected > -1) {\n this.cursor = selected;\n if (this.options[this.cursor]) {\n this.initialValue = this.options[this.cursor].value as TValue;\n }\n }\n\n if (this.initialValue === undefined && this.options.length > 0 && this.options[0]) {\n this.initialValue = this.options[0].value as TValue;\n }\n\n if (config.optionsPerPage) {\n this.optionsPerPage = config.optionsPerPage;\n }\n\n this.sync();\n } `}\n <Spacing />\n <ClassPropertyGet\n doc=\"Returns the currently selected option\"\n name=\"selectedOption\"\n type=\"PromptOption<TValue> | null\"\n protected>\n {code`return this.options.find(option => option.value === this.value) ?? null; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassMethod\n doc=\"A method to route key press events to specific prompt actions based on the key pressed. This method maps various key combinations and keys to corresponding actions that can be handled by the prompt, such as submitting, cancelling, navigating, etc.\"\n name=\"getAction\"\n override\n protected\n parameters={[{ name: \"key\", type: \"readline.Key\" }]}\n returnType=\"string | false\">\n {code`let action = super.getAction(key);\n if (!action) {\n if (key.name === \"j\") action = \"down\";\n if (key.name === \"k\") action = \"up\";\n }\n\n return action || false; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to reset the prompt input\"\n name=\"reset\"\n override\n protected>\n {code`this.moveCursor(0);\n super.reset(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to submit the prompt input\"\n name=\"submit\"\n async\n override\n protected>\n {code`if (!this.selectedOption?.disabled) {\n await super.submit();\n } else {\n this.bell();\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end of the input\"\n name=\"next\"\n protected>\n {code`this.moveCursor((this.cursor + 1) % this.options.length);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left or right by a \\`count\\` of positions\"\n name=\"moveCursor\"\n parameters={[\n {\n name: \"count\",\n type: \"number\"\n }\n ]}\n override\n protected>\n {code`this.cursor = count;\n\n this.changeValue(this.options[count]!.value);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the first option\"\n name=\"first\"\n protected>\n {code`this.moveCursor(0);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the last option\"\n name=\"last\"\n protected>\n {code`this.moveCursor(this.options.length - 1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the start\"\n name=\"first\"\n protected>\n {code`this.cursor = 0;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the up\"\n name=\"up\"\n protected>\n {code`if (this.cursor === 0) {\n this.moveCursor(this.options.length - 1);\n } else {\n this.moveCursor(this.cursor - 1);\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the down\"\n name=\"down\"\n protected>\n {code`if (this.cursor === this.options.length - 1) {\n this.moveCursor(0);\n } else {\n this.moveCursor(this.cursor + 1);\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected>\n {code`const spacing = Math.max(...this.options.map(option => option.label?.length || 0)) + 2;\n\n const startIndex = Math.max(Math.min(this.options.length - this.optionsPerPage, this.cursor - Math.floor(this.optionsPerPage / 2)), 0);\n const endIndex = Math.min(startIndex + this.optionsPerPage, this.options.length);\n\n let output = \"\";\n if (!this.isCompleted) {\n output += \" \\\\n\";\n for (let index = startIndex; index < endIndex; index++) {\n output += \\`\\${\n this.options[index].disabled\n ? this.cursor === index\n ? colors.bold(colors.text.prompt.input.disabled(\">\"))\n : index === startIndex\n ? colors.border.app.divider.tertiary(\"↑\")\n : index === endIndex - 1\n ? colors.border.app.divider.tertiary(\"↓\")\n : \" \"\n : this.cursor === index\n ? colors.bold(colors.text.prompt.input.active(\">\"))\n : index === startIndex\n ? colors.border.app.divider.tertiary(\"↑\")\n : index === endIndex - 1\n ? colors.border.app.divider.tertiary(\"↓\")\n : \" \"\n } \\${\n this.options[index]!.disabled\n ? this.cursor === index\n ? colors.bold(colors.text.prompt.input.disabled(this.options[index]!.icon ? colors.underline(\\`\\${this.options[index]!.icon} \\`) : \"\"))\n : colors.strikethrough(colors.text.prompt.input.disabled(this.options[index]!.icon ? \\`\\${this.options[index].icon} \\` : \"\"))\n : this.cursor === index\n ? colors.bold(colors.text.prompt.input.active(this.options[index]!.icon ? colors.underline(\\`\\${this.options[index]!.icon} \\`) : \"\"))\n : colors.text.prompt.input.inactive(this.options[index]!.icon ? \\`\\${this.options[index].icon} \\` : \"\")\n }\\${\n this.options[index]!.disabled\n ? this.cursor === index\n ? colors.bold(colors.underline(colors.text.prompt.input.disabled(this.options[index].label)))\n : colors.strikethrough(colors.text.prompt.input.disabled(this.options[index]!.label))\n : this.cursor === index\n ? colors.bold(colors.underline(colors.text.prompt.input.active(this.options[index]!.label)))\n : colors.text.prompt.input.inactive(this.options[index]!.label)\n } \\${\" \".repeat(spacing - this.options[index]!.label.length - (this.options[index]!.icon ? this.options[index]!.icon!.length + 1 : 0))}\\${\n this.options[index]!.description && this.cursor === index\n ? colors.italic(colors.text.prompt.description.active(this.options[index]!.description))\n : \"\"\n } \\\\n\\`;\n }\n } else {\n this.displayValue = this.selectedOption?.label || String(this.value);\n output += super.onRender();\n }\n\n return output; `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"A type definition for the configuration options to pass to the select prompt, which extends the base PromptConfig with additional options specific to select prompts. This type can be used when creating a select prompt using the {@link select | select prompt factory function}.\">\n <TSDocRemarks>\n {`The Select Config type includes all the properties of the base PromptConfig, such as message, description, initialValue, validate, parse, format, etc., as well as any additional properties that are specific to select prompts, such as the list of options and pagination settings.`}\n </TSDocRemarks>\n </TSDoc>\n <TypeDeclaration export name=\"SelectConfig\">\n {code`PromptFactoryConfig<string> & SelectPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a select prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { select, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const color = await select({\n message: \"What is your favorite color?\",\n description: \"Please select your favorite color\",\n validate: value => value.trim().length > 0 || \"Color cannot be empty\",\n options: [\n { label: \"Red\", value: \"red\", description: \"The color of fire and blood\" },\n { label: \"Green\", value: \"green\", description: \"The color of nature and growth\" },\n { label: \"Blue\", value: \"blue\", description: \"The color of the sky and sea\" },\n { label: \"Yellow\", value: \"yellow\", description: \"The color of sunshine and happiness\" }\n ]\n });\n if (isCancel(color)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"Your favorite color is \" + color + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the select prompt, which extends the base PromptConfig with additional options specific to select prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"select\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"SelectConfig\"\n }\n ]}\n returnType=\"Promise<string | symbol>\">\n {code`return new Promise<string | symbol>((response, reject) => {\n const prompt = new SelectPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component that renders the declarations for the built-in numeric prompt, which allows users to input and select numeric values with various configuration options such as floating point support, precision, increment, and min/max values.\n */\nexport function NumericPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n name=\"NumberPromptConfig\"\n extends=\"PromptConfig<number>\"\n doc=\"Configuration options for creating a numeric prompt\">\n <InterfaceMember\n name=\"isFloat\"\n optional\n type=\"boolean\"\n doc=\"Whether the prompt should accept floating point numbers\"\n />\n <Spacing />\n <InterfaceMember\n name=\"precision\"\n optional\n type=\"number\"\n doc=\"The number of decimal places to round the input to, defaults to 2\"\n />\n <Spacing />\n <InterfaceMember\n name=\"increment\"\n optional\n type=\"number\"\n doc=\"The increment value for the number prompt, defaults to 1\"\n />\n <Spacing />\n <InterfaceMember\n name=\"min\"\n optional\n type=\"number\"\n doc=\"The minimum value for the number prompt, defaults to -Infinity\"\n />\n <Spacing />\n <InterfaceMember\n name=\"max\"\n optional\n type=\"number\"\n doc=\"The maximum value for the number prompt, defaults to Infinity\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n name=\"NumberPrompt\"\n doc=\"A prompt for selecting a number input\"\n extends=\"Prompt<number>\">\n <ClassField name=\"isInvalid\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <Spacing />\n <ClassField name=\"initialValue\" protected override type=\"number\">\n {code`0; `}\n </ClassField>\n <hbr />\n <ClassField name=\"defaultErrorMessage\" protected override type=\"string\">\n {code`\"A valid numeric value must be provided\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isFloat\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"precision\" protected type=\"number\">\n {code`2; `}\n </ClassField>\n <hbr />\n <ClassField name=\"increment\" protected type=\"number\">\n {code`1; `}\n </ClassField>\n <hbr />\n <ClassField name=\"min\" protected type=\"number\">\n {code`Number.NEGATIVE_INFINITY; `}\n </ClassField>\n <hbr />\n <ClassField name=\"max\" protected type=\"number\">\n {code`Number.POSITIVE_INFINITY; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: NumberPromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n this.isFloat = !!config.isFloat;\n if (config.precision !== undefined) {\n this.precision = config.precision;\n }\n if (config.increment !== undefined) {\n this.increment = config.increment;\n }\n if (config.min !== undefined) {\n this.min = config.min;\n }\n if (config.max !== undefined) {\n this.max = config.max;\n }\n\n if (config.parse) {\n this.parse = config.parse.bind(this);\n } else {\n const parse = (value: string) => this.isFloat ? Math.round(Math.pow(10, this.precision) * Number.parseFloat(value)) / Math.pow(10, this.precision) : Number.parseInt(value);\n this.parse = parse.bind(this);\n }\n\n if (config.validate) {\n this.validate = config.validate.bind(this);\n } else {\n const validate = (value: number) => !Number.isNaN(value) && value >= this.min && value <= this.max;\n this.validate = validate.bind(this);\n }\n\n this.changeValue(this.initialValue);\n\n this.cursor = 0;\n this.sync();\n this.last();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if ((char !== \"-\" || (char === \"-\" && this.cursor !== 0)) && !(char === \".\" && this.isFloat) && !/[0-9]/.test(char)) {\n return this.bell();\n }\n\n const displayValue = \\`\\${\n this.displayValue.slice(0, this.cursor)\n }\\${char}\\${\n this.displayValue.slice(this.cursor)\n }\\`;\n\n let value = this.parse(displayValue);\n if (!Number.isNaN(value)) {\n\n value = Math.min(value, this.max);\n if (value > this.max) {\n value = this.max;\n }\n if (value < this.min) {\n value = this.min;\n }\n }\n\n this.changeValue(value);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle changes in the prompt value\"\n name=\"onChange\"\n override\n protected\n parameters={[\n {\n name: \"previousValue\",\n type: \"number\"\n }\n ]}>\n {code`this.#isInvalid = false;\n this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to validate the prompt input\"\n name=\"checkValidations\"\n override\n async\n protected>\n {code`await super.checkValidations(this.value);\n this.#isInvalid = this.isError; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end of the input\"\n name=\"next\"\n protected>\n {code`this.changeValue(this.initialValue);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the up\"\n name=\"up\"\n protected>\n {code`let value = this.value;\n if (this.isPlaceholder) {\n value = this.min < 0 ? 0 : this.min;\n } else if (value >= this.max) {\n return this.bell();\n }\n\n this.changeValue(value + this.increment);\n\n this.sync();\n this.last(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the down\"\n name=\"down\"\n protected>\n {code`let value = this.value;\n if (this.isPlaceholder) {\n value = this.min < 0 ? 0 : this.min;\n } else if (value <= this.min) {\n return this.bell();\n }\n\n this.changeValue(value === this.min ? this.min : value - this.increment);\n this.sync();\n this.last(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left\"\n name=\"left\"\n protected>\n {code`if (this.cursor <= 0) {\n return this.bell();\n }\n\n this.moveCursor(-1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the right\"\n name=\"right\"\n protected>\n {code`if (this.cursor >= this.displayValue.length) {\n return this.bell();\n }\n\n this.moveCursor(1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the start\"\n name=\"first\"\n protected>\n {code`this.cursor = 0;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end\"\n name=\"last\"\n protected>\n {code`this.cursor = this.displayValue.length;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isPlaceholder\n ? colors.text.prompt.input.disabled(this.displayValue)\n : this.#isInvalid\n ? colors.text.prompt.input.error(this.displayValue)\n : this.isSubmitted\n ? colors.text.prompt.input.submitted(this.displayValue)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.displayValue)\n : colors.bold(colors.text.prompt.input.active(this.displayValue)); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a numeric prompt.\" />\n <TypeDeclaration name=\"NumericConfig\" export>\n {code`PromptFactoryConfig<number> & NumberPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a numeric prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { numeric, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const age = await numeric({\n message: \"How old are you?\",\n description: \"Please enter your age in years\",\n validate: value => value < 21 ? \"You must be at least 21 years old\" : true,\n });\n if (isCancel(age)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"Your age is \" + age + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the numeric prompt, which extends the base PromptFactoryConfig with additional options specific to numeric prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"numeric\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"NumericConfig\"\n }\n ]}\n returnType=\"Promise<number | symbol>\">\n {code`return new Promise<number | symbol>((response, reject) => {\n const prompt = new NumberPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component that renders the declarations for the built-in toggle prompt, which allows users to select a boolean value (true/false) with support for custom messages for the true and false states. This prompt type can be used for scenarios where the user needs to toggle a setting on or off, such as enabling or disabling a feature. The TogglePrompt class extends the base Prompt class and implements specific logic for handling boolean input and rendering interactions.\n */\nexport function TogglePromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"TogglePromptConfig\"\n extends=\"PromptConfig<boolean>\"\n doc=\"Configuration options for creating a boolean toggle prompt\">\n <InterfaceMember\n name=\"trueMessage\"\n optional\n type=\"string\"\n doc=\"The message for the true state of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"falseMessage\"\n optional\n type=\"string\"\n doc=\"The message for the false state of the prompt\"\n />\n <Spacing />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n export\n name=\"TogglePrompt\"\n doc=\"A prompt for toggling a boolean input\"\n extends=\"Prompt<boolean>\">\n <ClassField name=\"initialValue\" protected override type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"trueMessage\" protected type=\"string\">\n {code`\"Yes\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"falseMessage\" protected type=\"string\">\n {code`\"No\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected override type=\"boolean\">\n {code`true; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: TogglePromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n if (config.trueMessage) {\n this.trueMessage = config.trueMessage;\n }\n if (config.falseMessage) {\n this.falseMessage = config.falseMessage;\n }\n\n this.sync();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"Update the toggle value to a checked state based on user input\"\n name=\"check\"\n protected>\n {code`if (this.value === true) {\n return this.bell();\n }\n\n this.changeValue(true);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"Update the toggle value to an unchecked state based on user input\"\n name=\"uncheck\"\n protected>\n {code`if (this.value === false) {\n return this.bell();\n }\n\n this.changeValue(false);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if (char === \" \") {\n this.changeValue(!this.value);\n } else if (char === \"1\") {\n this.changeValue(true);\n } else if (char === \"0\") {\n this.changeValue(false);\n } else {\n return this.bell();\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to remove the character backward of the cursor\"\n name=\"backspace\"\n protected>\n {code`this.uncheck(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left\"\n name=\"left\"\n protected>\n {code`this.uncheck(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the right\"\n name=\"right\"\n protected>\n {code`this.check(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to down\"\n name=\"down\"\n protected>\n {code`this.uncheck(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to up\"\n name=\"up\"\n protected>\n {code`this.check(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move to the next value\"\n name=\"next\"\n protected>\n {code`this.changeValue(!this.value);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isSubmitted\n ? colors.text.prompt.input.submitted(this.value ? this.trueMessage : this.falseMessage)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.value ? this.trueMessage : this.falseMessage)\n : \\`\\${\n this.value ? colors.text.prompt.input.inactive(this.falseMessage) : colors.underline(colors.bold(colors.text.prompt.input.active(this.falseMessage)))\n } \\${colors.border.app.divider.tertiary(\"/\")} \\${\n this.value ? colors.underline(colors.bold(colors.text.prompt.input.active(this.trueMessage))) : colors.text.prompt.input.inactive(this.trueMessage)\n }\\`; `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a toggle prompt, which extends the base PromptFactoryConfig with additional options specific to the toggle prompt.\" />\n <TypeDeclaration name=\"ToggleConfig\" export>\n {code`PromptFactoryConfig<boolean> & TogglePromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a toggle prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { toggle, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const likesIceCream = await toggle({\n message: \"Do you like ice cream?\"\n });\n if (isCancel(likesIceCream)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"You\" + (likesIceCream ? \" like ice cream\" : \" don't like ice cream\") + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the toggle prompt, which extends the base PromptFactoryConfig with additional options specific to the toggle prompt`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"toggle\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"ToggleConfig\"\n }\n ]}\n returnType=\"Promise<boolean | symbol>\">\n {code`return new Promise<boolean | symbol>((response, reject) => {\n const prompt = new TogglePrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component that renders the declarations for the built-in confirm prompt, which allows users to select a boolean value (true/false) with support for custom messages for the true and false states. This prompt type can be used for scenarios where the user needs to toggle a setting on or off, such as enabling or disabling a feature. The ConfirmPrompt class extends the base Prompt class and implements specific logic for handling boolean input and rendering interactions.\n */\nexport function ConfirmPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"ConfirmPromptConfig\"\n extends=\"PromptConfig<boolean>\"\n doc=\"Configuration options for creating a boolean confirm prompt\">\n <TSDoc heading=\"The message for the \\`Yes\\` state of the prompt\">\n <TSDocDefaultValue type={ReflectionKind.string} defaultValue=\"Yes\" />\n </TSDoc>\n <InterfaceMember name=\"yesMessage\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The \\`Yes\\` option when choosing between yes/no\">\n <TSDocDefaultValue type={ReflectionKind.string} defaultValue=\"1\" />\n </TSDoc>\n <InterfaceMember name=\"yesOption\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The message for the \\`No\\` state of the prompt\">\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"(Y/n)\"\n />\n </TSDoc>\n <InterfaceMember name=\"noMessage\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The \\`No\\` option when choosing between yes/no\">\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"(y/N)\"\n />\n </TSDoc>\n <InterfaceMember name=\"noOption\" optional type=\"string\" />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n export\n name=\"ConfirmPrompt\"\n doc=\"A prompt for confirming a boolean input\"\n extends=\"Prompt<boolean>\">\n <ClassField name=\"initialValue\" protected override type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"yesMessage\" protected type=\"string\">\n {code`\"Yes\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"yesOption\" protected type=\"string\">\n {code`\"(Y/n)\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"noMessage\" protected type=\"string\">\n {code`\"No\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"noOption\" protected type=\"string\">\n {code`\"(y/N)\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected override type=\"boolean\">\n {code`true; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: ConfirmPromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n if (config.yesMessage) {\n this.yesMessage = config.yesMessage;\n }\n if (config.yesOption) {\n this.yesOption = config.yesOption;\n }\n if (config.noMessage) {\n this.noMessage = config.noMessage;\n }\n if (config.noOption) {\n this.noOption = config.noOption;\n }\n\n this.sync();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if (char.toLowerCase() === \"y\" || char.toLowerCase() === \"t\" || char.toLowerCase() === \"0\") {\n this.changeValue(true);\n return this.submit();\n } else if (char.toLowerCase() === \"n\" || char.toLowerCase() === \"f\" || char.toLowerCase() === \"1\") {\n this.changeValue(false);\n return this.submit();\n } else {\n return this.bell();\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isSubmitted\n ? colors.text.prompt.input.submitted(this.value ? this.yesMessage : this.noMessage)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.value ? this.yesMessage : this.noMessage)\n : colors.text.prompt.input.inactive(this.initialValue ? this.yesOption : this.noOption); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a confirm prompt, which extends the base PromptFactoryConfig with additional options specific to the confirm prompt.\" />\n <TypeDeclaration name=\"ConfirmConfig\" export>\n {code`PromptFactoryConfig<boolean> & ConfirmPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a confirm prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { confirm, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const likesIceCream = await confirm({\n message: \"Do you like ice cream?\"\n });\n if (isCancel(likesIceCream)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"You\" + (likesIceCream ? \" like ice cream\" : \" don't like ice cream\") + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the confirm prompt, which extends the base PromptFactoryConfig with additional options specific to the confirm prompt`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"confirm\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"ConfirmConfig\"\n }\n ]}\n returnType=\"Promise<boolean | symbol>\">\n {code`return new Promise<boolean | symbol>((response, reject) => {\n const prompt = new ConfirmPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n }); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * Declarations for a password prompt that allows users to input and edit text, with support for cursor movement, deletion, and custom masking. This prompt type can be used for various text input scenarios, such as entering a password or any other string input. The PasswordPrompt class extends the base Prompt class and implements specific logic for handling password input and editing interactions.\n */\nexport function PasswordPromptDeclaration() {\n return (\n <>\n <FunctionDeclaration\n export\n name=\"passwordMask\"\n doc=\"A built-in prompt mask function that masks input with asterisks\"\n parameters={[{ name: \"input\", type: \"string\" }]}\n returnType=\"string\">\n {code`return \"*\".repeat(input.length); `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a password prompt, which extends the base PromptFactoryConfig with additional options specific to password prompts.\" />\n <TypeDeclaration name=\"PasswordConfig\" export>\n {code`Omit<TextConfig, \"mask\" | \"maskCompleted\">; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a password prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocRemarks>\n {code`This function creates an instance of the TextPrompt class with the provided configuration options and a custom mask function to handle password input. It sets up event listeners for state updates, submission, and cancellation to handle the prompt interactions and return the appropriate results. The password prompt allows users to input text that is masked for privacy, making it suitable for scenarios like entering passwords or sensitive information.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocExample>\n {`import { password, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const userPassword = await password({\n message: \"Enter your password\"\n });\n if (isCancel(userPassword)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"You entered a password!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the password prompt, which extends the base PromptConfig with additional options specific to password prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"password\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"PasswordConfig\"\n }\n ]}\n returnType=\"Promise<string | symbol>\">\n {code`return text({\n ...config,\n mask: passwordMask,\n maskCompleted: () => \"*******\"\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport function WaitForKeyPressDeclaration() {\n return (\n <>\n <TSDoc heading=\"A function to create and run a wait-for-key-press prompt, which returns a promise that resolves when any key is pressed or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocRemarks>\n {code`This function creates an instance of the Prompt class with a custom onKeyPress handler that resolves the promise when any key is pressed. It sets up event listeners for state updates and cancellation to handle the prompt interactions and return the appropriate results. The wait-for-key-press prompt is useful for scenarios where you want to pause execution until the user presses any key, such as waiting for user input before proceeding with a task.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocExample>\n {`import { waitForKeyPress } from \"shell-shock:prompts\";\n\nasync function run() {\n const result = await waitForKeyPress();\n console.log(\"A key was pressed!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"timeout\">\n {`The amount of time in milliseconds to wait before automatically resolving the prompt, defaults to 2 hours (7200000 ms)`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves when any key is pressed`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"waitForKeyPress\"\n export\n parameters={[\n {\n name: \"timeout\",\n default: \"7200000\"\n }\n ]}>\n {code`process.stdin.setRawMode(true);\n return new Promise(resolve => process.stdin.once(\"data\", () => {\n if (timeout >= 0) {\n setTimeout(() => {\n process.stdin.setRawMode(false);\n resolve(void 0);\n }, timeout);\n }\n\n process.stdin.setRawMode(false);\n resolve(void 0);\n })); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A built-in prompts module for Shell Shock.\n */\nexport function PromptsBuiltin(props: PromptsBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <BuiltinFile\n id=\"prompts\"\n description=\"A collection of prompts that allow for interactive input in command-line applications.\"\n {...rest}\n imports={defu(rest.imports ?? {}, {\n \"node:events\": \"EventEmitter\",\n \"node:readline\": \"readline\"\n })}\n builtinImports={defu(rest.builtinImports ?? {}, {\n console: [\n \"erase\",\n \"beep\",\n \"cursor\",\n \"colors\",\n \"clear\",\n \"stripAnsi\",\n \"splitText\"\n ],\n env: [\"env\", \"isCI\", \"isTest\", \"isWindows\", \"isDevelopment\", \"isDebug\"]\n })}>\n <Spacing />\n <BasePromptDeclarations />\n <Spacing />\n <TextPromptDeclarations />\n <Spacing />\n <SelectPromptDeclarations />\n <Spacing />\n <NumericPromptDeclarations />\n <Spacing />\n <TogglePromptDeclarations />\n <Spacing />\n <PasswordPromptDeclaration />\n <Spacing />\n <ConfirmPromptDeclarations />\n <Spacing />\n <WaitForKeyPressDeclaration />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,SAAE,yBAAiB;CACjB,MAAA,QAAY,UAAA;AACZ,QAAA;EAAA,gBAAU,OAAA;GACV,SAAA;GACA,IAAA,WAAA;AACI,WAAG,CAAA,gBAAuB,YAAY;KACpC,MAAC;KACD,UAAU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AAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KAChC,IAAA,OAAA;AACE,aAAS,QAAA,SAAgB;;KAErB;KACR,CAAA;IAAA;;EAEA,CAAA,CAAA"}
1
+ {"version":3,"file":"prompts-builtin.mjs","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n ClassDeclaration,\n ClassField,\n ClassMethod,\n ClassPropertyGet\n} from \"@powerlines/plugin-alloy/typescript/components/class-declaration\";\nimport {\n InterfaceDeclaration,\n InterfaceMember\n} from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocExample,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypeDeclaration } from \"@powerlines/plugin-alloy/typescript/components/type-declaration\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport defu from \"defu\";\n\nexport interface PromptsBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {}\n\n/**\n * A component that generates TypeScript declarations for built-in prompt types and related utilities, such as the base Prompt class, specific prompt types like TextPrompt and SelectPrompt, and utility functions for handling prompt cancellations. This component serves as a central place to define the types and interfaces for prompts used in the Shell Shock CLI, providing a consistent API for creating and managing prompts throughout the application.\n */\nexport function BasePromptDeclarations() {\n const theme = useTheme();\n\n return (\n <>\n <TypeDeclaration\n export\n name=\"PromptParser\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}\n doc=\"A type for a custom prompt input parser, which can be used to create custom input styles for prompts. The function should return the parsed value for the given input string.\">\n {code`(this: Prompt<TValue>, input: string) => TValue; `}\n </TypeDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"PromptFormatter\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}\n doc=\"A type for a custom prompt input formatter, which can be used to create custom display styles for prompts. The function should return the formatted string to display for the given input value.\">\n {code`(this: Prompt<TValue>, input: TValue) => string; `}\n </TypeDeclaration>\n <Spacing />\n <FunctionDeclaration\n export\n name=\"noMask\"\n doc=\"A built-in prompt mask function that just returns the input as is, making it invisible\"\n parameters={[{ name: \"input\", type: \"string\" }]}\n returnType=\"string\">\n {code`return input; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n export\n name=\"invisibleMask\"\n doc=\"A built-in prompt mask function that makes input invisible\"\n parameters={[{ name: \"input\", type: \"string\" }]}\n returnType=\"string\">\n {code`return \" \".repeat(input.length); `}\n </FunctionDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"PromptState\"\n doc=\"The current state of a prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"value\"\n type=\"TValue\"\n doc=\"The current value of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isError\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is in an error state\"\n />\n <Spacing />\n <InterfaceMember\n name=\"errorMessage\"\n optional\n type=\"string\"\n doc=\"If the prompt is in an error state, this will contain the error message to display\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isSubmitted\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is submitted\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isCancelled\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is cancelled\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isCompleted\"\n type=\"boolean\"\n doc=\"Indicates whether the prompt is completed, which can be used to indicate that the prompt interaction is finished regardless of whether it was submitted or cancelled\"\n />\n <Spacing />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"PromptConfig\"\n doc=\"Configuration options for creating a prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"input\"\n optional\n type=\"NodeJS.ReadStream\"\n doc=\"The readable stream to use for prompt input, defaults to process.stdin\"\n />\n <Spacing />\n <InterfaceMember\n name=\"output\"\n optional\n type=\"NodeJS.WriteStream\"\n doc=\"The writable stream to use for prompt output, defaults to process.stdout\"\n />\n <Spacing />\n <InterfaceMember\n name=\"message\"\n type=\"string\"\n doc=\"The prompt message to display\"\n />\n <Spacing />\n <InterfaceMember\n name=\"description\"\n optional\n type=\"string\"\n doc=\"The prompt description message to display\"\n />\n <Spacing />\n <InterfaceMember\n name=\"initialValue\"\n optional\n type=\"TValue\"\n doc=\"The initial value of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"validate\"\n optional\n type=\"(value: TValue) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>\"\n doc=\"A validation function that returns true if the input is valid, false or a string error message if the input is invalid\"\n />\n <Spacing />\n <InterfaceMember\n name=\"parse\"\n optional\n type=\"PromptParser<TValue>\"\n doc=\"A function that parses the input value and returns the parsed result or throws an error if the input is invalid\"\n />\n <Spacing />\n <InterfaceMember\n name=\"format\"\n optional\n type=\"PromptFormatter<TValue>\"\n doc=\"A function that formats the input value and returns the formatted result or throws an error if the input is invalid\"\n />\n <Spacing />\n <InterfaceMember\n name=\"mask\"\n optional\n type=\"(input: string) => string\"\n doc=\"A function that masks the input value and returns the masked result. This can be used to create password inputs or other sensitive input types where the actual input value should not be displayed. If not provided, the prompt will display the input as is without masking.\"\n />\n <Spacing />\n <InterfaceMember\n name=\"maskCompleted\"\n optional\n type=\"(input: string) => string\"\n doc=\"A function that masks the value submitted by the user so that it can then be used in the console output or elsewhere without exposing sensitive information. If not provided, the prompt will use the same mask function for both input and submitted value masking.\"\n />\n <Spacing />\n <InterfaceMember\n name=\"defaultErrorMessage\"\n optional\n type=\"string\"\n doc=\"The default error message to display when validation fails\"\n />\n <Spacing />\n <InterfaceMember\n name=\"timeout\"\n optional\n type=\"number\"\n doc=\"The timeout duration in milliseconds for the prompt. If none is provided, the prompt will not time out.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n abstract\n name=\"Prompt\"\n doc=\"Base prompt class that other prompt types can extend from\"\n extends=\"EventEmitter\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <ClassField name=\"readline\" isPrivateMember type=\"readline.Interface\" />\n <hbr />\n <ClassField name=\"value\" isPrivateMember optional type=\"TValue\" />\n <hbr />\n <ClassField name=\"isKeyPressed\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isDirty\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isClosed\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <Spacing />\n <ClassField name=\"initialValue\" abstract protected type=\"TValue\" />\n <hbr />\n <ClassField name=\"input\" protected type=\"NodeJS.ReadStream\">\n {code`process.stdin; `}\n </ClassField>\n <hbr />\n <ClassField name=\"output\" protected type=\"NodeJS.WriteStream\">\n {code`process.stdout; `}\n </ClassField>\n <hbr />\n <ClassField name=\"message\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"description\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"errorMessage\" protected type=\"string | null\">\n {code`null; `}\n </ClassField>\n <hbr />\n <ClassField name=\"defaultErrorMessage\" protected type=\"string\">\n {code`\"An invalid value was provided\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isSubmitted\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isCancelled\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isInitial\" protected type=\"boolean\">\n {code`true; `}\n </ClassField>\n <hbr />\n <ClassField name=\"consoleOutput\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"consoleStatus\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"displayValue\" protected type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <hbr />\n <ClassField\n name=\"validate\"\n protected\n type=\"(value: TValue) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>\">\n {code`() => true; `}\n </ClassField>\n <hbr />\n <ClassField name=\"parse\" protected type=\"PromptParser<TValue>\">\n {code`(value: string) => value as TValue; `}\n </ClassField>\n <hbr />\n <ClassField name=\"format\" protected type=\"PromptFormatter<TValue>\">\n {code`(value: TValue) => String(value); `}\n </ClassField>\n <hbr />\n <ClassField name=\"mask\" protected type=\"(input: string) => string\">\n {code`noMask; `}\n </ClassField>\n <hbr />\n <ClassField\n name=\"maskCompleted\"\n protected\n type=\"(input: string) => string\">\n {code`this.mask; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursor\" protected type=\"number\">\n {code`0; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <Spacing />\n {code`constructor(protected config: PromptConfig<TValue>) {\n super();\n\n if (config.input) {\n this.input = config.input;\n }\n if (config.output) {\n this.output = config.output;\n }\n if (config.defaultErrorMessage) {\n this.defaultErrorMessage = config.defaultErrorMessage;\n }\n if (config.description) {\n this.description = config.description;\n }\n if (config.validate) {\n this.validate = config.validate;\n }\n if (config.parse) {\n this.parse = config.parse.bind(this);\n }\n if (config.format) {\n this.format = config.format.bind(this);\n }\n\n if (config.maskCompleted) {\n this.maskCompleted = config.maskCompleted;\n }\n if (config.mask) {\n this.mask = config.mask;\n }\n\n if (config.timeout !== undefined && !Number.isNaN(config.timeout)) {\n setTimeout(() => {\n if (!this.isCompleted) {\n this.cancel();\n }\n }, config.timeout);\n }\n\n this.message = config.message;\n\n this.#readline = readline.createInterface({\n input: this.input,\n escapeCodeTimeout: 50\n });\n readline.emitKeypressEvents(this.input, this.#readline);\n\n if (this.input.isTTY) {\n this.input.setRawMode(true);\n }\n\n this.input.on(\"keypress\", this.keypress.bind(this));\n }\n\n [Symbol.dispose]() {\n this.close();\n } `}\n <Spacing />\n <ClassPropertyGet\n public\n name=\"value\"\n type=\"TValue\"\n doc=\"A getter for the prompt value that returns the current value or the initial value if the current value is not set\">\n {code`return this.#value || this.initialValue; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet public name=\"isError\" type=\"boolean\">\n {code`return !!this.errorMessage; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"isSelect\" type=\"boolean\">\n {code`return false; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"isCompleted\" type=\"boolean\">\n {code`return this.isCancelled || this.isSubmitted; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"isPlaceholder\" type=\"boolean\">\n {code`return (this.displayValue === this.format(this.initialValue) && !this.#isDirty) || !this.#isKeyPressed; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet protected name=\"status\" type=\"string\">\n {code`return this.isSubmitted ? \"\" : \\` \\\\n \\${\n colors.italic(\n this.isError\n ? colors.text.prompt.description.error(splitText(this.errorMessage, \"3/4\").join(\"\\\\n\"))\n : this.isCancelled\n ? colors.text.prompt.description.cancelled(splitText(\"Input was cancelled by user\", \"3/4\").join(\"\\\\n\"))\n : this.description\n ? colors.text.prompt.description.active(splitText(this.description, \"3/4\").join(\"\\\\n\"))\n : \"\"\n )\n }\\`; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet\n doc=\"A property to check if the cursor is at the start\"\n name=\"isCursorAtStart\"\n protected\n type=\"boolean\">\n {code`return this.cursor <= 0 || (this.isPlaceholder && this.cursor <= 1); `}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertyGet\n doc=\"A property to check if the cursor is at the end\"\n name=\"isCursorAtEnd\"\n protected\n type=\"boolean\">\n {code`return this.cursor >= this.displayValue.length || (this.isPlaceholder && this.cursor >= this.displayValue.length - 1); `}\n </ClassPropertyGet>\n <Spacing />\n <ClassMethod\n doc=\"A method to change the prompt value, which also updates the display value and fires a state update event. This method can be called by subclasses whenever the prompt value needs to be updated based on user input or other interactions.\"\n name=\"changeValue\"\n protected\n parameters={[{ name: \"value\", type: \"TValue\" }]}>\n {code`const previousValue = this.value;\n\n let updatedValue = value;\n if (value === undefined || value === \"\") {\n updatedValue = this.initialValue;\n } else {\n updatedValue = value;\n }\n\n this.displayValue = this.mask(this.format(updatedValue));\n this.#value = updatedValue;\n\n if (!this.#isDirty && this.#value !== this.initialValue) {\n this.#isDirty = true;\n }\n\n this.onChange(previousValue);\n setTimeout(() => {\n Promise.resolve(this.checkValidations(updatedValue)).then(() => this.sync());\n }, 0);\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to emit the current state\"\n name=\"sync\"\n protected>\n {code`this.emit(\"state\", {\n value: this.value,\n errorMessage: this.errorMessage,\n isError: this.isError,\n isSubmitted: this.isSubmitted,\n isCancelled: this.isCancelled,\n isCompleted: this.isCompleted\n });\n this.render(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod doc=\"A method to ring the bell\" name=\"bell\" protected>\n {code`this.output.write(beep); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n protected\n returnType=\"string\">\n {code`return this.isPlaceholder\n ? colors.text.prompt.input.disabled(this.displayValue)\n : this.isError\n ? colors.text.prompt.input.error(this.displayValue)\n : this.isSubmitted\n ? colors.text.prompt.input.submitted(this.maskCompleted(this.displayValue))\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.maskCompleted(this.displayValue))\n : colors.bold(colors.text.prompt.input.active(this.displayValue)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle changes in the prompt value\"\n name=\"onChange\"\n protected\n parameters={[\n {\n name: \"previousValue\",\n type: \"TValue\"\n }\n ]}>\n {code` // can be implemented by subclasses to handle value changes if needed, this method is called whenever the prompt value changes and receives the previous value as an argument for reference`}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (!action) {\n this.bell();\n } else if (typeof (this as any)[action] === \"function\") {\n (this as any)[action](key);\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to close the prompt and clean up resources, which also emits a submit or cancel event based on the prompt state. This method should be called when the prompt interaction is finished and the prompt needs to be closed.\"\n name=\"close\"\n async\n protected>\n {code`if (this.#isClosed) {\n return;\n }\n\n this.output.write(cursor.show);\n this.input.removeListener(\"keypress\", this.keypress);\n\n if (this.input.isTTY) {\n this.input.setRawMode(false);\n }\n\n this.#readline.close();\n this.emit(this.isSubmitted ? \"submit\" : \"cancel\", this.value);\n this.#isClosed = true; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to validate the prompt input using the provided validator function, which updates the error message and error state based on the validation result. This method is called whenever the prompt value changes and needs to be validated.\"\n name=\"checkValidations\"\n async\n protected\n parameters={[\n {\n name: \"value\",\n type: \"TValue\"\n }\n ]}>\n {code`let result = await this.validate(value);\n if (typeof result === \"string\") {\n this.errorMessage = result;\n } else if (typeof result === \"boolean\") {\n this.errorMessage = result ? null : this.defaultErrorMessage;\n } else {\n this.errorMessage = null;\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to route key press events to specific prompt actions based on the key pressed. This method maps various key combinations and keys to corresponding actions that can be handled by the prompt, such as submitting, cancelling, navigating, etc.\"\n name=\"getAction\"\n protected\n parameters={[{ name: \"key\", type: \"readline.Key\" }]}\n returnType=\"string | false\">\n {code`if (key.meta && key.name !== \"escape\") {\n return false;\n }\n\n let action: string | undefined;\n if (key.ctrl) {\n if (key.name === \"a\") action = \"first\";\n if (key.name === \"c\") action = \"cancel\";\n if (key.name === \"d\") action = \"cancel\";\n if (key.name === \"e\") action = \"last\";\n if (key.name === \"g\") action = \"reset\";\n }\n\n if (key.name === \"return\") action = \"submit\";\n if (key.name === \"enter\") action = \"submit\";\n if (key.name === \"backspace\") action = \"backspace\";\n if (key.name === \"delete\") action = \"delete\";\n if (key.name === \"cancel\") action = \"cancel\";\n if (key.name === \"escape\") action = \"cancel\";\n if (key.name === \"tab\") action = \"next\";\n if (key.name === \"pagedown\") action = \"nextPage\";\n if (key.name === \"pageup\") action = \"prevPage\";\n if (key.name === \"home\") action = \"home\";\n if (key.name === \"end\") action = \"end\";\n\n if (key.name === \"up\") action = \"up\";\n if (key.name === \"down\") action = \"down\";\n if (key.name === \"right\") action = \"right\";\n if (key.name === \"left\") action = \"left\";\n\n return action || false; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left or right by a \\`count\\` of positions\"\n name=\"moveCursor\"\n parameters={[\n {\n name: \"count\",\n type: \"number\"\n }\n ]}\n protected>\n {code`if (this.cursor + count < 0) {\n this.cursor = 0;\n } else if (this.cursor + count > this.displayValue.length) {\n this.cursor = this.displayValue.length;\n } else {\n this.cursor += count;\n }\n\n `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to remove the character backward of the cursor\"\n name=\"backspace\"\n protected>\n {code`if (this.isCursorAtStart) {\n return this.bell();\n }\n\n if (this.displayValue === \"\") {\n return this.bell();\n }\n\n const isCursorAtEnd = this.isCursorAtEnd && this.displayValue.length === this.cursor;\n\n this.changeValue(this.parse(\\`\\${\n this.displayValue.slice(0, this.cursor - 1)\n }\\${\n this.displayValue.slice(this.cursor)\n }\\`));\n\n this.moveCursor(isCursorAtEnd ? -1 : -2);\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to remove the character forward of the cursor\"\n name=\"delete\"\n protected>\n {code`if (this.isCursorAtEnd) {\n return this.bell();\n }\n\n this.changeValue(this.parse(\\`\\${\n this.displayValue.slice(0, this.cursor)\n }\\${\n this.displayValue.slice(this.cursor + 1)\n }\\`));\n\n if (!this.isCursorAtStart) {\n this.moveCursor(-1);\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to reset the prompt input\"\n name=\"reset\"\n protected>\n {code`this.changeValue(this.initialValue);\n this.cursor = 0;\n\n this.errorMessage = null;\n this.isCancelled = false;\n this.isSubmitted = false;\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to cancel the prompt input\"\n name=\"cancel\"\n protected>\n {code`this.errorMessage = null;\n this.isCancelled = true;\n this.isSubmitted = false;\n\n this.sync();\n this.output.write(\"\\\\n\");\n this.close(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to submit the prompt input\"\n name=\"submit\"\n async\n protected>\n {code`this.cursor = this.displayValue.length;\n\n await this.checkValidations(this.value);\n if (this.isError) {\n this.sync();\n this.bell();\n } else {\n this.isSubmitted = true;\n this.isCancelled = false;\n\n this.sync();\n this.output.write(\"\\\\n\");\n this.close();\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod doc=\"A method to render the prompt\" name=\"render\" private>\n {code`if (this.#isClosed) {\n return;\n }\n\n if (!this.isInitial) {\n if (this.consoleStatus) {\n this.output.write(cursor.down(stripAnsi(this.consoleStatus).split(/\\\\r?\\\\n/).map(line => Math.ceil(line.length / this.output.columns)).reduce((a, b) => a + b) - 1) + clear(this.consoleStatus, this.output.columns));\n }\n\n this.output.write(clear(this.consoleOutput, this.output.columns));\n } else if (this.cursorHidden) {\n this.output.write(cursor.hide);\n }\n\n this.consoleOutput = \\` \\${\n this.isSubmitted\n ? colors.text.prompt.icon.submitted(\"${\n theme.icons.prompt.submitted\n }\")\n : this.isCancelled\n ? colors.text.prompt.icon.cancelled(\"${\n theme.icons.prompt.cancelled\n }\")\n : this.isError\n ? colors.text.prompt.icon.error(\"${theme.icons.prompt.error}\")\n : colors.text.prompt.icon.active(\"${theme.icons.prompt.active}\")\n } \\${\n this.isCompleted\n ? colors.text.prompt.message.submitted(this.message)\n : colors.bold(colors.text.prompt.message.active(this.message))\n } \\${\n colors.border.app.divider.tertiary(\n this.isCompleted\n ? (process.platform === \"win32\" ? \"...\" : \"…\")\n : (process.platform === \"win32\" ? \"»\" : \"›\")\n )\n } \\`;\n this.consoleOutput += this.onRender();\n\n if (this.isInitial) {\n this.isInitial = false;\n }\n\n this.output.write(erase.line + cursor.to(0) + this.consoleOutput + (this.status ? cursor.save + this.status + cursor.restore + cursor.move(this.displayValue.length - (this.displayValue.length - this.cursor) - this.displayValue.length, 0) : cursor.save));\n this.consoleStatus = this.status; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"keypress\"\n private\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`if (this.#isClosed) {\n return;\n }\n\n if (!this.#isKeyPressed) {\n this.#isKeyPressed = true;\n }\n\n return this.onKeyPress(char, key); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"PromptFactoryConfig\"\n extends=\"PromptConfig<TValue>\"\n doc=\"Configuration options for creating a prompt with a prompt factory function\"\n typeParameters={[{ name: \"TValue\", default: \"string\" }]}>\n <InterfaceMember\n name=\"onState\"\n optional\n type=\"(state: PromptState<TValue>) => any\"\n doc=\"A function that is called when the prompt state changes, useful for updating the prompt message or other properties dynamically\"\n />\n <Spacing />\n <InterfaceMember\n name=\"onSubmit\"\n optional\n type=\"(value: TValue) => any\"\n doc=\"A function that is called when the prompt is submitted, useful for handling the submitted value or performing actions based on the prompt state\"\n />\n <Spacing />\n <InterfaceMember\n name=\"onCancel\"\n optional\n type=\"(event: any) => any\"\n doc=\"A function that is called when the prompt is canceled, useful for handling the canceled value or performing actions based on the prompt state\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"A unique symbol used to indicate that a prompt was cancelled, which can be returned from a prompt function to signal that the prompt interaction should be cancelled and any pending promises should be rejected with this symbol. This allows for a consistent way to handle prompt cancellations across different prompt types and interactions.\" />\n <VarDeclaration export name=\"CANCEL_SYMBOL\">\n {code`Symbol(\"shell-shock:prompts:cancel\"); `}\n </VarDeclaration>\n <Spacing />\n <TSDoc heading=\"A utility function to check if a given value is the {@link CANCEL_SYMBOL | cancel symbol}, which can be used to determine if a prompt interaction was cancelled based on the value returned from a prompt factory function. This function checks if the provided value is strictly equal to the {@link CANCEL_SYMBOL | CANCEL_SYMBOL}, allowing for a consistent way to handle prompt cancellations across different prompt types and interactions.\">\n <TSDocParam name=\"value\">{`The value to check.`}</TSDocParam>\n <TSDocReturns>\n {`A boolean indicating whether the provided value is the {@link CANCEL_SYMBOL | cancel symbol}, which can be used to determine if a prompt interaction was cancelled.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"isCancel\"\n export\n parameters={[\n {\n name: \"value\",\n type: \"any\"\n }\n ]}\n returnType=\"value is typeof CANCEL_SYMBOL\">\n {code`return value === CANCEL_SYMBOL; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * Declarations for a text-based prompt that allows users to input and edit text, with support for cursor movement, deletion, and custom masking. This prompt type can be used for various text input scenarios, such as entering a username, password, or any other string input. The TextPrompt class extends the base Prompt class and implements specific logic for handling text input and editing interactions.\n */\nexport function TextPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n name=\"StringPromptConfig\"\n extends=\"PromptConfig<string>\"\n doc=\"Configuration options for creating a text-based prompt\">\n <InterfaceMember\n name=\"initialValue\"\n optional\n type=\"string\"\n doc=\"The initial value of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"mask\"\n optional\n type=\"(input: string) => string\"\n doc=\"A function that masks the input value and returns the masked result\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n name=\"StringPrompt\"\n doc=\"A prompt for text input\"\n extends=\"Prompt<string>\">\n <ClassField name=\"isInvalid\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"initialValue\" protected override type=\"string\">\n {code`\"\"; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: StringPromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n if (this.initialValue) {\n this.changeValue(this.initialValue);\n }\n\n this.cursor = 0;\n this.sync();\n this.last();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"A method to handle onKeyPress events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if (!char || char.length === 0) {\n return this.bell();\n }\n\n this.changeValue(\\`\\${\n this.displayValue.slice(0, this.cursor)\n }\\${char}\\${\n this.displayValue.slice(this.cursor)\n }\\`);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle changes in the prompt value\"\n name=\"onChange\"\n override\n protected\n parameters={[\n {\n name: \"previousValue\",\n type: \"string\"\n }\n ]}>\n {code`this.#isInvalid = false;\n this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to reset the prompt input\"\n name=\"reset\"\n override\n protected>\n {code`this.cursor = Number(!!this.initialValue);\n super.reset(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to validate the prompt input\"\n name=\"checkValidations\"\n override\n async\n protected>\n {code`await super.checkValidations(this.value);\n this.#isInvalid = this.isError; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end of the input\"\n name=\"next\"\n protected>\n {code`this.changeValue(this.initialValue);\n this.cursor = this.displayValue.length;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the start\"\n name=\"first\"\n protected>\n {code`this.cursor = 0;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end\"\n name=\"last\"\n protected>\n {code`this.cursor = this.displayValue.length;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left\"\n name=\"left\"\n protected>\n {code`if (this.cursor <= 0) {\n return this.bell();\n }\n\n this.moveCursor(-1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the right\"\n name=\"right\"\n protected>\n {code`if (this.cursor >= this.displayValue.length) {\n return this.bell();\n }\n\n this.moveCursor(1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isPlaceholder\n ? colors.text.prompt.input.disabled(this.displayValue)\n : this.#isInvalid\n ? colors.text.prompt.input.error(this.displayValue)\n : this.isSubmitted\n ? colors.text.prompt.input.submitted(this.displayValue)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.displayValue)\n : colors.bold(colors.text.prompt.input.active(this.displayValue)); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"A type definition for the configuration options to pass to the text prompt, which extends the base PromptConfig with additional options specific to text prompts. This type can be used when creating a text prompt using the {@link text | text prompt factory function} or when manually creating an instance of the TextPrompt class. The TextConfig type includes all the properties of the base PromptConfig, such as message, description, initialValue, validate, parse, format, mask, etc., as well as any additional properties that are specific to text prompts.\" />\n <TypeDeclaration name=\"TextConfig\" export>\n {code`PromptFactoryConfig<string> & StringPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a text prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocRemarks>\n {code`This function can be used to easily create and run a text prompt without needing to manually create an instance of the TextPrompt class and handle its events. The function accepts a configuration object that extends the base PromptFactoryConfig with additional options specific to text prompts, such as the initial value and mask function. The returned promise allows for easy handling of the prompt result using async/await syntax or traditional promise chaining.`}\n </TSDocRemarks>\n <TSDocExample>\n {`import { text, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const name = await text({\n message: \"What is your name?\",\n description: \"Please enter your full name\",\n validate: value => value.trim().length > 0 || \"Name cannot be empty\"\n });\n if (isCancel(name)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"Hello, \" + name + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the text prompt, which extends the base PromptConfig with additional options specific to text prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"text\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"TextConfig\"\n }\n ]}\n returnType=\"Promise<string | symbol>\">\n {code`return new Promise<string | symbol>((response, reject) => {\n const prompt = new StringPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * Declarations for a select prompt that allows users to choose from a list of options, with support for pagination, option descriptions, and disabled options. This prompt type can be used for scenarios where the user needs to select one option from a predefined list, such as choosing a color, selecting a file, or picking an item from a menu. The SelectPrompt class extends the base Prompt class and implements specific logic for handling option selection and navigation interactions.\n */\nexport function SelectPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n name=\"PromptOptionConfig\"\n doc=\"Configuration for an option the user can select from the select prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"label\"\n optional\n type=\"string\"\n doc=\"The message label for the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"icon\"\n optional\n type=\"string\"\n doc=\"An icon for the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"value\"\n type=\"TValue\"\n doc=\"The value of the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"description\"\n optional\n type=\"string\"\n doc=\"The description of the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"selected\"\n optional\n type=\"boolean\"\n doc=\"Whether the option is selected\"\n />\n <Spacing />\n <InterfaceMember\n name=\"disabled\"\n optional\n type=\"boolean\"\n doc=\"Whether the option is disabled\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"PromptOption\"\n extends=\"PromptOptionConfig<TValue>\"\n doc=\"An option the user can select from the select prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"label\"\n type=\"string\"\n doc=\"The message label for the option\"\n />\n <InterfaceMember\n name=\"index\"\n type=\"number\"\n doc=\"The index of the option\"\n />\n <Spacing />\n <InterfaceMember\n name=\"selected\"\n type=\"boolean\"\n doc=\"Whether the option is selected\"\n />\n <Spacing />\n <InterfaceMember\n name=\"disabled\"\n type=\"boolean\"\n doc=\"Whether the option is disabled\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"SelectPromptConfig\"\n extends=\"PromptConfig<TValue>\"\n doc=\"An options object for configuring a select prompt\"\n typeParameters={[\n {\n name: \"TValue\",\n default: \"string\"\n }\n ]}>\n <InterfaceMember\n name=\"hint\"\n optional\n type=\"string\"\n doc=\"A hint to display to the user\"\n />\n <Spacing />\n <InterfaceMember\n name=\"options\"\n type=\"Array<string | PromptOptionConfig<TValue>>\"\n doc=\"The options available for the select prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"optionsPerPage\"\n optional\n type=\"number\"\n doc=\"The number of options to display per page, defaults to 8\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n name=\"SelectPrompt\"\n doc=\"A prompt for selecting an option from a list\"\n extends=\"Prompt<TValue>\"\n typeParameters={[{ name: \"TValue\", default: \"string\" }]}>\n <ClassField name=\"initialValue\" protected override type=\"TValue\" />\n <hbr />\n <ClassField name=\"optionsPerPage\" protected type=\"number\">\n {code`8; `}\n </ClassField>\n <hbr />\n <ClassField name=\"options\" protected type=\"PromptOption<TValue>[]\">\n {code`[]; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected override type=\"boolean\">\n {code`true; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: SelectPromptConfig<TValue>) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue as TValue;\n } else {\n this.initialValue = undefined as unknown as TValue;\n }\n\n this.options = config.options.map((opt, index) => {\n let option = {} as Partial<PromptOption<TValue>>;\n if (typeof opt === \"string\") {\n option = { label: opt, value: opt as TValue, selected: false, disabled: false };\n } else if (typeof opt === \"object\") {\n option = opt;\n } else {\n throw new Error(\\`Invalid option provided to SelectPrompt at index #\\${index}\\`);\n }\n\n return {\n label: String(option.value) || \"\",\n ...option,\n description: option.description,\n selected: !!option.selected || (this.initialValue !== undefined && option.value === this.initialValue),\n disabled: !!option.disabled\n } as PromptOption<TValue>;\n }).sort((a, b) => a.label.localeCompare(b.label)).map((option, index) => ({ ...option, index }));\n\n const selected = this.options.findIndex(option => option.selected);\n if (selected > -1) {\n this.cursor = selected;\n if (this.options[this.cursor]) {\n this.initialValue = this.options[this.cursor].value as TValue;\n }\n }\n\n if (this.initialValue === undefined && this.options.length > 0 && this.options[0]) {\n this.initialValue = this.options[0].value as TValue;\n }\n\n if (config.optionsPerPage) {\n this.optionsPerPage = config.optionsPerPage;\n }\n\n this.sync();\n } `}\n <Spacing />\n <ClassPropertyGet\n doc=\"Returns the currently selected option\"\n name=\"selectedOption\"\n type=\"PromptOption<TValue> | null\"\n protected>\n {code`return this.options.find(option => option.value === this.value) ?? null; `}\n </ClassPropertyGet>\n <Spacing />\n <ClassMethod\n doc=\"A method to route key press events to specific prompt actions based on the key pressed. This method maps various key combinations and keys to corresponding actions that can be handled by the prompt, such as submitting, cancelling, navigating, etc.\"\n name=\"getAction\"\n override\n protected\n parameters={[{ name: \"key\", type: \"readline.Key\" }]}\n returnType=\"string | false\">\n {code`let action = super.getAction(key);\n if (!action) {\n if (key.name === \"j\") action = \"down\";\n if (key.name === \"k\") action = \"up\";\n }\n\n return action || false; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to reset the prompt input\"\n name=\"reset\"\n override\n protected>\n {code`this.moveCursor(0);\n super.reset(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to submit the prompt input\"\n name=\"submit\"\n async\n override\n protected>\n {code`if (!this.selectedOption?.disabled) {\n await super.submit();\n } else {\n this.bell();\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end of the input\"\n name=\"next\"\n protected>\n {code`this.moveCursor((this.cursor + 1) % this.options.length);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left or right by a \\`count\\` of positions\"\n name=\"moveCursor\"\n parameters={[\n {\n name: \"count\",\n type: \"number\"\n }\n ]}\n override\n protected>\n {code`this.cursor = count;\n\n this.changeValue(this.options[count]!.value);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the first option\"\n name=\"first\"\n protected>\n {code`this.moveCursor(0);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the last option\"\n name=\"last\"\n protected>\n {code`this.moveCursor(this.options.length - 1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the start\"\n name=\"first\"\n protected>\n {code`this.cursor = 0;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the up\"\n name=\"up\"\n protected>\n {code`if (this.cursor === 0) {\n this.moveCursor(this.options.length - 1);\n } else {\n this.moveCursor(this.cursor - 1);\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the down\"\n name=\"down\"\n protected>\n {code`if (this.cursor === this.options.length - 1) {\n this.moveCursor(0);\n } else {\n this.moveCursor(this.cursor + 1);\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected>\n {code`const spacing = Math.max(...this.options.map(option => option.label?.length || 0)) + 2;\n\n const startIndex = Math.max(Math.min(this.options.length - this.optionsPerPage, this.cursor - Math.floor(this.optionsPerPage / 2)), 0);\n const endIndex = Math.min(startIndex + this.optionsPerPage, this.options.length);\n\n let output = \"\";\n if (!this.isCompleted) {\n output += \" \\\\n\";\n for (let index = startIndex; index < endIndex; index++) {\n output += \\`\\${\n this.options[index].disabled\n ? this.cursor === index\n ? colors.bold(colors.text.prompt.input.disabled(\">\"))\n : index === startIndex\n ? colors.border.app.divider.tertiary(\"↑\")\n : index === endIndex - 1\n ? colors.border.app.divider.tertiary(\"↓\")\n : \" \"\n : this.cursor === index\n ? colors.bold(colors.text.prompt.input.active(\">\"))\n : index === startIndex\n ? colors.border.app.divider.tertiary(\"↑\")\n : index === endIndex - 1\n ? colors.border.app.divider.tertiary(\"↓\")\n : \" \"\n } \\${\n this.options[index]!.disabled\n ? this.cursor === index\n ? colors.bold(colors.text.prompt.input.disabled(this.options[index]!.icon ? colors.underline(\\`\\${this.options[index]!.icon} \\`) : \"\"))\n : colors.strikethrough(colors.text.prompt.input.disabled(this.options[index]!.icon ? \\`\\${this.options[index].icon} \\` : \"\"))\n : this.cursor === index\n ? colors.bold(colors.text.prompt.input.active(this.options[index]!.icon ? colors.underline(\\`\\${this.options[index]!.icon} \\`) : \"\"))\n : colors.text.prompt.input.inactive(this.options[index]!.icon ? \\`\\${this.options[index].icon} \\` : \"\")\n }\\${\n this.options[index]!.disabled\n ? this.cursor === index\n ? colors.bold(colors.underline(colors.text.prompt.input.disabled(this.options[index].label)))\n : colors.strikethrough(colors.text.prompt.input.disabled(this.options[index]!.label))\n : this.cursor === index\n ? colors.bold(colors.underline(colors.text.prompt.input.active(this.options[index]!.label)))\n : colors.text.prompt.input.inactive(this.options[index]!.label)\n } \\${\" \".repeat(spacing - this.options[index]!.label.length - (this.options[index]!.icon ? this.options[index]!.icon!.length + 1 : 0))}\\${\n this.options[index]!.description && this.cursor === index\n ? colors.italic(colors.text.prompt.description.active(this.options[index]!.description))\n : \"\"\n } \\\\n\\`;\n }\n } else {\n this.displayValue = this.selectedOption?.label || String(this.value);\n output += super.onRender();\n }\n\n return output; `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"A type definition for the configuration options to pass to the select prompt, which extends the base PromptConfig with additional options specific to select prompts. This type can be used when creating a select prompt using the {@link select | select prompt factory function}.\">\n <TSDocRemarks>\n {`The Select Config type includes all the properties of the base PromptConfig, such as message, description, initialValue, validate, parse, format, etc., as well as any additional properties that are specific to select prompts, such as the list of options and pagination settings.`}\n </TSDocRemarks>\n </TSDoc>\n <TypeDeclaration export name=\"SelectConfig\">\n {code`PromptFactoryConfig<string> & SelectPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a select prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { select, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const color = await select({\n message: \"What is your favorite color?\",\n description: \"Please select your favorite color\",\n validate: value => value.trim().length > 0 || \"Color cannot be empty\",\n options: [\n { label: \"Red\", value: \"red\", description: \"The color of fire and blood\" },\n { label: \"Green\", value: \"green\", description: \"The color of nature and growth\" },\n { label: \"Blue\", value: \"blue\", description: \"The color of the sky and sea\" },\n { label: \"Yellow\", value: \"yellow\", description: \"The color of sunshine and happiness\" }\n ]\n });\n if (isCancel(color)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"Your favorite color is \" + color + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the select prompt, which extends the base PromptConfig with additional options specific to select prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"select\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"SelectConfig\"\n }\n ]}\n returnType=\"Promise<string | symbol>\">\n {code`return new Promise<string | symbol>((response, reject) => {\n const prompt = new SelectPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component that renders the declarations for the built-in numeric prompt, which allows users to input and select numeric values with various configuration options such as floating point support, precision, increment, and min/max values.\n */\nexport function NumericPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n name=\"NumberPromptConfig\"\n extends=\"PromptConfig<number>\"\n doc=\"Configuration options for creating a numeric prompt\">\n <InterfaceMember\n name=\"isFloat\"\n optional\n type=\"boolean\"\n doc=\"Whether the prompt should accept floating point numbers\"\n />\n <Spacing />\n <InterfaceMember\n name=\"precision\"\n optional\n type=\"number\"\n doc=\"The number of decimal places to round the input to, defaults to 2\"\n />\n <Spacing />\n <InterfaceMember\n name=\"increment\"\n optional\n type=\"number\"\n doc=\"The increment value for the number prompt, defaults to 1\"\n />\n <Spacing />\n <InterfaceMember\n name=\"min\"\n optional\n type=\"number\"\n doc=\"The minimum value for the number prompt, defaults to -Infinity\"\n />\n <Spacing />\n <InterfaceMember\n name=\"max\"\n optional\n type=\"number\"\n doc=\"The maximum value for the number prompt, defaults to Infinity\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n name=\"NumberPrompt\"\n doc=\"A prompt for selecting a number input\"\n extends=\"Prompt<number>\">\n <ClassField name=\"isInvalid\" isPrivateMember type=\"boolean\">\n {code`false; `}\n </ClassField>\n <Spacing />\n <ClassField name=\"initialValue\" protected override type=\"number\">\n {code`0; `}\n </ClassField>\n <hbr />\n <ClassField name=\"defaultErrorMessage\" protected override type=\"string\">\n {code`\"A valid numeric value must be provided\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"isFloat\" protected type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"precision\" protected type=\"number\">\n {code`2; `}\n </ClassField>\n <hbr />\n <ClassField name=\"increment\" protected type=\"number\">\n {code`1; `}\n </ClassField>\n <hbr />\n <ClassField name=\"min\" protected type=\"number\">\n {code`Number.NEGATIVE_INFINITY; `}\n </ClassField>\n <hbr />\n <ClassField name=\"max\" protected type=\"number\">\n {code`Number.POSITIVE_INFINITY; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: NumberPromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n this.isFloat = !!config.isFloat;\n if (config.precision !== undefined) {\n this.precision = config.precision;\n }\n if (config.increment !== undefined) {\n this.increment = config.increment;\n }\n if (config.min !== undefined) {\n this.min = config.min;\n }\n if (config.max !== undefined) {\n this.max = config.max;\n }\n\n if (config.parse) {\n this.parse = config.parse.bind(this);\n } else {\n const parse = (value: string) => this.isFloat ? Math.round(Math.pow(10, this.precision) * Number.parseFloat(value)) / Math.pow(10, this.precision) : Number.parseInt(value);\n this.parse = parse.bind(this);\n }\n\n if (config.validate) {\n this.validate = config.validate.bind(this);\n } else {\n const validate = (value: number) => !Number.isNaN(value) && value >= this.min && value <= this.max;\n this.validate = validate.bind(this);\n }\n\n this.changeValue(this.initialValue);\n\n this.cursor = 0;\n this.sync();\n this.last();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if ((char !== \"-\" || (char === \"-\" && this.cursor !== 0)) && !(char === \".\" && this.isFloat) && !/[0-9]/.test(char)) {\n return this.bell();\n }\n\n const displayValue = \\`\\${\n this.displayValue.slice(0, this.cursor)\n }\\${char}\\${\n this.displayValue.slice(this.cursor)\n }\\`;\n\n let value = this.parse(displayValue);\n if (!Number.isNaN(value)) {\n\n value = Math.min(value, this.max);\n if (value > this.max) {\n value = this.max;\n }\n if (value < this.min) {\n value = this.min;\n }\n }\n\n this.changeValue(value);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle changes in the prompt value\"\n name=\"onChange\"\n override\n protected\n parameters={[\n {\n name: \"previousValue\",\n type: \"number\"\n }\n ]}>\n {code`this.#isInvalid = false;\n this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to validate the prompt input\"\n name=\"checkValidations\"\n override\n async\n protected>\n {code`await super.checkValidations(this.value);\n this.#isInvalid = this.isError; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end of the input\"\n name=\"next\"\n protected>\n {code`this.changeValue(this.initialValue);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the up\"\n name=\"up\"\n protected>\n {code`let value = this.value;\n if (this.isPlaceholder) {\n value = this.min < 0 ? 0 : this.min;\n } else if (value >= this.max) {\n return this.bell();\n }\n\n this.changeValue(value + this.increment);\n\n this.sync();\n this.last(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the down\"\n name=\"down\"\n protected>\n {code`let value = this.value;\n if (this.isPlaceholder) {\n value = this.min < 0 ? 0 : this.min;\n } else if (value <= this.min) {\n return this.bell();\n }\n\n this.changeValue(value === this.min ? this.min : value - this.increment);\n this.sync();\n this.last(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left\"\n name=\"left\"\n protected>\n {code`if (this.cursor <= 0) {\n return this.bell();\n }\n\n this.moveCursor(-1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the right\"\n name=\"right\"\n protected>\n {code`if (this.cursor >= this.displayValue.length) {\n return this.bell();\n }\n\n this.moveCursor(1);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the start\"\n name=\"first\"\n protected>\n {code`this.cursor = 0;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the end\"\n name=\"last\"\n protected>\n {code`this.cursor = this.displayValue.length;\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isPlaceholder\n ? colors.text.prompt.input.disabled(this.displayValue)\n : this.#isInvalid\n ? colors.text.prompt.input.error(this.displayValue)\n : this.isSubmitted\n ? colors.text.prompt.input.submitted(this.displayValue)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.displayValue)\n : colors.bold(colors.text.prompt.input.active(this.displayValue)); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a numeric prompt.\" />\n <TypeDeclaration name=\"NumericConfig\" export>\n {code`PromptFactoryConfig<number> & NumberPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a numeric prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { numeric, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const age = await numeric({\n message: \"How old are you?\",\n description: \"Please enter your age in years\",\n validate: value => value < 21 ? \"You must be at least 21 years old\" : true,\n });\n if (isCancel(age)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"Your age is \" + age + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the numeric prompt, which extends the base PromptFactoryConfig with additional options specific to numeric prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"numeric\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"NumericConfig\"\n }\n ]}\n returnType=\"Promise<number | symbol>\">\n {code`return new Promise<number | symbol>((response, reject) => {\n const prompt = new NumberPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component that renders the declarations for the built-in toggle prompt, which allows users to select a boolean value (true/false) with support for custom messages for the true and false states. This prompt type can be used for scenarios where the user needs to toggle a setting on or off, such as enabling or disabling a feature. The TogglePrompt class extends the base Prompt class and implements specific logic for handling boolean input and rendering interactions.\n */\nexport function TogglePromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"TogglePromptConfig\"\n extends=\"PromptConfig<boolean>\"\n doc=\"Configuration options for creating a boolean toggle prompt\">\n <InterfaceMember\n name=\"trueMessage\"\n optional\n type=\"string\"\n doc=\"The message for the true state of the prompt\"\n />\n <Spacing />\n <InterfaceMember\n name=\"falseMessage\"\n optional\n type=\"string\"\n doc=\"The message for the false state of the prompt\"\n />\n <Spacing />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n export\n name=\"TogglePrompt\"\n doc=\"A prompt for toggling a boolean input\"\n extends=\"Prompt<boolean>\">\n <ClassField name=\"initialValue\" protected override type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"trueMessage\" protected type=\"string\">\n {code`\"Yes\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"falseMessage\" protected type=\"string\">\n {code`\"No\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected override type=\"boolean\">\n {code`true; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: TogglePromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n if (config.trueMessage) {\n this.trueMessage = config.trueMessage;\n }\n if (config.falseMessage) {\n this.falseMessage = config.falseMessage;\n }\n\n this.sync();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"Update the toggle value to a checked state based on user input\"\n name=\"check\"\n protected>\n {code`if (this.value === true) {\n return this.bell();\n }\n\n this.changeValue(true);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"Update the toggle value to an unchecked state based on user input\"\n name=\"uncheck\"\n protected>\n {code`if (this.value === false) {\n return this.bell();\n }\n\n this.changeValue(false);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if (char === \" \") {\n this.changeValue(!this.value);\n } else if (char === \"1\") {\n this.changeValue(true);\n } else if (char === \"0\") {\n this.changeValue(false);\n } else {\n return this.bell();\n }\n\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to remove the character backward of the cursor\"\n name=\"backspace\"\n protected>\n {code`this.uncheck(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the left\"\n name=\"left\"\n protected>\n {code`this.uncheck(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to the right\"\n name=\"right\"\n protected>\n {code`this.check(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to down\"\n name=\"down\"\n protected>\n {code`this.uncheck(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move the cursor to up\"\n name=\"up\"\n protected>\n {code`this.check(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to move to the next value\"\n name=\"next\"\n protected>\n {code`this.changeValue(!this.value);\n this.sync(); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isSubmitted\n ? colors.text.prompt.input.submitted(this.value ? this.trueMessage : this.falseMessage)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.value ? this.trueMessage : this.falseMessage)\n : \\`\\${\n this.value ? colors.text.prompt.input.inactive(this.falseMessage) : colors.underline(colors.bold(colors.text.prompt.input.active(this.falseMessage)))\n } \\${colors.border.app.divider.tertiary(\"/\")} \\${\n this.value ? colors.underline(colors.bold(colors.text.prompt.input.active(this.trueMessage))) : colors.text.prompt.input.inactive(this.trueMessage)\n }\\`; `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a toggle prompt, which extends the base PromptFactoryConfig with additional options specific to the toggle prompt.\" />\n <TypeDeclaration name=\"ToggleConfig\" export>\n {code`PromptFactoryConfig<boolean> & TogglePromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a toggle prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { toggle, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const likesIceCream = await toggle({\n message: \"Do you like ice cream?\"\n });\n if (isCancel(likesIceCream)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"You\" + (likesIceCream ? \" like ice cream\" : \" don't like ice cream\") + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the toggle prompt, which extends the base PromptFactoryConfig with additional options specific to the toggle prompt`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"toggle\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"ToggleConfig\"\n }\n ]}\n returnType=\"Promise<boolean | symbol>\">\n {code`return new Promise<boolean | symbol>((response, reject) => {\n const prompt = new TogglePrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component that renders the declarations for the built-in confirm prompt, which allows users to select a boolean value (true/false) with support for custom messages for the true and false states. This prompt type can be used for scenarios where the user needs to toggle a setting on or off, such as enabling or disabling a feature. The ConfirmPrompt class extends the base Prompt class and implements specific logic for handling boolean input and rendering interactions.\n */\nexport function ConfirmPromptDeclarations() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"ConfirmPromptConfig\"\n extends=\"PromptConfig<boolean>\"\n doc=\"Configuration options for creating a boolean confirm prompt\">\n <TSDoc heading=\"The message for the \\`Yes\\` state of the prompt\">\n <TSDocDefaultValue type={ReflectionKind.string} defaultValue=\"Yes\" />\n </TSDoc>\n <InterfaceMember name=\"yesMessage\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The \\`Yes\\` option when choosing between yes/no\">\n <TSDocDefaultValue type={ReflectionKind.string} defaultValue=\"1\" />\n </TSDoc>\n <InterfaceMember name=\"yesOption\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The message for the \\`No\\` state of the prompt\">\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"(Y/n)\"\n />\n </TSDoc>\n <InterfaceMember name=\"noMessage\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The \\`No\\` option when choosing between yes/no\">\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"(y/N)\"\n />\n </TSDoc>\n <InterfaceMember name=\"noOption\" optional type=\"string\" />\n </InterfaceDeclaration>\n <Spacing />\n <ClassDeclaration\n export\n name=\"ConfirmPrompt\"\n doc=\"A prompt for confirming a boolean input\"\n extends=\"Prompt<boolean>\">\n <ClassField name=\"initialValue\" protected override type=\"boolean\">\n {code`false; `}\n </ClassField>\n <hbr />\n <ClassField name=\"yesMessage\" protected type=\"string\">\n {code`\"Yes\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"yesOption\" protected type=\"string\">\n {code`\"(Y/n)\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"noMessage\" protected type=\"string\">\n {code`\"No\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"noOption\" protected type=\"string\">\n {code`\"(y/N)\"; `}\n </ClassField>\n <hbr />\n <ClassField name=\"cursorHidden\" protected override type=\"boolean\">\n {code`true; `}\n </ClassField>\n <Spacing />\n {code`constructor(config: ConfirmPromptConfig) {\n super(config);\n\n if (config.initialValue) {\n this.initialValue = config.initialValue;\n }\n\n if (config.yesMessage) {\n this.yesMessage = config.yesMessage;\n }\n if (config.yesOption) {\n this.yesOption = config.yesOption;\n }\n if (config.noMessage) {\n this.noMessage = config.noMessage;\n }\n if (config.noOption) {\n this.noOption = config.noOption;\n }\n\n this.sync();\n } `}\n <Spacing />\n <ClassMethod\n doc=\"A method to handle key press events and determine the corresponding action\"\n name=\"onKeyPress\"\n override\n protected\n parameters={[\n {\n name: \"char\",\n type: \"string\"\n },\n {\n name: \"key\",\n type: \"readline.Key\"\n }\n ]}>\n {code`const action = this.getAction(key);\n if (action && typeof (this as any)[action] === \"function\") {\n return (this as any)[action]();\n }\n\n if (char.toLowerCase() === \"y\" || char.toLowerCase() === \"t\" || char.toLowerCase() === \"0\") {\n this.changeValue(true);\n return this.submit();\n } else if (char.toLowerCase() === \"n\" || char.toLowerCase() === \"f\" || char.toLowerCase() === \"1\") {\n this.changeValue(false);\n return this.submit();\n } else {\n return this.bell();\n } `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n doc=\"A method to render the prompt\"\n name=\"onRender\"\n override\n protected\n returnType=\"string\">\n {code`return this.isSubmitted\n ? colors.text.prompt.input.submitted(this.value ? this.yesMessage : this.noMessage)\n : this.isCancelled\n ? colors.text.prompt.input.cancelled(this.value ? this.yesMessage : this.noMessage)\n : colors.text.prompt.input.inactive(this.initialValue ? this.yesOption : this.noOption); `}\n </ClassMethod>\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a confirm prompt, which extends the base PromptFactoryConfig with additional options specific to the confirm prompt.\" />\n <TypeDeclaration name=\"ConfirmConfig\" export>\n {code`PromptFactoryConfig<boolean> & ConfirmPromptConfig; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a confirm prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocExample>\n {`import { confirm, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const likesIceCream = await confirm({\n message: \"Do you like ice cream?\"\n });\n if (isCancel(likesIceCream)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"You\" + (likesIceCream ? \" like ice cream\" : \" don't like ice cream\") + \"!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the confirm prompt, which extends the base PromptFactoryConfig with additional options specific to the confirm prompt`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"confirm\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"ConfirmConfig\"\n }\n ]}\n returnType=\"Promise<boolean | symbol>\">\n {code`return new Promise<boolean | symbol>((response, reject) => {\n const prompt = new ConfirmPrompt(config);\n\n prompt.on(\"state\", state => config.onState?.(state));\n prompt.on(\"submit\", value => response(value));\n prompt.on(\"cancel\", event => response(CANCEL_SYMBOL));\n }); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * Declarations for a password prompt that allows users to input and edit text, with support for cursor movement, deletion, and custom masking. This prompt type can be used for various text input scenarios, such as entering a password or any other string input. The PasswordPrompt class extends the base Prompt class and implements specific logic for handling password input and editing interactions.\n */\nexport function PasswordPromptDeclaration() {\n return (\n <>\n <FunctionDeclaration\n export\n name=\"passwordMask\"\n doc=\"A built-in prompt mask function that masks input with asterisks\"\n parameters={[{ name: \"input\", type: \"string\" }]}\n returnType=\"string\">\n {code`return \"*\".repeat(input.length); `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"An object representing the configuration options for a password prompt, which extends the base PromptFactoryConfig with additional options specific to password prompts.\" />\n <TypeDeclaration name=\"PasswordConfig\" export>\n {code`Omit<TextConfig, \"mask\" | \"maskCompleted\">; `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"A function to create and run a password prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocRemarks>\n {code`This function creates an instance of the TextPrompt class with the provided configuration options and a custom mask function to handle password input. It sets up event listeners for state updates, submission, and cancellation to handle the prompt interactions and return the appropriate results. The password prompt allows users to input text that is masked for privacy, making it suitable for scenarios like entering passwords or sensitive information.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocExample>\n {`import { password, isCancel } from \"shell-shock:prompts\";\n\nasync function run() {\n const userPassword = await password({\n message: \"Enter your password\"\n });\n if (isCancel(userPassword)) {\n console.log(\"Prompt was cancelled\");\n return;\n }\n\n console.log(\"You entered a password!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"config\">\n {`The configuration options to pass to the password prompt, which extends the base PromptConfig with additional options specific to password prompts`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"password\"\n export\n parameters={[\n {\n name: \"config\",\n type: \"PasswordConfig\"\n }\n ]}\n returnType=\"Promise<string | symbol>\">\n {code`return text({\n ...config,\n mask: passwordMask,\n maskCompleted: () => \"*******\"\n });`}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport function WaitForKeyPressDeclaration() {\n return (\n <>\n <TSDoc heading=\"A function to create and run a wait-for-key-press prompt, which returns a promise that resolves when any key is pressed or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.\">\n <TSDocRemarks>\n {code`This function creates an instance of the Prompt class with a custom onKeyPress handler that resolves the promise when any key is pressed. It sets up event listeners for state updates and cancellation to handle the prompt interactions and return the appropriate results. The wait-for-key-press prompt is useful for scenarios where you want to pause execution until the user presses any key, such as waiting for user input before proceeding with a task.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocExample>\n {`import { waitForKeyPress } from \"shell-shock:prompts\";\n\nasync function run() {\n const result = await waitForKeyPress();\n console.log(\"A key was pressed!\");\n}\n\nrun(); `}\n </TSDocExample>\n <Spacing />\n <TSDocParam name=\"timeout\">\n {`The amount of time in milliseconds to wait before automatically resolving the prompt, defaults to 2 hours (7200000 ms)`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves when any key is pressed`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"waitForKeyPress\"\n export\n parameters={[\n {\n name: \"timeout\",\n default: \"7200000\"\n }\n ]}>\n {code`process.stdin.setRawMode(true);\n return new Promise(resolve => process.stdin.once(\"data\", () => {\n if (timeout >= 0) {\n setTimeout(() => {\n process.stdin.setRawMode(false);\n resolve(void 0);\n }, timeout);\n }\n\n process.stdin.setRawMode(false);\n resolve(void 0);\n })); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A built-in prompts module for Shell Shock.\n */\nexport function PromptsBuiltin(props: PromptsBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <BuiltinFile\n id=\"prompts\"\n description=\"A collection of prompts that allow for interactive input in command-line applications.\"\n {...rest}\n imports={defu(rest.imports ?? {}, {\n \"node:events\": \"EventEmitter\",\n \"node:readline\": \"readline\"\n })}\n builtinImports={defu(rest.builtinImports ?? {}, {\n console: [\n \"erase\",\n \"beep\",\n \"cursor\",\n \"colors\",\n \"clear\",\n \"stripAnsi\",\n \"splitText\"\n ],\n env: [\"env\", \"isCI\", \"isTest\", \"isWindows\", \"isDevelopment\", \"isDebug\"]\n })}>\n <Spacing />\n <BasePromptDeclarations />\n <Spacing />\n <TextPromptDeclarations />\n <Spacing />\n <SelectPromptDeclarations />\n <Spacing />\n <NumericPromptDeclarations />\n <Spacing />\n <TogglePromptDeclarations />\n <Spacing />\n <PasswordPromptDeclaration />\n <Spacing />\n <ConfirmPromptDeclarations />\n <Spacing />\n <WaitForKeyPressDeclaration />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,SAAE,yBAAiB;CACjB,MAAA,QAAY,UAAA;AACZ,QAAA;EAAA,gBAAU,iBAAA;GACV,UAAY;GACZ,MAAA;GACA,gBAAkB,CAAA;IACd,MAAG;IACH,SAAG;IACT,CAAM;;GAEN,UAAO,IAAU;GACf,CAAA;EAAA,gBAAgB,SAAA,EAAA,CAAA;EAAA,gBAAA,iBAAA;GACf,UAAO;GACP,MAAA;;IAED,MAAA;IACG,SAAU;IACb,CAAA;GACF,KAAO;GACL,UAAY,IAAE;;;;GAEd,UAAO;GACL,MAAC;GACD,KAAG;GACH,YAAI,CAAA;IACF,MAAM;IACN,MAAE;IACH,CAAC;GACF,YAAY;GACZ,UAAQ,IAAA;GACT,CAAC;EAAE,gBAAI,SAAA,EAAA,CAAA;EAAA,gBAAA,qBAAA;GACN,UAAK;GACL,MAAI;GACJ,KAAK;GACL,YAAI,CAAA;IACF,MAAC;IACD,MAAC;IACF,CAAC;GACF,YAAU;GACV,UAAI,IAAA;GACL,CAAC;EAAE,gBAAI,SAAA,EAAA,CAAA;EAAA,gBAAA,sBAAA;GACN,UAAQ;GACR,MAAM;GACN,KAAK;GACL,gBAAK,CAAA;IACH,MAAM;IACN,SAAS;IACV,CAAC;GACF,IAAG,WAAS;AACV,WAAC;KAAA,gBAAA,iBAAA;MACC,MAAA;MACA,MAAM;MACN,KAAK;MACN,CAAC;KAAA,gBAAoB,SAAS,EAAC,CAAA;KAAI,gBAAa,iBAAA;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AAA,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACb,IAAI,OAAO;;;KAGX;KACJ,CAAA;IAAA;;EAEF,CAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-prompts",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "type": "module",
5
5
  "description": "A package containing a Shell Shock plugin to generate the `prompts` built-in module.",
6
6
  "repository": {
@@ -126,16 +126,16 @@
126
126
  "dependencies": {
127
127
  "@alloy-js/core": "0.23.0-dev.8",
128
128
  "@alloy-js/typescript": "0.23.0-dev.4",
129
- "@powerlines/deepkit": "^0.6.134",
130
- "@powerlines/plugin-alloy": "^0.25.41",
131
- "@powerlines/plugin-plugin": "^0.12.306",
132
- "@shell-shock/core": "^0.13.1",
133
- "@shell-shock/plugin-theme": "^0.3.16",
129
+ "@powerlines/deepkit": "^0.6.147",
130
+ "@powerlines/plugin-alloy": "^0.25.54",
131
+ "@powerlines/plugin-plugin": "^0.12.319",
132
+ "@shell-shock/core": "^0.13.3",
133
+ "@shell-shock/plugin-theme": "^0.3.18",
134
134
  "defu": "^6.1.4",
135
- "powerlines": "^0.41.20"
135
+ "powerlines": "^0.42.9"
136
136
  },
137
137
  "devDependencies": {
138
- "@powerlines/plugin-deepkit": "^0.11.234",
138
+ "@powerlines/plugin-deepkit": "^0.11.247",
139
139
  "@types/node": "^25.5.0"
140
140
  },
141
141
  "publishConfig": {
@@ -153,5 +153,5 @@
153
153
  "./package.json": "./package.json"
154
154
  }
155
155
  },
156
- "gitHead": "86c55189ed02d126fb583cf6d2555266f00d0f3a"
156
+ "gitHead": "86ac1c51d3258bded9e493024e6631d241f62dd2"
157
157
  }