From 87975d165a89bd1a0f7e6209994658310d5f7cdc Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 22 Jul 2022 21:20:11 +0000 Subject: [PATCH 1/3] fix: add type information to blockly options --- core/blockly_options.ts | 59 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/core/blockly_options.ts b/core/blockly_options.ts index 775669f9217..e504a1e606d 100644 --- a/core/blockly_options.ts +++ b/core/blockly_options.ts @@ -15,6 +15,9 @@ import * as goog from '../closure/goog/goog.js'; goog.declareModuleId('Blockly.BlocklyOptions'); +import {Theme} from './theme.js'; +import {Workspace} from './workspace.js'; + /** * Blockly options. @@ -22,4 +25,58 @@ goog.declareModuleId('Blockly.BlocklyOptions'); * `typings/parts/blockly-interfaces.d.ts`. * @alias Blockly.BlocklyOptions */ -export interface BlocklyOptions {} +export interface BlocklyOptions { + collapse?: boolean; + comments?: boolean; + cs?: boolean; + disable?: boolean; + grid?: GridOptions; + horizontalLayout?: boolean; + maxBlocks?: number; + maxInstances?: {[blockType: string]: number}; + media?: string; + move?: MoveOptions; + oneBasedIndex?: boolean; + readOnly?: boolean; + renderer?: string; + rendererOverrides?: {[rendererConstant: string]: any}; + rtl?: boolean; + scrollbars?: ScrollbarOptions | boolean; + sounds?: boolean; + theme?: Theme; + toolbox?: string | object | Element; + toolboxPosition?: string; + trashcan?: boolean; + maxTrashcanContents?: boolean; + plugins?: object; + zoom?: ZoomOptions; + parentWorkspace?: Workspace; +} + +export interface GridOptions { + colour?: string; + length?: number; + snap?: boolean; + spacing?: number; +} + +export interface MoveOptions { + drag?: boolean; + scrollbars?: boolean|ScrollbarOptions; + wheel?: boolean; +} + +export interface ScrollbarOptions { + horizontal?: boolean; + vertical?: boolean; +} + +export interface ZoomOptions { + controls?: boolean; + maxScale?: number; + minScale?: number; + pinch?: boolean; + scaleSpeed?: number; + startScale?: number; + wheel?: boolean; +} From 44a15fe4f9bbd14176049cf16e40c772233e52d3 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 22 Jul 2022 21:22:04 +0000 Subject: [PATCH 2/3] chore: format --- core/blockly_options.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/blockly_options.ts b/core/blockly_options.ts index e504a1e606d..97262721c6d 100644 --- a/core/blockly_options.ts +++ b/core/blockly_options.ts @@ -41,10 +41,10 @@ export interface BlocklyOptions { renderer?: string; rendererOverrides?: {[rendererConstant: string]: any}; rtl?: boolean; - scrollbars?: ScrollbarOptions | boolean; + scrollbars?: ScrollbarOptions|boolean; sounds?: boolean; theme?: Theme; - toolbox?: string | object | Element; + toolbox?: string|object|Element; toolboxPosition?: string; trashcan?: boolean; maxTrashcanContents?: boolean; From a9faf96b39ce41babe7b60d973d58ae60c41ecf6 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 26 Jul 2022 21:59:44 +0000 Subject: [PATCH 3/3] chore: remove erroneous comment --- core/blockly_options.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/blockly_options.ts b/core/blockly_options.ts index 97262721c6d..e7d718e7761 100644 --- a/core/blockly_options.ts +++ b/core/blockly_options.ts @@ -21,8 +21,6 @@ import {Workspace} from './workspace.js'; /** * Blockly options. - * This interface is further described in - * `typings/parts/blockly-interfaces.d.ts`. * @alias Blockly.BlocklyOptions */ export interface BlocklyOptions {