Skip to content

Commit

Permalink
Use lambda style function type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
astralarya committed Aug 19, 2016
1 parent d2a3ec2 commit f395613
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ Properties you can pass to the console element

| Prop | Type | Description
| ---- | ---- | ----
| autofocus? | bool | Autofocus the console on component mount.
| cancel? | function(): any | Function that should stop execution of the current command and call `this.return()`.
| complete? | function(words: string[], cursor: number, prompt: string): string[] | Return a list of possible completions given a list of (`words`), index of the word containing the cursor (`cursor`) , and the full prompt text (`prompt`).
| continue? | function(prompt: string): bool | Return a boolean indicating whether to continue asking for user input on a newline given the current prompt text (`prompt`).
| handler | function(command: string): any | Handle a command (`command`), logging data with `this.log()` or `this.logX()`, and calling `this.return()` when finished.
| promptLabel? | string \| function(): string | String displayed to prompt user for input.
| welcomeMessage? | string | Initial message displayed after mount.
| autofocus? | bool | Autofocus the console on component mount.
| cancel? | ()=>any | Function that should stop execution of the current command and call `this.return()`.
| complete? | (words: string[], cursor: number, prompt: string)=>string[] | Return a list of possible completions given a list of (`words`), index of the word containing the cursor (`cursor`) , and the full prompt text (`prompt`).
| continue? | (prompt: string)=>bool | Return a boolean indicating whether to continue asking for user input on a newline given the current prompt text (`prompt`).
| handler | (command: string)=>any | Handle a command (`command`), logging data with `this.log()` or `this.logX()`, and calling `this.return()` when finished.
| promptLabel? | string \| ()=>string | String displayed to prompt user for input.
| welcomeMessage? | string | Initial message displayed after mount.


## Public members

| Member | Type | Description
| ---- | ---- | ----
| log | function(...messages: any): void | Log messages to the console. If string, print the value, otherwise, print the JSON value of the message.
| logX | function(type: string, ...messages: any): void | Log messages of a particular type to the console. The messages will be given the class `react-console-message-{type}`.
| return | function(): void | Signal the current command has finished and a new prompt should be displayed.
| log | (...messages: any)=>void | Log messages to the console. If string, print the value, otherwise, print the JSON value of the message.
| logX | (type: string, ...messages: any)=>void | Log messages of a particular type to the console. The messages will be given the class `react-console-message-{type}`.
| return | ()=>void | Signal the current command has finished and a new prompt should be displayed.


## Awknoledgements
Expand Down

0 comments on commit f395613

Please sign in to comment.