Skip to content

Commit b78b2f3

Browse files
stee-reca-d
authored andcommitted
docs: change plugin prop "docVersion" to "docsState"
1 parent 95c83cb commit b78b2f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/plugin-api.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
An **OpenSCD plugin** is a [custom element](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#implementing_a_custom_element) that has been registered in the global [`customElements`](https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements) registry under some tag name. OpenSCD core renders an element with that tag name into the app. The component may optionally provide a `run()` method for OpenSCD core to call in order to trigger an action.
1010

1111
The **OpenSCD core API** describes the ways in which:
12+
1213
- OpenSCD core communicates relevant data to the plugins,
1314
- plugins communicate user intent to OpenSCD core, and
1415
- OpenSCD sets CSS fonts and colors for plugins.
@@ -17,14 +18,13 @@ The **OpenSCD core API** describes the ways in which:
1718

1819
OpenSCD core communicates the data necessary for editing SCL documents by setting the following [properties](https://developer.mozilla.org/en-US/docs/Glossary/Property/JavaScript) on the plugin's [DOM Element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement):
1920

20-
2121
```typescript
2222
export default class MyPlugin extends HTMLElement {
2323
editor: Transactor<EditV2>;
2424
docs: Record<string, XMLDocument> = {}; // all loaded documents
2525
doc?: XMLDocument; // the document currently being edited
2626
docName?: string; // the current doc's name
27-
docVersion: unknown; // current doc's state indicator
27+
docsState: unknown; // changes value when the document is modified or documents are added/removed.
2828
locale: string = 'en'; // the end user's chosen locale
2929
}
3030
```
@@ -46,8 +46,9 @@ The name of the `XMLDocument` currently being edited.
4646

4747
The `XMLDocument` currently being edited.
4848

49-
### `docVersion`
50-
A change in this property's value indicates a change to the `doc`.
49+
### `docsState`
50+
51+
A value which changes with edits to the current document AND when documents are opened or closed.
5152

5253
### `locale`
5354

0 commit comments

Comments
 (0)