Skip to content

Commit d58ddc9

Browse files
committed
fix: types cleanup
1 parent c08b5f6 commit d58ddc9

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ https://webscopeio.github.io/react-console/
3434
| promptWrapperStyle | React.CSSProperties | styles for `promptWrapper` |
3535
| promptStyle | React.CSSProperties | styles for `prompt` |
3636
| lineStyle | React.CSSProperties | styles for `line` |
37-
| inputStyle | React.CSSProperties | styles for `input |
37+
| inputStyle | React.CSSProperties | styles for `input` |
3838
| wrapperClassName | string | className for `wrapper` |
3939
| promptWrapperClassName | string | className for `promptWrapper` |
4040
| promptClassName | string | className for `prompt` |

src/index.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,25 @@ type CommandsProp = {
1818
}
1919

2020
export type ReactConsoleProps = {
21-
prompt: string,
21+
// general props
2222
commands: CommandsProp,
23-
welcomeMessage?: string,
24-
autoFocus: boolean,
2523
noCommandFound: (...str: string[]) => Promise<string>,
24+
autoFocus: boolean,
25+
prompt: string,
26+
welcomeMessage?: string | undefined,
27+
// className props
2628
wrapperClassName?: string,
2729
promptWrapperClassName?: string,
2830
promptClassName?: string,
2931
lineClassName?: string,
3032
inputClassName?: string,
31-
wrapperStyle?: CSSProperties,
33+
// style props
34+
wrapperStyle: CSSProperties,
3235
promptWrapperStyle: CSSProperties,
33-
promptStyle?: CSSProperties,
36+
promptStyle: CSSProperties,
3437
lineStyle: CSSProperties,
35-
inputStyle?: CSSProperties,
38+
inputStyle: CSSProperties,
39+
// history props
3640
history?: string[],
3741
onAddHistoryItem?: (entry: string) => void,
3842
}
@@ -57,7 +61,9 @@ export default class ReactConsole extends React.Component<ReactConsoleProps, Rea
5761
autoFocus: false,
5862
noCommandFound: (cmd: string) => Promise.resolve(`Command ${cmd} does not exist`),
5963
wrapperStyle: {},
64+
promptWrapperStyle: {},
6065
promptStyle: {},
66+
lineStyle: {},
6167
inputStyle: {},
6268
};
6369

0 commit comments

Comments
 (0)