mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #14605 from syamatoo/master
Add definitions for japanese-holidays
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for japanese-holidays 1.0
|
||||
// Project: https://github.com/osamutake/japanese-holidays-js
|
||||
// Definitions by: syamatoo <https://github.com/syamatoo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function isHoliday(date: Date, furikae?: boolean): string | undefined;
|
||||
export function isHolidayAt(date: Date, furikae?: boolean): string | undefined;
|
||||
export function getHolidaysOf(year: number, furikae?: boolean): Holiday[];
|
||||
|
||||
export interface Holiday {
|
||||
month: number;
|
||||
date: number;
|
||||
name: string;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import {isHoliday, isHolidayAt, getHolidaysOf} from 'japanese-holidays'
|
||||
|
||||
const date = new Date(2017, 0, 9)
|
||||
const h: string | undefined = isHoliday(date)
|
||||
if (h != undefined) {
|
||||
h.charAt(0)
|
||||
}
|
||||
|
||||
const noFurikae: string | undefined = isHoliday(date, false)
|
||||
|
||||
const hAt = isHolidayAt(date)
|
||||
if (hAt != undefined) {
|
||||
hAt.charAt(0)
|
||||
}
|
||||
|
||||
isHolidayAt(date, false)
|
||||
|
||||
const holidays = getHolidaysOf(2017)
|
||||
const first = holidays[0]
|
||||
const n: string = first.name
|
||||
const m: number = first.month
|
||||
const d: number = first.date
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"japanese-holidays-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user