From bfb190857dc922bacb0600abf7896b4972f3b92f Mon Sep 17 00:00:00 2001 From: Stephen Renwick Date: Tue, 22 Jul 2025 10:52:23 +0200 Subject: [PATCH] feat: correct plugin "version" prop and expose type --- Plugin.ts | 4 ++-- docs/plugin-api.md | 6 +++--- oscd-api.ts | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Plugin.ts b/Plugin.ts index 879d819..1361a75 100644 --- a/Plugin.ts +++ b/Plugin.ts @@ -9,7 +9,7 @@ import { Transactor } from './Transactor.js'; * @property docs - A map of document names to their loaded XMLDocument instances. * @property doc - The XMLDocument currently being edited, if any. * @property docName - The name of the currently edited document, if any. - * @property docsState - changes value when the document is modified or documents are added/removed. + * @property docVersion - changes value when the document is modified. * @property locale - The end user's selected locale. */ export interface Plugin { @@ -17,6 +17,6 @@ export interface Plugin { docs: Record; doc?: XMLDocument; // the document currently being edited docName?: string; // the current doc's name - docsState: unknown; // current doc's state indicator + docVersion: unknown; // changes when the document is modified locale: string; // the end user's chosen locale } diff --git a/docs/plugin-api.md b/docs/plugin-api.md index 4d25bf4..eff348a 100644 --- a/docs/plugin-api.md +++ b/docs/plugin-api.md @@ -24,7 +24,7 @@ export default class MyPlugin extends HTMLElement { docs: Record = {}; // all loaded documents doc?: XMLDocument; // the document currently being edited docName?: string; // the current doc's name - docsState: unknown; // changes value when the document is modified or documents are added/removed. + docVersion: unknown; // changes value when the document is modified. locale: string = 'en'; // the end user's chosen locale } ``` @@ -46,9 +46,9 @@ The name of the `XMLDocument` currently being edited. The `XMLDocument` currently being edited. -### `docsState` +### `docVersion` -A value which changes with edits to the current document AND when documents are opened or closed. +A value which changes with edits to the current document. ### `locale` diff --git a/oscd-api.ts b/oscd-api.ts index 93c6cb3..0cce526 100644 --- a/oscd-api.ts +++ b/oscd-api.ts @@ -32,3 +32,5 @@ export type { } from './edit-event-v2.js'; export type { OpenDetail, OpenEvent } from './open-event.js'; + +export type { Plugin } from './Plugin.js';