feat(types): add typescript types to package

This commit is contained in:
Manuel Astudillo
2022-09-29 16:47:13 +02:00
committed by GitHub
parent 5207fa348b
commit e793f8d150
3 changed files with 1062 additions and 1 deletions
+7 -1
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -6,6 +6,7 @@
"node": ">=10.1"
},
"main": "./index.js",
"types": "./index.d.ts",
"repository": {
"type": "git",
"url": "git://github.com/OptimalBits/bull.git"