Class: Options
Defined in: packages/blockly/core/options.ts:27
Parse the user-specified options, using reasonable defaults where behaviour is unspecified.
Properties index
| Property | Description |
|---|---|
| RTL | - |
| oneBasedIndex | - |
| collapse | - |
| comments | - |
| disable | - |
| readOnly | - |
| maxBlocks | - |
| maxInstances | - |
| modalInputs | - |
| pathToMedia | - |
| hasCategories | - |
| moveOptions | - |
| - | |
| hasTrashcan | - |
| maxTrashcanContents | - |
| hasSounds | - |
| hasCss | - |
| horizontalLayout | - |
| languageTree | - |
| gridOptions | - |
| zoomOptions | - |
| toolboxPosition | - |
| theme | - |
| renderer | - |
| rendererOverrides | - |
| gridPattern | The SVG element for the grid pattern. Created during injection. |
| parentWorkspace | - |
| plugins | - |
| setMetrics | If set, sets the translation of the workspace to match the scrollbars. A function that sets the translation of the workspace to match the scrollbars. The argument Contains an x and/or y property which is a float between 0 and 1 specifying the degree of scrolling. |
| getMetrics | A function that returns a metrics object that describes the current workspace. |
Constructors
Constructor
new Options(options): Options;
Defined in: packages/blockly/core/options.ts:83
Parameters
| Parameter | Type | Description |
|---|---|---|
options | BlocklyOptions | Dictionary of options. Specification: https://docs.blockly.com/guides/configure/configuration_struct/#the-options-dictionary |
Returns
Options
Properties
RTL
RTL: boolean;
Defined in: packages/blockly/core/options.ts:28
oneBasedIndex
oneBasedIndex: boolean;
Defined in: packages/blockly/core/options.ts:29
collapse
collapse: boolean;
Defined in: packages/blockly/core/options.ts:30
comments
comments: boolean;
Defined in: packages/blockly/core/options.ts:31
disable
disable: boolean;
Defined in: packages/blockly/core/options.ts:32
readOnly
readOnly: boolean;
Defined in: packages/blockly/core/options.ts:33
maxBlocks
maxBlocks: number;
Defined in: packages/blockly/core/options.ts:34
maxInstances
maxInstances:
| {
[key: string]: number;
}
| null;
Defined in: packages/blockly/core/options.ts:35
modalInputs
modalInputs: boolean;
Defined in: packages/blockly/core/options.ts:36
pathToMedia
pathToMedia: string;
Defined in: packages/blockly/core/options.ts:37
hasCategories
hasCategories: boolean;
Defined in: packages/blockly/core/options.ts:38
moveOptions
moveOptions: MoveOptions;
Defined in: packages/blockly/core/options.ts:39
hasScrollbars
hasScrollbars: boolean;
Defined in: packages/blockly/core/options.ts:41
Deprecated
January 2019
hasTrashcan
hasTrashcan: boolean;
Defined in: packages/blockly/core/options.ts:42
maxTrashcanContents
maxTrashcanContents: number;
Defined in: packages/blockly/core/options.ts:43
hasSounds
hasSounds: boolean;
Defined in: packages/blockly/core/options.ts:44
hasCss
hasCss: boolean;
Defined in: packages/blockly/core/options.ts:45
horizontalLayout
horizontalLayout: boolean;
Defined in: packages/blockly/core/options.ts:46
languageTree
languageTree:
| ToolboxInfo
| null;
Defined in: packages/blockly/core/options.ts:47
gridOptions
gridOptions: GridOptions;
Defined in: packages/blockly/core/options.ts:48
zoomOptions
zoomOptions: ZoomOptions;
Defined in: packages/blockly/core/options.ts:49
toolboxPosition
toolboxPosition: Position;
Defined in: packages/blockly/core/options.ts:50
theme
theme: Theme;
Defined in: packages/blockly/core/options.ts:51
renderer
renderer: string;
Defined in: packages/blockly/core/options.ts:52
rendererOverrides
rendererOverrides:
| {
[rendererConstant: string]: any;
}
| null;
Defined in: packages/blockly/core/options.ts:53
gridPattern
gridPattern: SVGElement | null = null;
Defined in: packages/blockly/core/options.ts:59
The SVG element for the grid pattern. Created during injection.
parentWorkspace
parentWorkspace: WorkspaceSvg | null;
Defined in: packages/blockly/core/options.ts:60
plugins
plugins: object;
Defined in: packages/blockly/core/options.ts:61
Index Signature
[key: string]: string | ((...p1) => any)
setMetrics?
optional setMetrics?: (p1) => void = undefined;
Defined in: packages/blockly/core/options.ts:70
If set, sets the translation of the workspace to match the scrollbars. A function that sets the translation of the workspace to match the scrollbars. The argument Contains an x and/or y property which is a float between 0 and 1 specifying the degree of scrolling.
Parameters
| Parameter | Type |
|---|---|
p1 | { x?: number; y?: number; } |
p1.x? | number |
p1.y? | number |
Returns
void
getMetrics?
optional getMetrics?: () => Metrics = undefined;
Defined in: packages/blockly/core/options.ts:76
A function that returns a metrics object that describes the current workspace.