effect-io-ai

Package: effect
Module: Duration

Duration.DurationObject

An object with optional duration components that can be combined to create a Duration. All fields are optional and additive.

Details

Compatible with Temporal.Duration-like objects.

Example (Combining duration object fields)

import { Duration } from "effect"

Duration.fromInputUnsafe({ seconds: 30 })
Duration.fromInputUnsafe({ days: 1 })
Duration.fromInputUnsafe({ seconds: 1, nanoseconds: 500 })

Signature

export interface DurationObject {
  readonly weeks?: number | undefined
  readonly days?: number | undefined
  readonly hours?: number | undefined
  readonly minutes?: number | undefined
  readonly seconds?: number | undefined
  readonly milliseconds?: number | undefined
  readonly microseconds?: number | undefined
  readonly nanoseconds?: number | undefined
}

Source

Since v4.0.0