Skip to content

Commit

Permalink
feat(types): add typescript types to package
Browse files Browse the repository at this point in the history
  • Loading branch information
manast authored Sep 29, 2022
1 parent 5207fa3 commit e793f8d
Show file tree
Hide file tree
Showing 3 changed files with 1,062 additions and 1 deletion.
8 changes: 7 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
```
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit e793f8d

Please sign in to comment.