Skip to content

Commit 7ca98f4

Browse files
Organization and minor fix
Added a module to organize the interfaces. Fix a problem with an optional parameter. Previously was marked as required.
1 parent a78ed23 commit 7ca98f4

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

ngwysiwyg/ngwysiwyg-tests.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//import ngWYSIWYG = require("ngWYSIWYG");
44

5-
var options: ngWYSIWYGConfig = {
5+
var complete: ngWYSIWYG.Config = {
66
sanitize: false,
77
toolbar: [
88
{ name: "basicStyling", items: ["bold", "italic", "underline", "strikethrough", "subscript", "superscript", "-", "leftAlign", "centerAlign", "rightAlign", "blockJustify", "-"] },
@@ -14,3 +14,7 @@ var options: ngWYSIWYGConfig = {
1414
{ name: "styling", items: ["font", "size", "format"] },
1515
]
1616
};
17+
18+
var partial: ngWYSIWYG.Config = {
19+
sanitize: false
20+
};

ngwysiwyg/ngwysiwyg.d.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
// Definitions by: Patrick Mac Kay <https://github.com/patrick-mackay>
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
55

6-
interface ngWYSIWYGToolbar {
7-
name: string;
8-
items: string[];
9-
}
6+
declare module ngWYSIWYG {
7+
export interface Toolbar {
8+
name: string;
9+
items: string[];
10+
}
1011

11-
interface ngWYSIWYGConfig {
12-
sanitize: boolean;
13-
toolbar: ngWYSIWYGToolbar[]
14-
}
12+
export interface Config {
13+
sanitize: boolean;
14+
toolbar?: Toolbar[];
15+
}
16+
}

0 commit comments

Comments
 (0)