Skip to main content

externalDuration

Represents a duration in milliseconds between two timestamps.

Hierarchy

  • TinyType
    • Duration

Index

Constructors

externalconstructor

  • new Duration(milliseconds: number): Duration
  • Parameters

    • externalmilliseconds: number

    Returns Duration

Methods

staticexternalofMilliseconds

  • ofMilliseconds(milliseconds: number): Duration
  • Parameters

    • externalmilliseconds: number

    Returns Duration

staticexternalofSeconds

  • Parameters

    • externalseconds: number

    Returns Duration

staticexternalofMinutes

  • Parameters

    • externalminutes: number

    Returns Duration

staticexternalofHours

  • Parameters

    • externalhours: number

    Returns Duration

staticexternalofDays

  • Parameters

    • externaldays: number

    Returns Duration

staticexternalofYears

  • Parameters

    • externalyears: number

    Returns Duration

staticexternalfromJSON

  • fromJSON(__namedParameters: { milliseconds: number }): Duration
  • Parameters

    • external__namedParameters: { milliseconds: number }
      • externalmilliseconds: number

    Returns Duration

externalisLessThan

  • Parameters

    Returns boolean

externalisLessThanOrEqualTo

  • isLessThanOrEqualTo(another: Duration): boolean
  • Parameters

    Returns boolean

externalisGreaterThan

  • isGreaterThan(another: Duration): boolean
  • Parameters

    Returns boolean

externalisGreaterThanOrEqualTo

  • isGreaterThanOrEqualTo(another: Duration): boolean
  • Parameters

    Returns boolean

externalplus

externalinMilliseconds

  • inMilliseconds(): number
  • Returns number

externaltoString

  • toString(): string
  • Returns string

externaltoJSON

  • toJSON(): JSONObject
  • Returns JSONObject

externalequals

  • equals(another: TinyType): boolean
  • @desc

    Compares two tiny types by value

    @example
    class Id extends TinyTypeOf<string>() {}

    const id = new Id(`3cc0852d-fda7-4f61-874e-0cfadbd6182a`);

    id.equals(id) === true
    @example
    class FirstName extends TinyTypeOf<string>() {}
    class LastName extends TinyTypeOf<string>() {}
    class Age extends TinyTypeOf<number>() {}

    class Person extends TinyType {
    constructor(public readonly firstName: FirstName,
    public readonly lastName: LastName,
    public readonly age: Age,
    ) {
    super();
    }
    }

    const p1 = new Person(new FirstName('John'), new LastName('Smith'), new Age(42)),
    p2 = new Person(new FirstName('John'), new LastName('Smith'), new Age(42));

    p1.equals(p2) === true

    Parameters

    • externalanother: TinyType

    Returns boolean