Methods
getCheckConfigs() → {Promise.<Object>}inner
#
Get the resolved per-check config, keyed by check name.
This is independent of any particular page: it is derived from the global edit check configuration, so it does not require a document to be loaded. The edit check modules must be loaded before calling this.
The textMatch check additionally supports per-matchRule (matchItem) config,
which is exposed keyed as "textMatch/
Returns:
Map of check name to a summary of its resolved config
getClosestIdFromModel(node) → {string|undefined}inner
#
undefined}inner
#
Get the closest parsoid ID from the model node.
Parameters:
| Name | Type | Description |
|---|---|---|
node |
ve.dm.Node | The model node. |
Returns:
The closest ID or undefined if not found.
- Type
-
string
|
undefined
loadConfig(pageName, requestId) → {jQuery.Promise.<object>}inner
#
Load additional config metadata for a page.
Parameters:
| Name | Type | Description |
|---|---|---|
pageName |
string | The name of the page. |
requestId |
number | The request ID. |
Returns:
A promise that resolves with the config metadata.
- Type
- jQuery.Promise.<object>
loadHtml(pageName, requestId, [parsoidHtml]) → {jQuery.Promise.<string>}inner
#
Load the HTML content for a page.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
pageName |
string | The name of the page. |
|
requestId |
number | The request ID. |
|
parsoidHtml |
string |
optional |
The Parsoid HTML content. |
Returns:
A promise that resolves with the HTML content.
- Type
- jQuery.Promise.<string>
loadModules() → {jQuery.Promise}inner
#
Load the VisualEditor modules for headless operation.
Returns:
A promise that resolves when the modules are loaded.
- Type
- jQuery.Promise
publishHeadlessProgress(msg, requestId)inner
#
Publish the headless progress to the window and fire an event.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
string | The progress message. |
requestId |
number | The request ID associated with the progress. |
publishHeadlessResult(result)inner
#
Publish the headless result to the window and fire an event.
Parameters:
| Name | Type | Description |
|---|---|---|
result |
Object | The result object to publish. |
runHeadlessForPage(pageNameRaw, requestId, [parsoidHtml]) → {Promise.<object>}inner
#
Run the headless VisualEditor for a page.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
pageNameRaw |
string | The page name from user input. |
|
requestId |
number | The request ID. |
|
parsoidHtml |
string |
optional |
The Parsoid HTML content. |
Returns:
A promise that resolves with the result.
- Type
- Promise.<object>
serializeHeadlessAction(action, dmDoc) → {Object}inner
#
Serialize a headless action into a plain object for output.
Parameters:
| Name | Type | Description |
|---|---|---|
action |
mw.editcheck.EditCheckAction | The action to serialize. |
dmDoc |
ve.dm.Document | The document model for context. |
Returns:
The serialized action.
- Type
- Object