fix(CKEditor): Fix config.toolbar type (#11567)

The type for toolbar is currently defined as  `string | (string[])[]`,
but it should be `string | (string | string[])[]`.

The `toolbar` property is either:
* a toolbar name (`string`)
* or an array of elements, that can be `string`s (for instance a newline
  marker `'/'`) or `string[]`s (for instance a list of buttons).

For example, this is a valid configuration:

```js
CKEDITOR.config.toolbar = [
    [ 'mode', 'document', 'doctools' ],
    [ 'clipboard', 'undo' ],
    '/',
    [ 'find', 'selection', 'spellchecker' ],
    [ 'basicstyles', 'cleanup' ],
    '/',
    [ 'list', 'indent', 'blocks', 'align', 'bidi' ],
];
```
This commit is contained in:
Adrien Vergé
2016-10-06 23:26:24 +09:00
committed by Masahiro Wakame
parent 6a70dd082e
commit 877a2af148
2 changed files with 18 additions and 1 deletions
+17
View File
@@ -37,6 +37,23 @@ function test_CKEDITOR() {
CKEDITOR.replaceAll((textarea, config) => false);
}
function test_config() {
var config1: CKEDITOR.config = {
toolbar: 'basic',
};
var config2: CKEDITOR.config = {
toolbar: [
[ 'mode', 'document', 'doctools' ],
[ 'clipboard', 'undo' ],
'/',
[ 'find', 'selection', 'spellchecker' ],
[ 'basicstyles', 'cleanup' ],
'/',
[ 'list', 'indent', 'blocks', 'align', 'bidi' ],
],
};
}
function test_dom_comment() {
var type = CKEDITOR.NODE_COMMENT;
var nativeNode = document.createComment('Example');
+1 -1
View File
@@ -807,7 +807,7 @@ declare namespace CKEDITOR {
templates_files?: Object;
templates_replaceContent?: boolean;
title?: string | boolean;
toolbar?: string | (string[])[];
toolbar?: string | (string | string[])[];
toolbarCanCollapse?: boolean;
toolbarGroupCycling?: boolean;
toolbarGroups?: toolbarGroups[];