Skip to main content

WorkerProgress

@webda/workout


Class: WorkerProgress

Defined in: packages/workout/src/core.ts:114

Represents a progress indicator

Constructors​

Constructor​

new WorkerProgress(uid, total, groups, title?): WorkerProgress

Defined in: packages/workout/src/core.ts:141

Creates a new progress indicator

Parameters​

uid​

string

Unique identifier for this progress

total​

number

Total number of units (use -1 for indeterminate)

groups​

string[]

Log groups this progress belongs to

title?​

string

Display title (defaults to uid if not provided)

Returns​

WorkerProgress

Properties​

current​

current: number = 0

Defined in: packages/workout/src/core.ts:126

Current progress value


groups​

groups: string[] = []

Defined in: packages/workout/src/core.ts:118

Log groups this progress belongs to


running​

running: boolean = true

Defined in: packages/workout/src/core.ts:128

Whether the progress is still running


status?​

optional status?: string

Defined in: packages/workout/src/core.ts:132

Status once done (success, error, warning, info)


title​

title: string

Defined in: packages/workout/src/core.ts:116

Display title for the progress


total​

total: number

Defined in: packages/workout/src/core.ts:124

Total number of units for this progress. If -1 the progress is indeterminate


uid​

uid: string

Defined in: packages/workout/src/core.ts:120

Unique identifier for this progress

Methods​

getRatio()​

getRatio(): number

Defined in: packages/workout/src/core.ts:152

Get the completion ratio (current/total)

Returns​

number

A number between 0 and 1 representing completion percentage


incrementProgress()​

incrementProgress(inc): void

Defined in: packages/workout/src/core.ts:160

Increment the progress by a specified amount

Parameters​

inc​

number

Amount to increment by

Returns​

void


updateProgress()​

updateProgress(current): void

Defined in: packages/workout/src/core.ts:168

Update the progress to a specific value

Parameters​

current​

number

New progress value

Returns​

void