1.3.3 • Published 6 months ago

@types/expired v1.3.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/expired

Summary

This package contains type definitions for expired (https://github.com/lukechilds/expired).

Details

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

index.d.ts

// Type definitions for expired 1.3
// Project: https://github.com/lukechilds/expired
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export = expired;

declare const expired: expired;

interface expired {
    /**
     * @returns A boolean relating to whether the resource has expired or not.
     * `true` means it's expired, `false` means it's fresh.
     */
    (headers: expired.Headers, compareWith?: Date): boolean;
    /**
     * @returns The amount of milliseconds from the current date until the resource will expire.
     * If the resource has already expired it will return a negative integer.
     */
    in(headers: expired.Headers, compareWith?: Date): number;
    /**
     * @returns A JavaScript `Date` object for the date the resource will expire.
     */
    on(headers: expired.Headers): Date;
}

declare namespace expired {
    type Headers = string | { [header: string]: string | number | string[] | undefined };
}

Additional Details

  • Last updated: Tue, 24 Aug 2021 01:31:28 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by BendingBender.