UNPKG

1.04 kBTypeScriptView Raw
1import type { ContextOptions } from "./types.js";
2/**
3 * The {@link endOfYesterday} function options.
4 */
5export interface EndOfYesterdayOptions<DateType extends Date = Date>
6 extends ContextOptions<DateType> {}
7/**
8 * @name endOfYesterday
9 * @category Day Helpers
10 * @summary Return the end of yesterday.
11 * @pure false
12 *
13 * @description
14 * Return the end of yesterday.
15 *
16 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
17 * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
18 *
19 * @returns The end of yesterday
20 *
21 * @example
22 * // If today is 6 October 2014:
23 * const result = endOfYesterday()
24 * //=> Sun Oct 5 2014 23:59:59.999
25 */
26export declare function endOfYesterday<
27 DateType extends Date,
28 ResultDate extends Date = DateType,
29>(options?: EndOfYesterdayOptions<ResultDate> | undefined): ResultDate;