@shell-shock/plugin-prompts 0.3.3 → 0.3.4

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.
@@ -410,13 +410,6 @@ function BasePromptDeclarations() {
410
410
  children: __alloy_js_core.code`0; `
411
411
  }),
412
412
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
413
- (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
414
- name: "cursorOffset",
415
- "protected": true,
416
- type: "number",
417
- children: __alloy_js_core.code`0; `
418
- }),
419
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
420
413
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
421
414
  name: "cursorHidden",
422
415
  "protected": true,
@@ -541,7 +534,7 @@ function BasePromptDeclarations() {
541
534
  name: "isCursorAtStart",
542
535
  "protected": true,
543
536
  type: "boolean",
544
- children: __alloy_js_core.code`return this.cursor === 0 || (this.isPlaceholder && this.cursor === 1); `
537
+ children: __alloy_js_core.code`return this.cursor <= 0 || (this.isPlaceholder && this.cursor <= 1); `
545
538
  }),
546
539
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
547
540
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassPropertyGet, {
@@ -549,7 +542,7 @@ function BasePromptDeclarations() {
549
542
  name: "isCursorAtEnd",
550
543
  "protected": true,
551
544
  type: "boolean",
552
- children: __alloy_js_core.code`return this.cursor === this.displayValue.length || (this.isPlaceholder && this.cursor === this.displayValue.length - 1); `
545
+ children: __alloy_js_core.code`return this.cursor >= this.displayValue.length || (this.isPlaceholder && this.cursor >= this.displayValue.length - 1); `
553
546
  }),
554
547
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
555
548
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassMethod, {
@@ -742,9 +735,15 @@ function BasePromptDeclarations() {
742
735
  type: "number"
743
736
  }],
744
737
  "protected": true,
745
- children: __alloy_js_core.code`
746
- this.cursor += count;
747
- this.cursorOffset += count; `
738
+ children: __alloy_js_core.code`if (this.cursor + count < 0) {
739
+ this.cursor = 0;
740
+ } else if (this.cursor + count > this.displayValue.length) {
741
+ this.cursor = this.displayValue.length;
742
+ } else {
743
+ this.cursor += count;
744
+ }
745
+
746
+ `
748
747
  }),
749
748
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
750
749
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassMethod, {
@@ -759,18 +758,15 @@ function BasePromptDeclarations() {
759
758
  return this.bell();
760
759
  }
761
760
 
761
+ const isCursorAtEnd = this.isCursorAtEnd && this.displayValue.length === this.cursor;
762
+
762
763
  this.changeValue(this.parse(\`\${
763
764
  this.displayValue.slice(0, this.cursor - 1)
764
765
  }\${
765
766
  this.displayValue.slice(this.cursor)
766
767
  }\`));
767
768
 
768
- if (this.isCursorAtStart) {
769
- this.cursorOffset = 0;
770
- } else {
771
- this.cursorOffset += 2;
772
- this.moveCursor(-1);
773
- }
769
+ this.moveCursor(isCursorAtEnd ? -1 : -2);
774
770
 
775
771
  this.sync(); `
776
772
  }),
@@ -779,7 +775,7 @@ function BasePromptDeclarations() {
779
775
  doc: "A method to remove the character forward of the cursor",
780
776
  name: "delete",
781
777
  "protected": true,
782
- children: __alloy_js_core.code`if (this.cursor >= this.displayValue.length) {
778
+ children: __alloy_js_core.code`if (this.isCursorAtEnd) {
783
779
  return this.bell();
784
780
  }
785
781
 
@@ -789,10 +785,8 @@ function BasePromptDeclarations() {
789
785
  this.displayValue.slice(this.cursor + 1)
790
786
  }\`));
791
787
 
792
- if (this.isCursorAtEnd) {
793
- this.cursorOffset = 0;
794
- } else {
795
- this.cursorOffset += 2;
788
+ if (!this.isCursorAtStart) {
789
+ this.moveCursor(-1);
796
790
  }
797
791
 
798
792
  this.sync(); `
@@ -803,7 +797,7 @@ function BasePromptDeclarations() {
803
797
  name: "reset",
804
798
  "protected": true,
805
799
  children: __alloy_js_core.code`this.changeValue(this.initialValue);
806
- this.cursorOffset = 0;
800
+ this.cursor = 0;
807
801
 
808
802
  this.errorMessage = null;
809
803
  this.isCancelled = false;
@@ -830,8 +824,7 @@ function BasePromptDeclarations() {
830
824
  name: "submit",
831
825
  async: true,
832
826
  "protected": true,
833
- children: __alloy_js_core.code`this.cursorOffset = 0;
834
- this.cursor = this.displayValue.length;
827
+ children: __alloy_js_core.code`this.cursor = this.displayValue.length;
835
828
 
836
829
  await this.checkValidations(this.value);
837
830
  if (this.isError) {
@@ -891,7 +884,7 @@ function BasePromptDeclarations() {
891
884
  this.isInitial = false;
892
885
  }
893
886
 
894
- this.output.write(erase.line + cursor.to(0) + this.consoleOutput + (this.status ? cursor.save + this.status + cursor.restore + cursor.move(this.cursorOffset, 0) : cursor.save));
887
+ 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));
895
888
  this.consoleStatus = this.status; `;
896
889
  }
897
890
  }),
