# encore.dev/types


## Classes

<!-- symbol-start: Decimal -->
### Decimal <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L23" />

A decimal type that can hold values with arbitrary precision.
Unlike JavaScript's native number type, this can accurately represent
decimal values without floating-point precision errors.

#### Constructors

##### Constructor <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L26" />

`new Decimal(value): Decimal`

###### Parameters

###### value

[`ToDecimal`](#todecimal)

###### Returns

[`Decimal`](#decimal)

#### Accessors

##### value

###### Get Signature

`get value(): string`

###### Returns

`string`

#### Methods

##### \[toPrimitive\]() <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L81" />

`toPrimitive: string | number`

###### Parameters

###### hint

`string`

###### Returns

`string` \| `number`

##### add() <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L45" />

`add(d): Decimal`

Adds this decimal to another decimal value.

###### Parameters

###### d

[`Decimal`](#decimal) \| [`ToDecimal`](#todecimal)

###### Returns

[`Decimal`](#decimal)

##### div() <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L66" />

`div(d): Decimal`

Divides this decimal by another decimal value.

###### Parameters

###### d

[`Decimal`](#decimal) \| [`ToDecimal`](#todecimal)

###### Returns

[`Decimal`](#decimal)

##### mul() <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L59" />

`mul(d): Decimal`

Multiplies this decimal by another decimal value.

###### Parameters

###### d

[`Decimal`](#decimal) \| [`ToDecimal`](#todecimal)

###### Returns

[`Decimal`](#decimal)

##### sub() <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L52" />

`sub(d): Decimal`

Subtracts another decimal value from this decimal.

###### Parameters

###### d

[`Decimal`](#decimal) \| [`ToDecimal`](#todecimal)

###### Returns

[`Decimal`](#decimal)

##### toJSON() <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L74" />

`toJSON(): string`

###### Returns

`string`

##### toString() <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L77" />

`toString(): string`

###### Returns

`string`

<!-- symbol-end -->

## Type Aliases

<!-- symbol-start: DurationString -->
### DurationString <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L11" />

```ts
type DurationString = 
  | durationComponent
  | `${durationComponent}${durationComponent}`
  | `${durationComponent} ${durationComponent}`;
```

A duration is a string representing a length of time.

Examples: `"10s"`, `"500ms"`, `"5m"`, `"1h30m"`, `"1h 30m"`.

***

<!-- symbol-end -->

<!-- symbol-start: ToDecimal -->
### ToDecimal <SymbolSource href="https://github.com/encoredev/encore/blob/main/runtimes/js/encore.dev/types/mod.ts#L16" />

`type ToDecimal = string | number | bigint`


<!-- symbol-end -->
