From 1184370cda953a282150eea2c4e32e14d81279f3 Mon Sep 17 00:00:00 2001 From: tassadarliu Date: Mon, 3 Dec 2018 17:52:45 +0800 Subject: [PATCH] [Convict] get autocomplete for format --- types/convict/index.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index 2c3dbf0547..8be23f1547 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -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 { 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;