@@ -1039,9 +1032,13 @@ function TextPromptDeclarations() {
1039
1032
  this.initialValue = config.initialValue;
1040
1033
  }
1041
1034
 
1035
+ if (this.initialValue) {
1036
+ this.changeValue(this.initialValue);
1037
+ }
1038
+
1042
1039
  this.cursor = 0;
1043
1040
  this.sync();
1044
- this.first();
1041
+ this.last();
1045
1042
  } `,
1046
1043
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1047
1044
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassMethod, {
@@ -1065,15 +1062,11 @@ function TextPromptDeclarations() {
1065
1062
  return this.bell();
1066
1063
  }
1067
1064
 
1068
- const value = \`\${
1069
- this.value.slice(0, this.cursor)
1070
- }\${
1071
- char
1072
- }\${
1073
- this.value.slice(this.cursor)
1074
- }\`;
1075
-
1076
- this.changeValue(value);
1065
+ this.changeValue(\`\${
1066
+ this.displayValue.slice(0, this.cursor)
1067
+ }\${char}\${
1068
+ this.displayValue.slice(this.cursor)
1069
+ }\`);
1077
1070
  this.sync(); `
1078
1071
  }),
1079
1072
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
@@ -1130,7 +1123,7 @@ function TextPromptDeclarations() {
1130
1123
  doc: "A method to move the cursor to the end",
1131
1124
  name: "last",
1132
1125
  "protected": true,
1133
- children: __alloy_js_core.code`this.cursor = this.value.length;
1126
+ children: __alloy_js_core.code`this.cursor = this.displayValue.length;
1134
1127
  this.sync(); `
1135
1128
  }),
1136
1129
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
@@ -1848,7 +1841,10 @@ function NumericPromptDeclarations() {
1848
1841
  }
1849
1842
 
1850
1843
  this.changeValue(this.initialValue);
1844
+
1845
+ this.cursor = 0;
1851
1846
  this.sync();
1847
+ this.last();
1852
1848
  } `,
1853
1849
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1854
1850
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassMethod, {
@@ -1874,9 +1870,7 @@ function NumericPromptDeclarations() {
1874
1870
 
1875
1871
  const displayValue = \`\${
1876
1872
  this.displayValue.slice(0, this.cursor)
1877
- }\${
1878
- char
1879
- }\${
1873
+ }\${char}\${
1880
1874
  this.displayValue.slice(this.cursor)
1881
1875
  }\`;
1882
1876
 
@@ -1903,7 +1897,7 @@ function NumericPromptDeclarations() {
1903
1897
  "protected": true,
1904
1898
  parameters: [{
1905
1899
  name: "previousValue",
1906
- type: "number"
1900
+ type: "string"
1907
1901
  }],
1908
1902
  children: __alloy_js_core.code`this.#isInvalid = false;
1909
1903
  this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `
@@ -1932,14 +1926,16 @@ function NumericPromptDeclarations() {
1932
1926
  name: "up",
1933
1927
  "protected": true,
1934
1928
  children: __alloy_js_core.code`let value = this.value;
1935
- if (this.displayValue === "") {
1929
+ if (this.isPlaceholder) {
1936
1930
  value = this.min < 0 ? 0 : this.min;
1937
1931
  } else if (value >= this.max) {
1938
1932
  return this.bell();
1939
1933
  }
1940
1934
 
1941
1935
  this.changeValue(value + this.increment);
1942
- this.sync(); `
1936
+
1937
+ this.sync();
1938
+ this.last(); `
1943
1939
  }),
1944
1940
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1945
1941
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassMethod, {
@@ -1947,14 +1943,15 @@ function NumericPromptDeclarations() {
1947
1943
  name: "down",
1948
1944
  "protected": true,
1949
1945
  children: __alloy_js_core.code`let value = this.value;
1950
- if (this.displayValue === "") {
1946
+ if (this.isPlaceholder) {
1951
1947
  value = this.min < 0 ? 0 : this.min;
1952
1948
  } else if (value <= this.min) {
1953
1949
  return this.bell();
1954
1950
  }
1955
1951
 
1956
1952
  this.changeValue(value === this.min ? this.min : value - this.increment);
1957
- this.sync(); `
1953
+ this.sync();
1954
+ this.last(); `
1958
1955
  }),
1959
1956
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1960
1957
  (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_class_declaration.ClassMethod, {
@@ -1 +1 @@
1
- {"version":3,"file":"prompts-builtin.d.cts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"sourcesContent":[],"mappings":";;;;UA8CiB,mBAAA,SAA4B,KAC3C;;AADF;AAQA;AA21BgB,iBA31BA,sBAAA,CAAA,CA21BsB,EA31BA,eAAA,CAAA,QA21BA;AAoPtC;AAobA;AAyVA;AA4OgB,iBA7uCA,sBAAA,CAAA,CA6uCyB,EA7uCH,eAAA,CAAA,QA6uCG;AA4LzC;AAmEA;AAuDA;iBA/yCgB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBAyVzB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBA4OxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBA4LzB,yBAAA,CAAA,GAAyB,eAAA,CAAA;iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA;;;;iBAuD1B,cAAA,QAAsB,sBAAmB,eAAA,CAAA"}
1
+ {"version":3,"file":"prompts-builtin.d.cts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"sourcesContent":[],"mappings":";;;;UA8CiB,mBAAA,SAA4B,KAC3C;;AADF;AAQA;AAu1BgB,iBAv1BA,sBAAA,CAAA,CAu1BsB,EAv1BA,eAAA,CAAA,QAu1BA;AAoPtC;AAobA;AA6VA;AA4OgB,iBAjvCA,sBAAA,CAAA,CAivCyB,EAjvCH,eAAA,CAAA,QAivCG;AA4LzC;AAmEA;AAuDA;iBAnzCgB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBA6VzB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBA4OxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBA4LzB,yBAAA,CAAA,GAAyB,eAAA,CAAA;iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA;;;;iBAuD1B,cAAA,QAAsB,sBAAmB,eAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompts-builtin.d.mts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"sourcesContent":[],"mappings":";;;;UA8CiB,mBAAA,SAA4B,KAC3C;;AADF;AAQA;AA21BgB,iBA31BA,sBAAA,CAAA,CA21BsB,EA31BA,eAAA,CAAA,QA21BA;AAoPtC;AAobA;AAyVA;AA4OgB,iBA7uCA,sBAAA,CAAA,CA6uCyB,EA7uCH,eAAA,CAAA,QA6uCG;AA4LzC;AAmEA;AAuDA;iBA/yCgB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBAyVzB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBA4OxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBA4LzB,yBAAA,CAAA,GAAyB,eAAA,CAAA;iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA;;;;iBAuD1B,cAAA,QAAsB,sBAAmB,eAAA,CAAA"}
1
+ {"version":3,"file":"prompts-builtin.d.mts","names":[],"sources":["../../src/components/prompts-builtin.tsx"],"sourcesContent":[],"mappings":";;;;UA8CiB,mBAAA,SAA4B,KAC3C;;AADF;AAQA;AAu1BgB,iBAv1BA,sBAAA,CAAA,CAu1BsB,EAv1BA,eAAA,CAAA,QAu1BA;AAoPtC;AAobA;AA6VA;AA4OgB,iBAjvCA,sBAAA,CAAA,CAivCyB,EAjvCH,eAAA,CAAA,QAivCG;AA4LzC;AAmEA;AAuDA;iBAnzCgB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBAobxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBA6VzB,wBAAA,CAAA,GAAwB,eAAA,CAAA;;;;iBA4OxB,yBAAA,CAAA,GAAyB,eAAA,CAAA;;;;iBA4LzB,yBAAA,CAAA,GAAyB,eAAA,CAAA;iBAmEzB,0BAAA,CAAA,GAA0B,eAAA,CAAA;;;;iBAuD1B,cAAA,QAAsB,sBAAmB,eAAA,CAAA"}
@@ -408,13 +408,6 @@ function BasePromptDeclarations() {
408
408
  children: code`0; `
409
409
  }),
410
410
  createIntrinsic("hbr", {}),
411
- createComponent(ClassField, {
412
- name: "cursorOffset",
413
- "protected": true,
414
- type: "number",
415
- children: code`0; `
416
- }),
417
- createIntrinsic("hbr", {}),
418
411
  createComponent(ClassField, {
419
412
  name: "cursorHidden",
420
413
  "protected": true,
@@ -539,7 +532,7 @@ function BasePromptDeclarations() {
539
532
  name: "isCursorAtStart",
540
533
  "protected": true,
541
534
  type: "boolean",
542
- children: code`return this.cursor === 0 || (this.isPlaceholder && this.cursor === 1); `
535
+ children: code`return this.cursor <= 0 || (this.isPlaceholder && this.cursor <= 1); `
543
536
  }),
544
537
  createComponent(Spacing, {}),
545
538
  createComponent(ClassPropertyGet, {
@@ -547,7 +540,7 @@ function BasePromptDeclarations() {
547
540
  name: "isCursorAtEnd",
548
541
  "protected": true,
549
542
  type: "boolean",
550
- children: code`return this.cursor === this.displayValue.length || (this.isPlaceholder && this.cursor === this.displayValue.length - 1); `
543
+ children: code`return this.cursor >= this.displayValue.length || (this.isPlaceholder && this.cursor >= this.displayValue.length - 1); `
551
544
  }),
552
545
  createComponent(Spacing, {}),
553
546
  createComponent(ClassMethod, {
@@ -740,9 +733,15 @@ function BasePromptDeclarations() {
740
733
  type: "number"
741
734
  }],
742
735
  "protected": true,
743
- children: code`
744
- this.cursor += count;
745
- this.cursorOffset += count; `
736
+ children: code`if (this.cursor + count < 0) {
737
+ this.cursor = 0;
738
+ } else if (this.cursor + count > this.displayValue.length) {
739
+ this.cursor = this.displayValue.length;
740
+ } else {
741
+ this.cursor += count;
742
+ }
743
+
744
+ `
746
745
  }),
747
746
  createComponent(Spacing, {}),
748
747
  createComponent(ClassMethod, {
@@ -757,18 +756,15 @@ function BasePromptDeclarations() {
757
756
  return this.bell();
758
757
  }
759
758
 
759
+ const isCursorAtEnd = this.isCursorAtEnd && this.displayValue.length === this.cursor;
760
+
760
761
  this.changeValue(this.parse(\`\${
761
762
  this.displayValue.slice(0, this.cursor - 1)
762
763
  }\${
763
764
  this.displayValue.slice(this.cursor)
764
765
  }\`));
765
766
 
766
- if (this.isCursorAtStart) {
767
- this.cursorOffset = 0;
768
- } else {
769
- this.cursorOffset += 2;
770
- this.moveCursor(-1);
771
- }
767
+ this.moveCursor(isCursorAtEnd ? -1 : -2);
772
768
 
773
769
  this.sync(); `
774
770
  }),
@@ -777,7 +773,7 @@ function BasePromptDeclarations() {
777
773
  doc: "A method to remove the character forward of the cursor",
778
774
  name: "delete",
779
775
  "protected": true,
780
- children: code`if (this.cursor >= this.displayValue.length) {
776
+ children: code`if (this.isCursorAtEnd) {
781
777
  return this.bell();
782
778
  }
783
779
 
@@ -787,10 +783,8 @@ function BasePromptDeclarations() {
787
783
  this.displayValue.slice(this.cursor + 1)
788
784
  }\`));
789
785
 
790
- if (this.isCursorAtEnd) {
791
- this.cursorOffset = 0;
792
- } else {
793
- this.cursorOffset += 2;
786
+ if (!this.isCursorAtStart) {
787
+ this.moveCursor(-1);
794
788
  }
795
789
 
796
790
  this.sync(); `
@@ -801,7 +795,7 @@ function BasePromptDeclarations() {
801
795
  name: "reset",
802
796
  "protected": true,
803
797
  children: code`this.changeValue(this.initialValue);
804
- this.cursorOffset = 0;
798
+ this.cursor = 0;
805
799
 
806
800
  this.errorMessage = null;
807
801
  this.isCancelled = false;
@@ -828,8 +822,7 @@ function BasePromptDeclarations() {
828
822
  name: "submit",
829
823
  async: true,
830
824
  "protected": true,
831
- children: code`this.cursorOffset = 0;
832
- this.cursor = this.displayValue.length;
825
+ children: code`this.cursor = this.displayValue.length;
833
826
 
834
827
  await this.checkValidations(this.value);
835
828
  if (this.isError) {
@@ -889,7 +882,7 @@ function BasePromptDeclarations() {
889
882
  this.isInitial = false;
890
883
  }
891
884
 
892
- this.output.write(erase.line + cursor.to(0) + this.consoleOutput + (this.status ? cursor.save + this.status + cursor.restore + cursor.move(this.cursorOffset, 0) : cursor.save));
885
+ 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));
893
886
  this.consoleStatus = this.status; `;
894
887
  }
895
888
  }),
@@ -1037,9 +1030,13 @@ function TextPromptDeclarations() {
1037
1030
  this.initialValue = config.initialValue;
1038
1031
  }
1039
1032
 
1033
+ if (this.initialValue) {
1034
+ this.changeValue(this.initialValue);
1035
+ }
1036
+
1040
1037
  this.cursor = 0;
1041
1038
  this.sync();
1042
- this.first();
1039
+ this.last();
1043
1040
  } `,
1044
1041
  createComponent(Spacing, {}),
1045
1042
  createComponent(ClassMethod, {
@@ -1063,15 +1060,11 @@ function TextPromptDeclarations() {
1063
1060
  return this.bell();
1064
1061
  }
1065
1062
 
1066
- const value = \`\${
1067
- this.value.slice(0, this.cursor)
1068
- }\${
1069
- char
1070
- }\${
1071
- this.value.slice(this.cursor)
1072
- }\`;
1073
-
1074
- this.changeValue(value);
1063
+ this.changeValue(\`\${
1064
+ this.displayValue.slice(0, this.cursor)
1065
+ }\${char}\${
1066
+ this.displayValue.slice(this.cursor)
1067
+ }\`);
1075
1068
  this.sync(); `
