Socket
Socket
Sign inDemoInstall

@types/moment-holiday

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/moment-holiday

TypeScript definitions for moment-holiday


Version published
Weekly downloads
628
decreased by-40.92%
Maintainers
1
Install size
4.16 MB
Created
Weekly downloads
 

Readme

Source

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

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;

        // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
        extendParser(parserFunc: (m: Moment, date: string) => Moment | Moment[] | false | void): HolidayModifier;
    }

    let holidays: Holidays;
    let modifyHolidays: HolidayModifier;
}

Additional Details

  • Last updated: Wed, 22 Nov 2023 00:24:48 GMT
  • Dependencies: moment

Credits

These definitions were written by Robert Winslow Dalpe.

FAQs

Last updated on 22 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc