# Bar

Interface

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/utils/logger.ts#L95

Determinate progress bar handle. Closed explicitly via `end()`, or
implicitly when an enclosing [Group](https://api.playcanvas.com/splat-transform/interfaces/Group.md)'s `end()` (or a
[Logger.unwindAll](https://api.playcanvas.com/splat-transform/variables/logger.md#unwindall)) pops it as part of cleanup.

Carries a `[Symbol.dispose]` slot directly (rather than extending the
built-in `Disposable` lib type) so the published `.d.ts` stays free of
any reference to the `Disposable` interface. `Symbol.dispose` itself is
still a TS 5.2+ / `esnext.disposable` (or `es2024.disposable`) lib
symbol, so consumers compiling against these declarations need that
lib enabled (or `skipLibCheck: true`). Callers on TS 5.2+ / Node 20+
can adopt `using bar = logger.bar(...)` because `using` only requires
the `[Symbol.dispose]` shape structurally.

## Methods

### [dispose]

```ts
[dispose](): void
```

Dispose hook so `using` syntax closes the bar on scope exit.

### end

```ts
end(): void
```

Close the bar and emit final timing.

### tick

```ts
tick(n?: number): void
```

Advance the bar by `n` ticks.

**Parameters**

- `n` (`number`, optional): Number of ticks to advance (default 1).

### update

```ts
update(current: number): void
```

Set the bar's absolute progress. Clamped to `[0, total]`. Suppresses
a `barTick` event when the value is unchanged.

**Parameters**

- `current` (`number`): Absolute progress value.