1076
1069
  }),
1077
1070
  createComponent(Spacing, {}),
@@ -1128,7 +1121,7 @@ function TextPromptDeclarations() {
1128
1121
  doc: "A method to move the cursor to the end",
1129
1122
  name: "last",
1130
1123
  "protected": true,
1131
- children: code`this.cursor = this.value.length;
1124
+ children: code`this.cursor = this.displayValue.length;
1132
1125
  this.sync(); `
1133
1126
  }),
1134
1127
  createComponent(Spacing, {}),
@@ -1846,7 +1839,10 @@ function NumericPromptDeclarations() {
1846
1839
  }
1847
1840
 
1848
1841
  this.changeValue(this.initialValue);
1842
+
1843
+ this.cursor = 0;
1849
1844
  this.sync();
1845
+ this.last();
1850
1846
  } `,
1851
1847
  createComponent(Spacing, {}),
1852
1848
  createComponent(ClassMethod, {
@@ -1872,9 +1868,7 @@ function NumericPromptDeclarations() {
1872
1868
 
1873
1869
  const displayValue = \`\${
1874
1870
  this.displayValue.slice(0, this.cursor)
1875
- }\${
1876
- char
1877
- }\${
1871
+ }\${char}\${
1878
1872
  this.displayValue.slice(this.cursor)
1879
1873
  }\`;
1880
1874
 
@@ -1901,7 +1895,7 @@ function NumericPromptDeclarations() {
1901
1895
  "protected": true,
1902
1896
  parameters: [{
1903
1897
  name: "previousValue",
1904
- type: "number"
1898
+ type: "string"
1905
1899
  }],
1906
1900
  children: code`this.#isInvalid = false;
1907
1901
  this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `
@@ -1930,14 +1924,16 @@ function NumericPromptDeclarations() {
1930
1924
  name: "up",
1931
1925
  "protected": true,
1932
1926
  children: code`let value = this.value;
1933
- if (this.displayValue === "") {
1927
+ if (this.isPlaceholder) {
1934
1928
  value = this.min < 0 ? 0 : this.min;
1935
1929
  } else if (value >= this.max) {
1936
1930
  return this.bell();
1937
1931
  }
1938
1932
 
1939
1933
  this.changeValue(value + this.increment);
1940
- this.sync(); `
1934
+
1935
+ this.sync();
1936
+ this.last(); `
1941
1937
  }),
1942
1938
  createComponent(Spacing, {}),
1943
1939
  createComponent(ClassMethod, {
@@ -1945,14 +1941,15 @@ function NumericPromptDeclarations() {
1945
1941
  name: "down",
1946
1942
  "protected": true,
1947
1943
  children: code`let value = this.value;
1948
- if (this.displayValue === "") {
1944
+ if (this.isPlaceholder) {
1949
1945
  value = this.min < 0 ? 0 : this.min;
1950
1946
  } else if (value <= this.min) {
1951
1947
  return this.bell();
1952
1948
  }
1953
1949
 
1954
1950
  this.changeValue(value === this.min ? this.min : value - this.increment);
1955
- this.sync(); `
1951
+ this.sync();
1952
+ this.last(); `
1956
1953
  }),
1957
1954
  createComponent(Spacing, {}),
1958
1955
  createComponent(ClassMethod, {
@@ -1 +1 @@
1
- {"version":3,"file":"prompts-builtin.mjs","names":["code","Show","splitProps","FunctionDeclaration","VarDeclaration","ReflectionKind","Spacing","BuiltinFile","ClassDeclaration","ClassField","ClassMethod","ClassPropertyGet","InterfaceDeclaration","InterfaceMember","TSDoc","TSDocDefaultValue","TSDocExample","TSDocParam","TSDocRemarks","TSDocReturns","TypeDeclaration","useTheme","defu","BasePromptDeclarations","theme","_$createComponent","heading","children","name","parameters","type","returnType","typeParameters","default","doc","optional","abstract","isPrivateMember","_$createIntrinsic","async","icons","prompt","submitted","cancelled","error","active","TextPromptDeclarations","override","SelectPromptDeclarations","NumericPromptDeclarations","TogglePromptDeclarations","ConfirmPromptDeclarations","string","defaultValue","PasswordPromptDeclaration","WaitForKeyPressDeclaration","PromptsBuiltin","props","rest","_$mergeProps","id","description","imports","builtinImports","console","env","when","Boolean"],"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=\"cursorOffset\" 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`\n this.cursor += count;\n this.cursorOffset += count; `}\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 this.changeValue(this.parse(\\`\\${\n this.displayValue.slice(0, this.cursor - 1)\n }\\${\n this.displayValue.slice(this.cursor)\n }\\`));\n\n if (this.isCursorAtStart) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset += 2;\n this.moveCursor(-1);\n }\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.cursor >= this.displayValue.length) {\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.isCursorAtEnd) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset += 2;\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.cursorOffset = 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.cursorOffset = 0;\n 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.cursorOffset, 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 this.cursor = 0;\n this.sync();\n this.first();\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 const value = \\`\\${\n this.value.slice(0, this.cursor)\n }\\${\n char\n }\\${\n this.value.slice(this.cursor)\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: \"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.value.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 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 !== \"-\" || (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 }\\${\n char\n }\\${\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.displayValue === \"\") {\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 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`let value = this.value;\n if (this.displayValue === \"\") {\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 </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":";;;;;;;;;;;;;;;;;AAsDA,SAAgBuB,yBAAyB;CACvC,MAAMC,QAAQH,UAAU;AAExB,QAAA;EAAAI,gBAEKX,OAAK;GAACY,SAAO;GAAA,IAAAC,WAAA;AAAA,WAAA,CAAAF,gBACXR,YAAU;KAACW,MAAI;KAAAD,UACb;KAAwC,CAAA,EAAAF,gBAE1CN,cAAY,EAAAQ,UACV,kHAAgH,CAAA,CAAA;;GAAA,CAAA;EAAAF,gBAGpHtB,qBAA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AAA;IAAA;;EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"prompts-builtin.mjs","names":["code","Show","splitProps","FunctionDeclaration","VarDeclaration","ReflectionKind","Spacing","BuiltinFile","ClassDeclaration","ClassField","ClassMethod","ClassPropertyGet","InterfaceDeclaration","InterfaceMember","TSDoc","TSDocDefaultValue","TSDocExample","TSDocParam","TSDocRemarks","TSDocReturns","TypeDeclaration","useTheme","defu","BasePromptDeclarations","theme","_$createComponent","heading","children","name","parameters","type","returnType","typeParameters","default","doc","optional","abstract","isPrivateMember","_$createIntrinsic","async","icons","prompt","submitted","cancelled","error","active","TextPromptDeclarations","override","SelectPromptDeclarations","NumericPromptDeclarations","TogglePromptDeclarations","ConfirmPromptDeclarations","string","defaultValue","PasswordPromptDeclaration","WaitForKeyPressDeclaration","PromptsBuiltin","props","rest","_$mergeProps","id","description","imports","builtinImports","console","env","when","Boolean"],"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: \"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 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":";;;;;;;;;;;;;;;;;AAsDA,SAAgBuB,yBAAyB;CACvC,MAAMC,QAAQH,UAAU;AAExB,QAAA;EAAAI,gBAEKX,OAAK;GAACY,SAAO;GAAA,I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AAA,aAAEC,QAAQxC,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-prompts",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "A package containing a Shell Shock plugin to generate the `prompts` built-in module.",
6
6
  "repository": {
@@ -129,14 +129,14 @@
129
129
  "@powerlines/deepkit": "^0.6.69",
130
130
  "@powerlines/plugin-alloy": "^0.23.19",
131
131
  "@powerlines/plugin-plugin": "^0.12.240",
132
- "@shell-shock/core": "^0.9.4",
133
- "@shell-shock/plugin-theme": "^0.3.6",
132
+ "@shell-shock/core": "^0.9.5",
133
+ "@shell-shock/plugin-theme": "^0.3.7",
134
134
  "defu": "6.1.4",
135
135
  "powerlines": "^0.38.56"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@powerlines/plugin-deepkit": "^0.11.168",
139
- "@types/node": "^25.3.0"
139
+ "@types/node": "^25.3.1"
140
140
  },
141
141
  "publishConfig": {
142
142
  "access": "public",
@@ -153,5 +153,5 @@
153
153
  "./package.json": "./package.json"
154
154
  }
155
155
  },
156
- "gitHead": "bd869b58fe1c78d739013c652b1ebebaa1360ac8"
156
+ "gitHead": "603cb61e0a2c4c8a1e86beb4b3d8dc2882ea207f"
157
157
  }