diff --git a/docs/zotero-plugin-toolkit.md b/docs/zotero-plugin-toolkit.md index 55356df..93efd39 100644 --- a/docs/zotero-plugin-toolkit.md +++ b/docs/zotero-plugin-toolkit.md @@ -137,6 +137,17 @@ Helper class for storing large amounts of data in Zotero preferences. Register <menuitem>, <menupopup>, or <menuseperator> to Zotero right-click/window menus. + + + +[MessageHelper](./zotero-plugin-toolkit.messagehelper.md) + + + + +**_(ALPHA)_** MessageHelper + + diff --git a/docs/zotero-plugin-toolkit.messagehelper._constructor_.md b/docs/zotero-plugin-toolkit.messagehelper._constructor_.md new file mode 100644 index 0000000..59b04d1 --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper._constructor_.md @@ -0,0 +1,50 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) > [(constructor)](./zotero-plugin-toolkit.messagehelper._constructor_.md) + +## MessageHelper.(constructor) + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Constructs a new instance of the `MessageHelper` class + +**Signature:** + +```typescript +constructor(config: MessageServerConfig); +``` + +## Parameters + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +MessageServerConfig + + + + + +
diff --git a/docs/zotero-plugin-toolkit.messagehelper.config.md b/docs/zotero-plugin-toolkit.messagehelper.config.md new file mode 100644 index 0000000..1ee8cb5 --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper.config.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) > [config](./zotero-plugin-toolkit.messagehelper.config.md) + +## MessageHelper.config property + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +**Signature:** + +```typescript +protected config: Required; +``` diff --git a/docs/zotero-plugin-toolkit.messagehelper.env.md b/docs/zotero-plugin-toolkit.messagehelper.env.md new file mode 100644 index 0000000..fa858de --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper.env.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) > [env](./zotero-plugin-toolkit.messagehelper.env.md) + +## MessageHelper.env property + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +**Signature:** + +```typescript +protected env: "webworker" | "chromeworker" | "browser" | "content"; +``` diff --git a/docs/zotero-plugin-toolkit.messagehelper.listener.md b/docs/zotero-plugin-toolkit.messagehelper.listener.md new file mode 100644 index 0000000..e216d62 --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper.listener.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) > [listener](./zotero-plugin-toolkit.messagehelper.listener.md) + +## MessageHelper.listener property + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +**Signature:** + +```typescript +protected listener?: any; +``` diff --git a/docs/zotero-plugin-toolkit.messagehelper.md b/docs/zotero-plugin-toolkit.messagehelper.md new file mode 100644 index 0000000..5c219e4 --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper.md @@ -0,0 +1,199 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) + +## MessageHelper class + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +MessageHelper + +**Signature:** + +```typescript +export declare class MessageHelper<_TargetHandlers extends MessageHandlers> +``` + +## Constructors + + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(config)](./zotero-plugin-toolkit.messagehelper._constructor_.md) + + + + + + + +**_(ALPHA)_** Constructs a new instance of the `MessageHelper` class + + +
+ +## Properties + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[config](./zotero-plugin-toolkit.messagehelper.config.md) + + + + +`protected` + + + + +Required<MessageServerConfig> + + + + +**_(ALPHA)_** + + +
+ +[env](./zotero-plugin-toolkit.messagehelper.env.md) + + + + +`protected` + + + + +"webworker" \| "chromeworker" \| "browser" \| "content" + + + + +**_(ALPHA)_** + + +
+ +[listener?](./zotero-plugin-toolkit.messagehelper.listener.md) + + + + +`protected` + + + + +any + + + + +**_(ALPHA)_** _(Optional)_ + + +
+ +[privileged](./zotero-plugin-toolkit.messagehelper.privileged.md) + + + + +`readonly` + + + + +boolean + + + + +**_(ALPHA)_** + + +
+ +[running](./zotero-plugin-toolkit.messagehelper.running.md) + + + + + + + +boolean + + + + +**_(ALPHA)_** + + +
+ +[target](./zotero-plugin-toolkit.messagehelper.target.md) + + + + +`readonly` + + + + +Window \| Worker + + + + +**_(ALPHA)_** + + +
diff --git a/docs/zotero-plugin-toolkit.messagehelper.privileged.md b/docs/zotero-plugin-toolkit.messagehelper.privileged.md new file mode 100644 index 0000000..b3f25cd --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper.privileged.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) > [privileged](./zotero-plugin-toolkit.messagehelper.privileged.md) + +## MessageHelper.privileged property + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +**Signature:** + +```typescript +get privileged(): boolean; +``` diff --git a/docs/zotero-plugin-toolkit.messagehelper.running.md b/docs/zotero-plugin-toolkit.messagehelper.running.md new file mode 100644 index 0000000..3ca8013 --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper.running.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) > [running](./zotero-plugin-toolkit.messagehelper.running.md) + +## MessageHelper.running property + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +**Signature:** + +```typescript +running: boolean; +``` diff --git a/docs/zotero-plugin-toolkit.messagehelper.target.md b/docs/zotero-plugin-toolkit.messagehelper.target.md new file mode 100644 index 0000000..b375ec5 --- /dev/null +++ b/docs/zotero-plugin-toolkit.messagehelper.target.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) > [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) > [target](./zotero-plugin-toolkit.messagehelper.target.md) + +## MessageHelper.target property + +> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +**Signature:** + +```typescript +get target(): Window | Worker; +``` diff --git a/src/_doc.ts b/src/_doc.ts index 1c85a09..f16d2c3 100644 --- a/src/_doc.ts +++ b/src/_doc.ts @@ -16,6 +16,7 @@ export { LargePrefHelper, // PromptManager, MenuManager, + MessageHelper, PatchHelper, ProgressWindowHelper, ReaderTool, diff --git a/src/helpers/message.ts b/src/helpers/message.ts index fa658f2..1a6efd6 100644 --- a/src/helpers/message.ts +++ b/src/helpers/message.ts @@ -65,10 +65,10 @@ interface BuiltInMessageHandlers { } /** - * MessageServerHelper + * MessageHelper * @alpha */ -export class MessageServerHelper<_TargetHandlers extends MessageHandlers> { +export class MessageHelper<_TargetHandlers extends MessageHandlers> { protected config: Required; protected env: "webworker" | "chromeworker" | "browser" | "content";