Make Blockly options an interface (#3312)

* Make workspace options an interface so it can be extended in the d.ts.
This commit is contained in:
Sam El-Husseini
2019-10-22 14:20:26 -04:00
committed by GitHub
parent 36d7e4ff8c
commit 4f02ceeba0
7 changed files with 29 additions and 15 deletions

View File

@@ -178,7 +178,7 @@ Blockly.Toolbox.prototype.init = function() {
}
Blockly.Touch.clearTouchIdentifier(); // Don't block future drags.
}, /* opt_noCaptureIdentifier */ false, /* opt_noPreventDefault */ true);
var workspaceOptions = {
var workspaceOptions = /** @type {!Blockly.Options} */ ({
disabledPatternId: workspace.options.disabledPatternId,
parentWorkspace: workspace,
RTL: workspace.RTL,
@@ -186,7 +186,7 @@ Blockly.Toolbox.prototype.init = function() {
horizontalLayout: workspace.horizontalLayout,
toolboxPosition: workspace.options.toolboxPosition,
renderer: workspace.options.renderer
};
});
if (workspace.horizontalLayout) {
if (!Blockly.HorizontalFlyout) {
throw Error('Missing require for Blockly.HorizontalFlyout');