1.5.5 • Published 6 months ago

@types/moment-holiday v1.5.5

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

Installation

npm install --save @types/moment-holiday

Summary

This package contains type definitions for moment-holiday (https://github.com/kodie/moment-holiday).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/moment-holiday.

index.d.ts

// Type definitions for moment-holiday 1.5
// Project: https://github.com/kodie/moment-holiday
// Definitions by: Robert Winslow Dalpe <https://github.com/rwdalpe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import * as moment from 'moment';

declare module 'moment' {
    interface Moment extends Object {
        holiday(
            holidays?: string[] | string,
            adjust?: boolean): Moment | false | { [holidayName: string]: Moment };

        holidays(
            holidays?: string[] | string,
            adjust?: boolean): Moment | false | { [holidayName: string]: Moment };

        isHoliday(
            holidays?: string[] | string | null,
            adjust?: boolean): boolean | string | string[];

        previousHoliday(count?: number, adjust?: boolean): Moment[] | Moment;

        previousHolidays(count?: number, adjust?: boolean): Moment[] | Moment;

        nextHoliday(count?: number, adjust?: boolean): Moment[] | Moment;

        nextHolidays(count?: number, adjust?: boolean): Moment[] | Moment;

        holidaysBetween(m: Moment, adjust?: boolean): Moment[] | false;
    }

    interface HolidayDefinition {
        date: string;
        keywords?: string[] | undefined;
        keywords_y?: string[] | undefined;
        keywords_n?: string[] | undefined;
        regions?: string[] | undefined;
        regions_n?: string[] | undefined;
    }

    interface HolidaysMapping {
        [holidayName: string]: HolidayDefinition;
    }

    interface Holidays {
        active: HolidaysMapping;
        active_last: HolidaysMapping;
    }

    interface HolidayModifier {
        set(
            holidays: HolidaysMapping | string | string[],
            specifics?: any): HolidayModifier;

        add(
            holidays: HolidaysMapping | string,
            specifics?: any): HolidayModifier;

        remove(holidays: string | string[]): HolidayModifier;

        undo(): HolidayModifier;

        load(locales: string | string[]): HolidayModifier;

        extendParser(parserFunc: (m: Moment, date: string) => Moment | Moment[] | false | void): HolidayModifier;
    }

    let holidays: Holidays;
    let modifyHolidays: HolidayModifier;
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 18:50:55 GMT
  • Dependencies: @types/moment
  • Global values: none

Credits

These definitions were written by Robert Winslow Dalpe.

1.5.5

6 months ago

1.5.4

6 months ago

1.5.3

7 months ago

1.5.2

8 months ago

1.5.1

3 years ago

1.5.0

7 years ago