Skip to content

editorGlobalsModule

Class: Module

The Module class defines the interface for each module. After loading, this class is instantiated and the defined callbacks are called in order to load the module into the editor

Hierarchy

  • Module

LoadSaveModule

Index

Properties

Methods

Properties

Protected editor

editor: Editor | null = null

Defined in src/modules/kyub.core.templateModule/src/Module.ts:17

Methods

bindStates

bindStates(states: MenuGenerator["states"]): void

Defined in src/modules/kyub.core.templateModule/src/Module.ts:30

Subclasses may bind to menu states.

Parameters:

Name Type Description
states MenuGenerator["states"] an object containing states by name

Returns: void


getTools

getTools(): IToolsWithManifestations

Defined in src/modules/kyub.core.templateModule/src/Module.ts:39

Allows the module to specify tools which are then added to the toolLibrary. You can use the config/toolConfiguration.yml to specify additional manifestations of the tools returned here.

Returns: IToolsWithManifestations

an object containing an array of tools and optionally, array of tool manifestations


onFilesDropped

onFilesDropped(browserFileList: BrowserFileList, source: string, uploadHandlerScope?: any): Promise‹boolean› | boolean

Defined in src/modules/kyub.core.templateModule/src/Module.ts:94

Called when the user dropped multiple files at once in the editor.

Parameters:

Name Type Default Description
browserFileList BrowserFileList - a wrapper object containing all dropped files
source string "window" -
uploadHandlerScope? any - angular controller scope that handles e.g. UI updates (optional)

Returns: Promise‹boolean› | boolean

true if the dropped files were handled together, false if not (optionally in a promise)


onLoad

onLoad(): void

Defined in src/modules/kyub.core.templateModule/src/Module.ts:22

Called when the module is supposed to load. Overwrite this with your custom init code.

Returns: void


onMenuAction

onMenuAction(action: string, parameters: object, stateValue: object, menuItem: object): Promise‹boolean› | boolean

Defined in src/modules/kyub.core.templateModule/src/Module.ts:78

Called when a menu item was clicked and the action is delegated to this module.

Parameters:

Name Type Description
action string the action name
parameters object the parameters this action was invoked with
stateValue object the value of the state that is associated with the menu item
menuItem object the menu item that was clicked MenuItem

Returns: Promise‹boolean› | boolean

True if the action was handled, false if not. This may be wrapped in a promise that resolves to true or false.


setEditor

setEditor(editor: Editor): void

Defined in src/modules/kyub.core.templateModule/src/Module.ts:65

Allows the module to store a reference to an Editor

Parameters:

Name Type Description
editor Editor The editor

Returns: void


setPhysicsSimulationRunner

setPhysicsSimulationRunner(physicsSimulationRunner: any): void

Defined in src/modules/kyub.core.templateModule/src/Module.ts:57

Allows the module to store a reference to a PhysicsSimulationRunner in order to toggle simulation AddOns

Parameters:

Name Type Description
physicsSimulationRunner any object implementing PhysicalsSimulationRunnerInterface

Returns: void