From a78ed230cdd65f906696480288b7350ffdb1332e Mon Sep 17 00:00:00 2001 From: patrick-mackay Date: Thu, 17 Dec 2015 20:04:14 -0300 Subject: [PATCH] New definition for ngWYSIWYG Interface definitions for an AngularJS wysiwyg component, developed by https://github.com/psergus. I'm not sure what kind of tests can be created for interface definitions. Let me know if more is needed. --- ngwysiwyg/ngwysiwyg-tests.ts | 16 ++++++++++++++++ ngwysiwyg/ngwysiwyg.d.ts | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ngwysiwyg/ngwysiwyg-tests.ts create mode 100644 ngwysiwyg/ngwysiwyg.d.ts diff --git a/ngwysiwyg/ngwysiwyg-tests.ts b/ngwysiwyg/ngwysiwyg-tests.ts new file mode 100644 index 000000000..92f33c87f --- /dev/null +++ b/ngwysiwyg/ngwysiwyg-tests.ts @@ -0,0 +1,16 @@ +/// + +//import ngWYSIWYG = require("ngWYSIWYG"); + +var options: ngWYSIWYGConfig = { + sanitize: false, + toolbar: [ + { name: "basicStyling", items: ["bold", "italic", "underline", "strikethrough", "subscript", "superscript", "-", "leftAlign", "centerAlign", "rightAlign", "blockJustify", "-"] }, + { name: "paragraph", items: ["orderedList", "unorderedList", "outdent", "indent", "-"] }, + { name: "doers", items: ["removeFormatting", "undo", "redo", "-"] }, + { name: "colors", items: ["fontColor", "backgroundColor", "-"] }, + { name: "links", items: ["image", "hr", "symbols", "link", "unlink", "-"] }, + { name: "tools", items: ["print", "-"] }, + { name: "styling", items: ["font", "size", "format"] }, + ] +}; diff --git a/ngwysiwyg/ngwysiwyg.d.ts b/ngwysiwyg/ngwysiwyg.d.ts new file mode 100644 index 000000000..0289df60e --- /dev/null +++ b/ngwysiwyg/ngwysiwyg.d.ts @@ -0,0 +1,14 @@ +// Type definitions for Marked +// Project: https://github.com/psergus/ngWYSIWYG +// Definitions by: Patrick Mac Kay +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface ngWYSIWYGToolbar { + name: string; + items: string[]; +} + +interface ngWYSIWYGConfig { + sanitize: boolean; + toolbar: ngWYSIWYGToolbar[] +}