From 7ca98f443216e1de7fca8d49f2602e1b6b7affbb Mon Sep 17 00:00:00 2001 From: patrick-mackay Date: Thu, 17 Dec 2015 20:36:32 -0300 Subject: [PATCH] Organization and minor fix Added a module to organize the interfaces. Fix a problem with an optional parameter. Previously was marked as required. --- ngwysiwyg/ngwysiwyg-tests.ts | 6 +++++- ngwysiwyg/ngwysiwyg.d.ts | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ngwysiwyg/ngwysiwyg-tests.ts b/ngwysiwyg/ngwysiwyg-tests.ts index 92f33c87f7..c779e918ea 100644 --- a/ngwysiwyg/ngwysiwyg-tests.ts +++ b/ngwysiwyg/ngwysiwyg-tests.ts @@ -2,7 +2,7 @@ //import ngWYSIWYG = require("ngWYSIWYG"); -var options: ngWYSIWYGConfig = { +var complete: ngWYSIWYG.Config = { sanitize: false, toolbar: [ { name: "basicStyling", items: ["bold", "italic", "underline", "strikethrough", "subscript", "superscript", "-", "leftAlign", "centerAlign", "rightAlign", "blockJustify", "-"] }, @@ -14,3 +14,7 @@ var options: ngWYSIWYGConfig = { { name: "styling", items: ["font", "size", "format"] }, ] }; + +var partial: ngWYSIWYG.Config = { + sanitize: false +}; diff --git a/ngwysiwyg/ngwysiwyg.d.ts b/ngwysiwyg/ngwysiwyg.d.ts index 0289df60e2..9f5ba18ca8 100644 --- a/ngwysiwyg/ngwysiwyg.d.ts +++ b/ngwysiwyg/ngwysiwyg.d.ts @@ -3,12 +3,14 @@ // Definitions by: Patrick Mac Kay // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface ngWYSIWYGToolbar { - name: string; - items: string[]; -} +declare module ngWYSIWYG { + export interface Toolbar { + name: string; + items: string[]; + } -interface ngWYSIWYGConfig { - sanitize: boolean; - toolbar: ngWYSIWYGToolbar[] -} + export interface Config { + sanitize: boolean; + toolbar?: Toolbar[]; + } +} \ No newline at end of file