mirror of
https://github.com/OptimalBits/bull.git
synced 2026-07-02 08:27:43 +08:00
feat(types): add typescript types to package
This commit is contained in:
+7
-1
@@ -74,6 +74,7 @@ interface QueueOptions {
|
||||
prefix?: string = 'bull'; // prefix for all queue keys.
|
||||
metrics?: MetricsOpts; // Configure metrics
|
||||
defaultJobOptions?: JobOpts;
|
||||
createClient?: (type: enum('client', 'subscriber'), redisOpts?: RedisOpts) => redisClient,
|
||||
settings?: AdvancedSettings;
|
||||
}
|
||||
```
|
||||
@@ -661,7 +662,8 @@ getJobCounts() : Promise<JobCounts>
|
||||
|
||||
Returns a promise that will return the job counts for the given queue.
|
||||
|
||||
```typescript{
|
||||
```typescript
|
||||
{
|
||||
interface JobCounts {
|
||||
waiting: number,
|
||||
active: number,
|
||||
@@ -881,6 +883,10 @@ A job includes all data needed to perform its execution, as well as the progress
|
||||
|
||||
The most important property for the user is `Job#data` that includes the object that was passed to [`Queue#add`](#queueadd), and that is normally used to perform the job.
|
||||
|
||||
Other useful job properties:
|
||||
* `job.attemptsMade`: number of failed attempts.
|
||||
* `job.finishedOn`: Unix Timestamp, when job is completed or finally failed after all attempts.
|
||||
|
||||
### Job#progress
|
||||
|
||||
```ts
|
||||
|
||||
Vendored
+1054
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
||||
"node": ">=10.1"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/OptimalBits/bull.git"
|
||||
|
||||
Reference in New Issue
Block a user