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

3.0.0 • Public • Published

Installation

npm install --save @types/luxon-business-days

Summary

This package contains type definitions for luxon-business-days (https://github.com/amaidah/luxon-business-days#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/luxon-business-days.

import { DateTime } from "luxon";

export type BusinessDayNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7;
export type BusinessDays = BusinessDayNumbers[];

export type HolidayMatcher = (inst: DateTime<boolean>) => boolean;
export interface HolidayMatchersDict {
    [key: string]: HolidayMatcher;
}

export type HolidayHelper = (...args: any[]) => any;
export interface HolidayHelpersDict {
    [key: string]: HolidayHelper;
}

declare module "luxon" {
    interface DateTime<IsValid extends boolean> {
        businessDays?: BusinessDays;
        holidayMatchers?: HolidayMatcher[];
        availableHolidayHelpers: HolidayHelpersDict;
        availableHolidayMatchers: HolidayMatchersDict;

        setupBusiness(opts?: {
            businessDays?: BusinessDays;
            holidayMatchers?: HolidayMatcher[];
        }): void;

        clearBusinessSetup(): void;

        isHoliday(...args: any[]): boolean;

        isBusinessDay(): boolean;

        plusBusiness(opts?: { days?: number }): this;

        minusBusiness(opts?: { days?: number }): this;
    }
}

export { DateTime };

Additional Details

  • Last updated: Thu, 02 May 2024 19:35:28 GMT
  • Dependencies: @types/luxon

Credits

These definitions were written by Bradley C Bailey.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/luxon-business-days

Weekly Downloads

3,394

Version

3.0.0

License

MIT

Unpacked Size

4.88 kB

Total Files

5

Last publish

Collaborators

  • types