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

0.1.4 • Public • Published

Installation

npm install --save @types/calendar

Summary

This package contains type definitions for calendar (https://github.com/ramalho/calendar.js#readme).

Details

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

index.d.ts

export type DayFormatter<T> = (day: Date) => T;
export type WeekFormatter<T, U> = (week: T[]) => U;

export const version: string;

export class Calendar {
    /**
     * @param firstWeekDay default is `0` (Sunday)
     */
    constructor(firstWeekDay?: number);

    monthDates<T = Date>(year: number, month: number, dayFormatter?: DayFormatter<T>): T[][];
    monthDates<T, U>(
        year: number,
        month: number,
        dayFormatter: DayFormatter<T>,
        weekFormatter: WeekFormatter<T, U>,
    ): U[];
    monthDays(year: number, month: number): number[][];
    monthText(): string;
    monthText(year: number, month: number): string;
    weekStartDate(date: Date): Date;
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Florian Imdahl.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/calendar

Weekly Downloads

788

Version

0.1.4

License

MIT

Unpacked Size

3.92 kB

Total Files

5

Last publish

Collaborators

  • types