@unieai/cordis-plugin-timer 1.1.3 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -33
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +9 -11
- package/lib/types/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @unieai/cordis-plugin-timer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Timer service for cordis
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Part of Rabi, the agent harness UnieAI Code runs on. Installed as a dependency of `@unieai/rabi`;
|
|
6
|
+
not meant to be used on its own.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
import { Context } from 'cordis'
|
|
9
|
-
import Timer from '@cordisjs/plugin-timer'
|
|
10
|
-
|
|
11
|
-
const root = new Context()
|
|
12
|
-
await root.plugin(Timer)
|
|
13
|
-
|
|
14
|
-
const dispose = root.timeout(() => {
|
|
15
|
-
root.logger.info('done')
|
|
16
|
-
}, 1000)
|
|
17
|
-
|
|
18
|
-
dispose()
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Timer handles are registered on the current fiber, so they are cleared
|
|
22
|
-
automatically when the plugin that created them is disposed.
|
|
23
|
-
|
|
24
|
-
## API
|
|
25
|
-
|
|
26
|
-
| API | Description |
|
|
27
|
-
| --- | --- |
|
|
28
|
-
| `ctx.timeout(callback, delay)` | Run once and return a disposer. |
|
|
29
|
-
| `ctx.timeout(delay)` | Return a promise that resolves after `delay`. |
|
|
30
|
-
| `ctx.interval(callback, delay)` | Run repeatedly and return a disposer. |
|
|
31
|
-
| `ctx.interval(delay)` | Return an async iterator that yields on each interval. |
|
|
32
|
-
| `ctx.throttle(callback, delay, noTrailing?)` | Return a throttled function with `.dispose()`. |
|
|
33
|
-
| `ctx.debounce(callback, delay)` | Return a debounced function with `.dispose()`. |
|
|
34
|
-
|
|
35
|
-
`ctx.setTimeout()` and `ctx.setInterval()` are kept as deprecated aliases for
|
|
36
|
-
`ctx.timeout()` and `ctx.interval()`.
|
|
8
|
+
See LICENSE for the license and copyright of this package.
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unieai/cordis-plugin-timer",
|
|
3
3
|
"description": "Timer service for cordis",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.7",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/UnieAI/UnieAI-Agent-Desktop.git",
|
|
11
|
-
"directory": "vendor/timer"
|
|
12
|
-
},
|
|
13
8
|
"type": "module",
|
|
14
9
|
"main": "lib/index.js",
|
|
15
10
|
"types": "lib/types/index.d.ts",
|
|
@@ -19,20 +14,23 @@
|
|
|
19
14
|
"default": "./lib/index.js"
|
|
20
15
|
},
|
|
21
16
|
"./src/*": "./src/*",
|
|
22
|
-
"./package.json": "./package.json"
|
|
17
|
+
"./package.json": "./package.json",
|
|
18
|
+
"./locale/*.json": "./locale/*.json"
|
|
23
19
|
},
|
|
24
20
|
"files": [
|
|
25
21
|
"lib/index.js",
|
|
26
22
|
"lib/types/**/*.d.ts",
|
|
27
23
|
"lib/types/**/*.d.ts.map",
|
|
28
|
-
"src"
|
|
24
|
+
"src",
|
|
25
|
+
"locale",
|
|
26
|
+
"README.md"
|
|
29
27
|
],
|
|
30
28
|
"author": "Shigma <shigma10826@gmail.com>",
|
|
31
29
|
"license": "MIT",
|
|
32
30
|
"peerDependencies": {
|
|
33
|
-
"@unieai/cordis": "
|
|
31
|
+
"@unieai/cordis": "4.0.5"
|
|
34
32
|
},
|
|
35
33
|
"dependencies": {
|
|
36
|
-
"@unieai/cosmokit": "
|
|
34
|
+
"@unieai/cosmokit": "1.8.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