Skip to content

Commit

Permalink
add: MessageHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Oct 21, 2024
1 parent 5ee9602 commit 341b0fd
Show file tree
Hide file tree
Showing 11 changed files with 347 additions and 2 deletions.
11 changes: 11 additions & 0 deletions docs/zotero-plugin-toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ Helper class for storing large amounts of data in Zotero preferences.
Register &lt;<!-- -->menuitem<!-- -->&gt;<!-- -->, &lt;<!-- -->menupopup<!-- -->&gt;<!-- -->, or &lt;<!-- -->menuseperator<!-- -->&gt; to Zotero right-click/window menus.


</td></tr>
<tr><td>

[MessageHelper](./zotero-plugin-toolkit.messagehelper.md)


</td><td>

**_(ALPHA)_** MessageHelper


</td></tr>
<tr><td>

Expand Down
50 changes: 50 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) &gt; [(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

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

config


</td><td>

MessageServerConfig


</td><td>


</td></tr>
</tbody></table>
14 changes: 14 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper.config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) &gt; [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<MessageServerConfig>;
```
14 changes: 14 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper.env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) &gt; [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";
```
14 changes: 14 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper.listener.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) &gt; [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;
```
199 changes: 199 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [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

<table><thead><tr><th>

Constructor


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[(constructor)(config)](./zotero-plugin-toolkit.messagehelper._constructor_.md)


</td><td>


</td><td>

**_(ALPHA)_** Constructs a new instance of the `MessageHelper` class


</td></tr>
</tbody></table>

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[config](./zotero-plugin-toolkit.messagehelper.config.md)


</td><td>

`protected`


</td><td>

Required&lt;MessageServerConfig&gt;


</td><td>

**_(ALPHA)_**


</td></tr>
<tr><td>

[env](./zotero-plugin-toolkit.messagehelper.env.md)


</td><td>

`protected`


</td><td>

"webworker" \| "chromeworker" \| "browser" \| "content"


</td><td>

**_(ALPHA)_**


</td></tr>
<tr><td>

[listener?](./zotero-plugin-toolkit.messagehelper.listener.md)


</td><td>

`protected`


</td><td>

any


</td><td>

**_(ALPHA)_** _(Optional)_


</td></tr>
<tr><td>

[privileged](./zotero-plugin-toolkit.messagehelper.privileged.md)


</td><td>

`readonly`


</td><td>

boolean


</td><td>

**_(ALPHA)_**


</td></tr>
<tr><td>

[running](./zotero-plugin-toolkit.messagehelper.running.md)


</td><td>


</td><td>

boolean


</td><td>

**_(ALPHA)_**


</td></tr>
<tr><td>

[target](./zotero-plugin-toolkit.messagehelper.target.md)


</td><td>

`readonly`


</td><td>

Window \| Worker


</td><td>

**_(ALPHA)_**


</td></tr>
</tbody></table>
14 changes: 14 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper.privileged.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) &gt; [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;
```
14 changes: 14 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper.running.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) &gt; [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;
```
14 changes: 14 additions & 0 deletions docs/zotero-plugin-toolkit.messagehelper.target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [MessageHelper](./zotero-plugin-toolkit.messagehelper.md) &gt; [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;
```
1 change: 1 addition & 0 deletions src/_doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export {
LargePrefHelper,
// PromptManager,
MenuManager,
MessageHelper,
PatchHelper,
ProgressWindowHelper,
ReaderTool,
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ interface BuiltInMessageHandlers {
}

/**
* MessageServerHelper
* MessageHelper
* @alpha
*/
export class MessageServerHelper<_TargetHandlers extends MessageHandlers> {
export class MessageHelper<_TargetHandlers extends MessageHandlers> {
protected config: Required<MessageServerConfig>;

protected env: "webworker" | "chromeworker" | "browser" | "content";
Expand Down

0 comments on commit 341b0fd

Please sign in to comment.