Skip to content

Commit

Permalink
Chore(docs): Order parameters in a consistent way
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Jun 30, 2024
1 parent 7c1480a commit 8478eb1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const answer = await checkbox({
| pageSize | `number` | no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |
| loop | `boolean` | no | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping. |
| required | `boolean` | no | When set to `true`, ensures at least one choice must be selected. |
| validate | `string\[\] => boolean \| string \| Promise<string \| boolean>` | no | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| validate | `string\[\] => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| theme | [See Theming](#Theming) | no | Customize look of the prompt. |

The `Separator` object can be used to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const answer = await editor({
| --------------- | ----------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| message | `string` | yes | The question to ask |
| default | `string` | no | Default value which will automatically be present in the editor |
| validate | `string => boolean \| string \| Promise<string \| boolean>` | no | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| validate | `string => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| postfix | `string` | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors. |
| waitForUseInput | `boolean` | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |
| theme | [See Theming](#Theming) | no | Customize look of the prompt. |
Expand Down
2 changes: 1 addition & 1 deletion packages/input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const answer = await input({ message: 'Enter your name' });
| message | `string` | yes | The question to ask |
| default | `string` | no | Default value if no answer is provided (clear it by pressing backspace) |
| transformer | `(string, { isFinal: boolean }) => string` | no | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed. |
| validate | `string => boolean \| string \| Promise<string \| boolean>` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| validate | `string => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| theme | [See Theming](#Theming) | no | Customize look of the prompt. |

## Theming
Expand Down
2 changes: 1 addition & 1 deletion packages/password/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const answer = await password({ message: 'Enter your name' });
| -------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| message | `string` | yes | The question to ask |
| mask | `boolean` | no | Show a `*` mask over the input or keep it transparent |
| validate | `string => boolean \| string \| Promise<string \| boolean>` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| validate | `string => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| theme | [See Theming](#Theming) | no | Customize look of the prompt. |

## Theming
Expand Down

0 comments on commit 8478eb1

Please sign in to comment.