@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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.03,394ts5.7
3.0.03,394ts5.6
3.0.03,394ts5.5
3.0.03,394ts5.4
3.0.03,394ts5.3
3.0.03,394ts5.2
3.0.03,394ts5.1
3.0.03,394ts5.0
3.0.03,394ts4.9
3.0.03,394latest
3.0.03,394ts5.8

Version History

VersionDownloads (Last 7 Days)Published
3.0.03,394

Package Sidebar

Install

npm i @types/luxon-business-days

Weekly Downloads

2,683

Version

3.0.0

License

MIT

Unpacked Size

4.88 kB

Total Files

5

Last publish

Collaborators

  • types