[Convict] get autocomplete for format

This commit is contained in:
tassadarliu
2018-12-03 17:52:45 +08:00
parent f15a022416
commit 1184370cda
+15 -1
View File
@@ -37,6 +37,20 @@ declare namespace convict {
parse: (content: string) => any;
}
type PredefinedFormat =
| '*'
| 'int'
| 'port'
| 'windows_named_pipe'
| 'port_or_windows_named_pipe'
| 'url'
| 'email'
| 'ipaddress'
| 'duration'
| 'timestamp'
| 'nat'
| String;
interface SchemaObj<T = any> {
default: T;
doc?: string;
@@ -52,7 +66,7 @@ declare namespace convict {
* If omitted, format will be set to the value of Object.prototype.toString.call
* for the default value
*/
format?: string | any[] | ((val: any) => void);
format?: PredefinedFormat | any[] | ((val: any) => void);
env?: string;
arg?: string;
sensitive?: boolean;