From a3b9360f8d47d1531e14f4f7013d21dbe225e830 Mon Sep 17 00:00:00 2001 From: k7sleeper Date: Wed, 15 Jun 2016 14:02:39 +0200 Subject: [PATCH 1/3] add 4 missing functions added functions registerFormat, unregisterFormat, getRegisteredFormats, getDefaultOptions --- z-schema/z-schema.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/z-schema/z-schema.d.ts b/z-schema/z-schema.d.ts index 750abd2870..317a92247c 100644 --- a/z-schema/z-schema.d.ts +++ b/z-schema/z-schema.d.ts @@ -37,6 +37,11 @@ declare namespace ZSchema { } export class Validator { + public static registerFormat(name: string, validator: (value: any) => boolean): void; + public static unregisterFormat(name: string): void; + public static getRegisteredFormats(): string[]; + public static getDefaultOptions(): Options; + constructor(options: Options); /** From 4ccbc961929b2951fca461509b30850b0ea8d3dc Mon Sep 17 00:00:00 2001 From: k7sleeper Date: Mon, 20 Jun 2016 14:11:15 +0200 Subject: [PATCH 2/3] Added JSDoc --- z-schema/z-schema.d.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/z-schema/z-schema.d.ts b/z-schema/z-schema.d.ts index 317a92247c..763d86a4db 100644 --- a/z-schema/z-schema.d.ts +++ b/z-schema/z-schema.d.ts @@ -37,9 +37,30 @@ declare namespace ZSchema { } export class Validator { - public static registerFormat(name: string, validator: (value: any) => boolean): void; + + /** + * Register a custom format. + * + * @param name - format name of the custom format + * @param validatorFunction - custom format validator function. + * Returns true if value matches the custom format. + */ + public static registerFormat(formatName: string, validatorFunction: (value: any) => boolean): void; + + /** + * Unregister a format. + * + * @param name - format name of the custom format + */ public static unregisterFormat(name: string): void; + + /** + * Get the list of all registered formats. + * + * @returns {string[]} the list of all registered format names. + */ public static getRegisteredFormats(): string[]; + public static getDefaultOptions(): Options; constructor(options: Options); From 9f19feb70d5f8e65689b7e630661302fe7f270aa Mon Sep 17 00:00:00 2001 From: k7sleeper Date: Wed, 22 Jun 2016 10:44:06 +0200 Subject: [PATCH 3/3] added JSDoc comment --- z-schema/z-schema.d.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/z-schema/z-schema.d.ts b/z-schema/z-schema.d.ts index e151a497b9..4f189f95b3 100644 --- a/z-schema/z-schema.d.ts +++ b/z-schema/z-schema.d.ts @@ -37,36 +37,33 @@ declare namespace ZSchema { } export class Validator { -<<<<<<< HEAD /** * Register a custom format. * - * @param name - format name of the custom format + * @param name - name of the custom format * @param validatorFunction - custom format validator function. - * Returns true if value matches the custom format. + * Returns `true` if `value` matches the custom format. */ public static registerFormat(formatName: string, validatorFunction: (value: any) => boolean): void; /** * Unregister a format. * - * @param name - format name of the custom format + * @param name - name of the custom format */ public static unregisterFormat(name: string): void; /** * Get the list of all registered formats. * + * Both the names of the burned-in formats and the custom format names are + * returned by this function. + * * @returns {string[]} the list of all registered format names. */ public static getRegisteredFormats(): string[]; -======= - public static registerFormat(name: string, validator: (value: any) => boolean): void; - public static unregisterFormat(name: string): void; - public static getRegisteredFormats(): string[]; ->>>>>>> e325b363f5ee9c72ebde49f1e783ae725f64b7e2 public static getDefaultOptions(): Options; constructor(options: Options);