Api

Top level api object from which all other api modules are available.

api.article

See: Article.html
Properties

Name Type
article object

api.document

See: Document.html
Properties

Name Type
document Document

api.newsItem

See: NewsItem.html
Properties

Name Type
newsItem NewsItem

api.events

See: Events.html
Properties

Name Type
events Events

api.router

See: Router.html
Properties

Name Type
router Router

api.browser

See: Browser.html
Properties

Name Type
browser Browser

api.ui

See: Ui.html
Properties

Name Type
api.ui Ui

api.upload

See: Upload.html
Properties

Name Type
api.upload Upload

api.concept

Deprecated

api.history

See: History.html
Properties

Name Type
api.history History

api.settings

See: Settings.html
Properties

Name Type
api.settings Settings

api.user

See: User.html
Properties

Name Type
api.user User

api.editorSession ⇒ Object

Property getter to retrieve reference to editorSession

Returns: Object - Substance editorSession

api.editorSession

Property setter to store reference to editorSession

Param Type Description
editorSession Object Substance editorSession

api.newsItemArticle ⇒ *

Actually newsItem

api.stateHandler ⇒ Object

Property getter to retrieve reference to the StateHandler

Returns: Object - StateHandler

api.stateHandler

Property setter to store reference to a StateHandler

Param Type
stateHandler Object

api.doc ⇒ Object

Property getter for the editorSession document

Returns: Object - Substance document

api.getVersion() ⇒ string

Get current version of the Writer

Returns: string - Version tag

api.getConfigValue(id, path, defaultValue) ⇒ *

Get configuration value in a plugins local configuration data section. If no path is given the full configuration object for the plugin instance is returned.

Returns: * - The value of the wanted configuration path or default value

Param Type Description
id string Plugin id to fetch configuration value for
path string Optional configuration path in the data section
defaultValue * Optional default value if no value is found

Example

{
   "vendor": "vendor.tld",
   "name": "myplugin",
   "enabled": true,
   "data": {
     "mykey": "Configuration value"
   }
 },

Example

import {api} from 'writer'
var apiEndpoint = api.getConfigValue('myplugin', 'mykey');`

api.hasLocalConfiguration() ⇒ Boolean

Check if the configuration has been overridden with local configuration

api.getPluginModule(moduleId) ⇒ Object

Return a fresh instance of a specific plugin provided module

Param Type Description
moduleId string Module id

api.getPluginModulesForTarget(targetId)

Get modules targeted at a specific consumer

Param Type Description
targetId string Target id of the consumer

results matching ""

    No results matching ""