mirror of
https://github.com/google/blockly.git
synced 2026-02-01 13:10:22 +01:00
Update the options object to reflect its properties, update the public option interface to include keymap and other little things (#3826)
This commit is contained in:
@@ -106,31 +106,55 @@ Blockly.Options = function(options) {
|
||||
|
||||
var renderer = options['renderer'] || 'geras';
|
||||
|
||||
/** @type {boolean} */
|
||||
this.RTL = rtl;
|
||||
/** @type {boolean} */
|
||||
this.oneBasedIndex = oneBasedIndex;
|
||||
/** @type {boolean} */
|
||||
this.collapse = hasCollapse;
|
||||
/** @type {boolean} */
|
||||
this.comments = hasComments;
|
||||
/** @type {boolean} */
|
||||
this.disable = hasDisable;
|
||||
/** @type {boolean} */
|
||||
this.readOnly = readOnly;
|
||||
/** @type {number} */
|
||||
this.maxBlocks = options['maxBlocks'] || Infinity;
|
||||
/** @type {?Object.<string, number>} */
|
||||
this.maxInstances = options['maxInstances'];
|
||||
/** @type {string} */
|
||||
this.pathToMedia = pathToMedia;
|
||||
/** @type {boolean} */
|
||||
this.hasCategories = hasCategories;
|
||||
/** @type {!Object} */
|
||||
this.moveOptions = Blockly.Options.parseMoveOptions(options, hasCategories);
|
||||
/** @deprecated January 2019 */
|
||||
this.hasScrollbars = this.moveOptions.scrollbars;
|
||||
/** @type {boolean} */
|
||||
this.hasTrashcan = hasTrashcan;
|
||||
/** @type {number} */
|
||||
this.maxTrashcanContents = maxTrashcanContents;
|
||||
/** @type {boolean} */
|
||||
this.hasSounds = hasSounds;
|
||||
/** @type {boolean} */
|
||||
this.hasCss = hasCss;
|
||||
/** @type {boolean} */
|
||||
this.horizontalLayout = horizontalLayout;
|
||||
/** @type {Node} */
|
||||
this.languageTree = languageTree;
|
||||
/** @type {!Object} */
|
||||
this.gridOptions = Blockly.Options.parseGridOptions_(options);
|
||||
/** @type {!Object} */
|
||||
this.zoomOptions = Blockly.Options.parseZoomOptions_(options);
|
||||
/** @type {number} */
|
||||
this.toolboxPosition = toolboxPosition;
|
||||
/** @type {!Blockly.Theme} */
|
||||
this.theme = Blockly.Options.parseThemeOptions_(options);
|
||||
/** @type {!Object<string,Blockly.Action>} */
|
||||
this.keyMap = keyMap;
|
||||
/** @type {string} */
|
||||
this.renderer = renderer;
|
||||
/** @type {?Object} */
|
||||
this.rendererOverrides = options['rendererOverrides'];
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ declare module Blockly {
|
||||
toolbox?: HTMLElement | string;
|
||||
readOnly?: boolean;
|
||||
trashcan?: boolean;
|
||||
maxInstances?: {[type: string]: number;};
|
||||
maxTrashcanContents?: number;
|
||||
collapse?: boolean;
|
||||
comments?: boolean;
|
||||
@@ -35,14 +36,19 @@ declare module Blockly {
|
||||
maxScale?: number;
|
||||
minScale?: number;
|
||||
scaleSpeed?: number;
|
||||
pinch?: boolean;
|
||||
};
|
||||
renderer?: string;
|
||||
keyMap?: {[type: string]: Blockly.Action;};
|
||||
}
|
||||
|
||||
interface BlocklyThemeOptions {
|
||||
base?: string;
|
||||
blockStyles?: {[blocks: string]: Blockly.Theme.BlockStyle;};
|
||||
categoryStyles?: {[category: string]: Blockly.Theme.CategoryStyle;};
|
||||
componentStyles?: {[component: string]: any;};
|
||||
fontStyle?: Blockly.Theme.FontStyle;
|
||||
startHats?: boolean;
|
||||
}
|
||||
|
||||
interface Metrics {
|
||||
|
||||
Reference in New Issue
Block a user