Skip to content

Commit

Permalink
add: export utils/wait
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Sep 26, 2024
1 parent 721b3fa commit dad043e
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/zotero-plugin-toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,29 @@ Description
`props` of `UITool.createElement`<!-- -->. See [UITool](./zotero-plugin-toolkit.uitool.md)


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

## Namespaces

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

Namespace


</th><th>

Description


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

[wait](./zotero-plugin-toolkit.wait.md)


</td><td>


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

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [wait](./zotero-plugin-toolkit.wait.md)

## wait namespace

## Functions

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

Function


</th><th>

Description


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

[waitForReader(reader)](./zotero-plugin-toolkit.wait.waitforreader.md)


</td><td>


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

[waitUntil(condition, callback, interval, timeout)](./zotero-plugin-toolkit.wait.waituntil.md)


</td><td>


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

[waitUtilAsync(condition, interval, timeout)](./zotero-plugin-toolkit.wait.waitutilasync.md)


</td><td>


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

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [wait](./zotero-plugin-toolkit.wait.md) &gt; [waitForReader](./zotero-plugin-toolkit.wait.waitforreader.md)

## wait.waitForReader() function

**Signature:**

```typescript
declare function waitForReader(reader: _ZoteroTypes.ReaderInstance): Promise<void>;
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

reader


</td><td>

\_ZoteroTypes.ReaderInstance


</td><td>


</td></tr>
</tbody></table>
**Returns:**

Promise&lt;void&gt;

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

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [wait](./zotero-plugin-toolkit.wait.md) &gt; [waitUntil](./zotero-plugin-toolkit.wait.waituntil.md)

## wait.waitUntil() function

**Signature:**

```typescript
declare function waitUntil(condition: () => boolean, callback: () => void, interval?: number, timeout?: number): void;
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

condition


</td><td>

() =&gt; boolean


</td><td>


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

callback


</td><td>

() =&gt; void


</td><td>


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

interval


</td><td>

number


</td><td>

_(Optional)_


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

timeout


</td><td>

number


</td><td>

_(Optional)_


</td></tr>
</tbody></table>
**Returns:**

void

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

[Home](./index.md) &gt; [zotero-plugin-toolkit](./zotero-plugin-toolkit.md) &gt; [wait](./zotero-plugin-toolkit.wait.md) &gt; [waitUtilAsync](./zotero-plugin-toolkit.wait.waitutilasync.md)

## wait.waitUtilAsync() function

**Signature:**

```typescript
declare function waitUtilAsync(condition: () => boolean, interval?: number, timeout?: number): Promise<void>;
```

## Parameters

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

Parameter


</th><th>

Type


</th><th>

Description


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

condition


</td><td>

() =&gt; boolean


</td><td>


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

interval


</td><td>

number


</td><td>

_(Optional)_


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

timeout


</td><td>

number


</td><td>

_(Optional)_


</td></tr>
</tbody></table>
**Returns:**

Promise&lt;void&gt;

1 change: 1 addition & 0 deletions src/_doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ export {
KeyModifier,
PatchHelper,
GuideHelper,
wait,
} from "./index.js";
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ export * from "./managers/keyboard.js";
export * from "./helpers/patch.js";
export * from "./helpers/guide.js";
export * from "./ztoolkit.js";
export * as wait from "./utils/wait.js";

0 comments on commit dad043e

Please sign in to comment.