@types/human-date
TypeScript icon, indicating that this package has built-in type declarations

1.4.5 • Public • Published

Installation

npm install --save @types/human-date

Summary

This package contains type definitions for human-date (https://github.com/montanaflynn/human-date).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/human-date.

index.d.ts

export interface PrettyPrintOptions {
    showTime?: boolean;
}

export interface RelativeTimeOptions {
    futureSuffix?: string;
    pastSuffix?: string;
    presentText?: string;
    returnObject?: boolean;
    allUnits?: boolean;
}

export interface RelativeTimeReturns {
    seconds: number;
    hours: number;
    days: number;
    years: number;
    past: boolean;
}

// prettyPrint
export function prettyPrint(
    arg?: string | Date | number,
    options?: PrettyPrintOptions,
): string;

// relativeTime
export function relativeTime(
    arg: string | Date | number,
    options?: RelativeTimeOptions & { returnObject?: false },
): string;

export function relativeTime(
    arg: string | Date | number,
    options: RelativeTimeOptions & { returnObject: true },
): RelativeTimeReturns;

// monthName
export function monthName(arg: string | Date | number): string;

// toUTC
export function toUTC(arg?: string | Date | number): Date;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Rico Sandyca Novenza.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/human-date

Weekly Downloads

495

Version

1.4.5

License

MIT

Unpacked Size

4.46 kB

Total Files

5

Last publish

Collaborators

  • types