New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@types/timeago

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/timeago

TypeScript definitions for timeago

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
ts7.0
ts7.1
latest
Source
npmnpm
Version
1.6.3
Version published
Weekly downloads
4.2K
11.98%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/timeago

Summary

This package contains type definitions for timeago (http://timeago.yarp.com/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/timeago.

index.d.ts

/// <reference types="jquery" />

declare namespace Timeago {
    type DynamicMessage = (n: number, distanceMillis: number) => string;

    interface LocalizedStrings {
        prefixAgo: string | null;
        prefixFromNow: string | null;
        suffixAgo: string | null;
        suffixFromNow: string | null;
        inPast: string;
        seconds: string | DynamicMessage;
        minute: string | DynamicMessage;
        minutes: string | DynamicMessage;
        hour: string | DynamicMessage;
        hours: string | DynamicMessage;
        day: string | DynamicMessage;
        days: string | DynamicMessage;
        month: string | DynamicMessage;
        months: string | DynamicMessage;
        year: string | DynamicMessage;
        years: string | DynamicMessage;
        wordSeparator: string;
        numbers: string[];
    }

    interface Settings {
        refreshMillis: number;
        allowPast: boolean;
        allowFuture: boolean;
        localeTitle: boolean;
        cutoff: number;
        autoDispose: boolean;
        strings: LocalizedStrings;
    }

    interface TimeagoStatic {
        (timestamp: Date | string | number | Element): string;
        parse(timestamp: string): Date;
        inWords(distanceMillis: number): string;
        datetime(elem: Element): Date;
        isTime(elem: Element): boolean;
        settings: Settings;
    }
}

interface JQuery {
    timeago(action: "update", timestamp: Date | string): this;
    timeago(action?: "init" | "updateFromDOM" | "dispose"): this;
}

interface JQueryStatic {
    timeago: Timeago.TimeagoStatic;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Christophe Coevoet.

FAQs

Package last updated on 07 Nov 2023

Related posts