Nonsense Poetry Manager

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

    4.1.3 • Public • Published

    Installation

    npm install --save @types/react-timeago

    Summary

    This package contains type definitions for react-timeago (https://github.com/nmn/react-timeago).

    Details

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

    index.d.ts

    // Type definitions for react-timeago 4.1
    // Project: https://github.com/nmn/react-timeago
    // Definitions by: Konstantin Lebedev <https://github.com/koss-lebedev>
    //                 Mike Martin <https://github.com/mcmar>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.9
    
    import * as React from "react";
    
    declare namespace ReactTimeago {
        type Unit =
            | "second"
            | "minute"
            | "hour"
            | "day"
            | "week"
            | "month"
            | "year";
    
        type Suffix = "ago" | "from now";
    
        type Formatter = (
            value: number,
            unit: Unit,
            suffix: Suffix,
            epochMiliseconds: number,
            nextFormatter?: Formatter
        ) => React.ReactNode;
    
        interface ReactTimeagoProps<T extends React.ComponentType | keyof JSX.IntrinsicElements = 'time'> {
            readonly live?: boolean | undefined;
            readonly minPeriod?: number | undefined;
            readonly maxPeriod?: number | undefined;
            readonly component?: T | undefined;
            readonly title?: string | undefined;
            readonly formatter?: Formatter | undefined;
            readonly date: string | number | Date;
            readonly now?: (() => number) | undefined;
        }
    }
    
    declare class ReactTimeago<
        T extends React.ComponentType | keyof JSX.IntrinsicElements
    > extends React.Component<
        ReactTimeago.ReactTimeagoProps<T> & React.ComponentProps<T>
    > {}
    
    export = ReactTimeago;

    Additional Details

    • Last updated: Thu, 08 Jul 2021 22:41:40 GMT
    • Dependencies: @types/react
    • Global values: none

    Credits

    These definitions were written by Konstantin Lebedev, and Mike Martin.

    Keywords

    none

    Install

    npm i @types/react-timeago

    DownloadsWeekly Downloads

    33,695

    Version

    4.1.3

    License

    MIT

    Unpacked Size

    5.79 kB

    Total Files

    4

    Last publish

    Collaborators

    • types