From f7ba60bb1434c6d538a03bb5338fafa9ef2646c9 Mon Sep 17 00:00:00 2001 From: WAEL BEN ZID Date: Fri, 11 Dec 2015 12:16:01 +0100 Subject: [PATCH 1/4] Update definition of ITemplateOptions --- angular-formly/angular-formly.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/angular-formly/angular-formly.d.ts b/angular-formly/angular-formly.d.ts index 2bf75af7d..d52df5e48 100644 --- a/angular-formly/angular-formly.d.ts +++ b/angular-formly/angular-formly.d.ts @@ -70,6 +70,11 @@ declare module AngularFormly { postWrapper?: ITemplateManipulator[]; } + interface ISelectOption { + name: string; + value: string; + group?: string; + } /** * see http://docs.angular-formly.com/docs/ngmodelattrstemplatemanipulator @@ -104,6 +109,12 @@ declare module AngularFormly { description?: string; [key: string]: any; + // types for select/radio fields + options?: ISelectOption | any; + groupProp?: string; // default: group + valueProp?: string; // default: value + labelProp?: string; // default: name + } From 223687fd0d9f082e0be46589967acb09c327c4cf Mon Sep 17 00:00:00 2001 From: WAEL BEN ZID Date: Wed, 16 Dec 2015 22:55:03 +0100 Subject: [PATCH 2/4] BUGFIX in ITemplateOptions definition --- angular-formly/angular-formly.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-formly/angular-formly.d.ts b/angular-formly/angular-formly.d.ts index d52df5e48..fce793e7e 100644 --- a/angular-formly/angular-formly.d.ts +++ b/angular-formly/angular-formly.d.ts @@ -72,7 +72,7 @@ declare module AngularFormly { interface ISelectOption { name: string; - value: string; + value?: string; group?: string; } @@ -110,7 +110,7 @@ declare module AngularFormly { [key: string]: any; // types for select/radio fields - options?: ISelectOption | any; + options?: Array; groupProp?: string; // default: group valueProp?: string; // default: value labelProp?: string; // default: name From 3a25247cd52c5814253a24b620344e9ec33c6109 Mon Sep 17 00:00:00 2001 From: WAEL BEN ZID Date: Fri, 18 Dec 2015 15:44:58 +0100 Subject: [PATCH 3/4] Definition for prettyjson package added --- prettyjson/prettyjson-tests.ts | 18 +++++++++++ prettyjson/prettyjson.d.ts | 55 ++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 prettyjson/prettyjson-tests.ts create mode 100644 prettyjson/prettyjson.d.ts diff --git a/prettyjson/prettyjson-tests.ts b/prettyjson/prettyjson-tests.ts new file mode 100644 index 000000000..da82686e1 --- /dev/null +++ b/prettyjson/prettyjson-tests.ts @@ -0,0 +1,18 @@ +/// + +var options: prettyjson.IOptions, + input: string, + output: string; + + +input = 'This is a string'; +output = prettyjson.render(input); + +output = prettyjson.render(input, {}, 4); + +output = prettyjson.render(['first string', ['nested 1', 'nested 2'], 'second string']); + +output = prettyjson.render({param1: 'first string', param2: 'second string'}); + +output = prettyjson.render({first_param: {subparam: 'first string', subparam2: 'another string'}, second_param: 'second string'}); + diff --git a/prettyjson/prettyjson.d.ts b/prettyjson/prettyjson.d.ts new file mode 100644 index 000000000..43dbf133c --- /dev/null +++ b/prettyjson/prettyjson.d.ts @@ -0,0 +1,55 @@ +// Type definitions for prettyjson +// Project: https://github.com/rafeca/prettyjson +// Definitions by: Wael BEN ZID EL GUEBSI +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module "prettyjson" { + + /** + * Defines prettyjson version + */ + export var version: string; + + /** + * Render pretty json. + * + * @param data {Object} Data to prettify. + * @param options {IOptions} Hash with different options to configure the renderer. + * @param indentation {number} Indentation size. + * + * @return {string} pretty serialized json data ready to display. + */ + export function render(data: Object, options?: IOptions, indentation?: number): string; + + /** + * Render pretty json from a string. + * + * @param data {string} Serialized JSON data to prettify. + * @param options {IOptions} Hash with different options to configure the renderer. + * @param indentation {number} Indentation size. + * + * @return {string} pretty serialized json data ready to display. + */ + export function renderString(data: string, options?: IOptions, indentation?: number): string; + + export interface IOptions { + + /** + * Define behavior for Array objects + */ + emptyArrayMsg ?: string; // default: (empty) + inlineArrays ?: boolean; + + /** + * Color definition + */ + noColor ?: boolean; + keysColor ?: string; + dashColor ?: string; + numberColor ?: string; + stringColor ?: string; + + defaultIndentation ?: number; + } +} From 1a7703a16ced73453adf4b1e5f858af3a399d610 Mon Sep 17 00:00:00 2001 From: WAEL BEN ZID Date: Fri, 18 Dec 2015 15:50:24 +0100 Subject: [PATCH 4/4] Files published in the wrong branch removed --- prettyjson/prettyjson-tests.ts | 18 ----------- prettyjson/prettyjson.d.ts | 55 ---------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 prettyjson/prettyjson-tests.ts delete mode 100644 prettyjson/prettyjson.d.ts diff --git a/prettyjson/prettyjson-tests.ts b/prettyjson/prettyjson-tests.ts deleted file mode 100644 index da82686e1..000000000 --- a/prettyjson/prettyjson-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -var options: prettyjson.IOptions, - input: string, - output: string; - - -input = 'This is a string'; -output = prettyjson.render(input); - -output = prettyjson.render(input, {}, 4); - -output = prettyjson.render(['first string', ['nested 1', 'nested 2'], 'second string']); - -output = prettyjson.render({param1: 'first string', param2: 'second string'}); - -output = prettyjson.render({first_param: {subparam: 'first string', subparam2: 'another string'}, second_param: 'second string'}); - diff --git a/prettyjson/prettyjson.d.ts b/prettyjson/prettyjson.d.ts deleted file mode 100644 index 43dbf133c..000000000 --- a/prettyjson/prettyjson.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Type definitions for prettyjson -// Project: https://github.com/rafeca/prettyjson -// Definitions by: Wael BEN ZID EL GUEBSI -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare module "prettyjson" { - - /** - * Defines prettyjson version - */ - export var version: string; - - /** - * Render pretty json. - * - * @param data {Object} Data to prettify. - * @param options {IOptions} Hash with different options to configure the renderer. - * @param indentation {number} Indentation size. - * - * @return {string} pretty serialized json data ready to display. - */ - export function render(data: Object, options?: IOptions, indentation?: number): string; - - /** - * Render pretty json from a string. - * - * @param data {string} Serialized JSON data to prettify. - * @param options {IOptions} Hash with different options to configure the renderer. - * @param indentation {number} Indentation size. - * - * @return {string} pretty serialized json data ready to display. - */ - export function renderString(data: string, options?: IOptions, indentation?: number): string; - - export interface IOptions { - - /** - * Define behavior for Array objects - */ - emptyArrayMsg ?: string; // default: (empty) - inlineArrays ?: boolean; - - /** - * Color definition - */ - noColor ?: boolean; - keysColor ?: string; - dashColor ?: string; - numberColor ?: string; - stringColor ?: string; - - defaultIndentation ?: number; - } -}