mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-13 12:20:12 +08:00
Add typings for version 1.5.1
This commit is contained in:
+132
-9
@@ -1,4 +1,4 @@
|
||||
// Type definitions for timezonecomplete 1.4.6
|
||||
// Type definitions for timezonecomplete 1.5.1
|
||||
// Project: https://github.com/SpiritIT/timezonecomplete
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -11,10 +11,14 @@ declare module 'timezonecomplete' {
|
||||
export import isLeapYear = basics.isLeapYear;
|
||||
export import daysInMonth = basics.daysInMonth;
|
||||
export import daysInYear = basics.daysInYear;
|
||||
export import dayOfYear = basics.dayOfYear;
|
||||
export import firstWeekDayOfMonth = basics.firstWeekDayOfMonth;
|
||||
export import lastWeekDayOfMonth = basics.lastWeekDayOfMonth;
|
||||
export import weekDayOnOrAfter = basics.weekDayOnOrAfter;
|
||||
export import weekDayOnOrBefore = basics.weekDayOnOrBefore;
|
||||
export import weekNumber = basics.weekNumber;
|
||||
export import weekOfMonth = basics.weekOfMonth;
|
||||
export import dayOfYear = basics.dayOfYear;
|
||||
export import secondOfDay = basics.secondOfDay;
|
||||
import datetime = require("__timezonecomplete/datetime");
|
||||
export import DateTime = datetime.DateTime;
|
||||
import duration = require("__timezonecomplete/duration");
|
||||
@@ -93,6 +97,16 @@ declare module '__timezonecomplete/basics' {
|
||||
* @return the last occurrence of the week day in the month
|
||||
*/
|
||||
export function lastWeekDayOfMonth(year: number, month: number, weekDay: WeekDay): number;
|
||||
/**
|
||||
* Returns the first instance of the given weekday in the given month
|
||||
*
|
||||
* @param year The year
|
||||
* @param month the month 1-12
|
||||
* @param weekDay the desired week day
|
||||
*
|
||||
* @return the first occurrence of the week day in the month
|
||||
*/
|
||||
export function firstWeekDayOfMonth(year: number, month: number, weekDay: WeekDay): number;
|
||||
/**
|
||||
* Returns the day-of-month that is on the given weekday and which is >= the given day.
|
||||
* Throws if the month has no such day.
|
||||
@@ -103,6 +117,19 @@ declare module '__timezonecomplete/basics' {
|
||||
* Throws if the month has no such day.
|
||||
*/
|
||||
export function weekDayOnOrBefore(year: number, month: number, day: number, weekDay: WeekDay): number;
|
||||
export function weekOfMonth(year: number, month: number, day: number): number;
|
||||
/**
|
||||
* The ISO 8601 week number for the given date. Week 1 is the week
|
||||
* that has January 4th in it, and it starts on Monday.
|
||||
* See https://en.wikipedia.org/wiki/ISO_week_date
|
||||
*
|
||||
* @param year Year e.g. 1988
|
||||
* @param month Month 1-12
|
||||
* @param day Day of month 1-31
|
||||
*
|
||||
* @return Week number 1-53
|
||||
*/
|
||||
export function weekNumber(year: number, month: number, day: number): number;
|
||||
/**
|
||||
* Convert a unix milli timestamp into a TimeT structure.
|
||||
* This does NOT take leap seconds into account.
|
||||
@@ -131,6 +158,10 @@ declare module '__timezonecomplete/basics' {
|
||||
* This does NOT take leap seconds into account.
|
||||
*/
|
||||
export function weekDayNoLeapSecs(unixMillis: number): WeekDay;
|
||||
/**
|
||||
* N-th second in the day, counting from 0
|
||||
*/
|
||||
export function secondOfDay(hour: number, minute: number, second: number): number;
|
||||
/**
|
||||
* Basic representation of a date and time
|
||||
*/
|
||||
@@ -332,6 +363,12 @@ declare module '__timezonecomplete/datetime' {
|
||||
* @return The time zone that the date is in. May be null for unaware dates.
|
||||
*/
|
||||
zone(): timezone.TimeZone;
|
||||
/**
|
||||
* Zone name abbreviation at this time
|
||||
* @param dstDependent (default true) set to false for a DST-agnostic abbreviation
|
||||
* @return The abbreviation
|
||||
*/
|
||||
zoneAbbreviation(dstDependent?: boolean): string;
|
||||
/**
|
||||
* @return the offset w.r.t. UTC in minutes. Returns 0 for unaware dates and for UTC dates.
|
||||
*/
|
||||
@@ -369,6 +406,36 @@ declare module '__timezonecomplete/datetime' {
|
||||
* week day numbers)
|
||||
*/
|
||||
weekDay(): basics.WeekDay;
|
||||
/**
|
||||
* Returns the day number within the year: Jan 1st has number 0,
|
||||
* Jan 2nd has number 1 etc.
|
||||
*
|
||||
* @return the day-of-year [0-366]
|
||||
*/
|
||||
dayOfYear(): number;
|
||||
/**
|
||||
* The ISO 8601 week number. Week 1 is the week
|
||||
* that has January 4th in it, and it starts on Monday.
|
||||
* See https://en.wikipedia.org/wiki/ISO_week_date
|
||||
*
|
||||
* @return Week number [1-53]
|
||||
*/
|
||||
weekNumber(): number;
|
||||
/**
|
||||
* The week of this month. There is no official standard for this,
|
||||
* but we assume the same rules for the weekNumber (i.e.
|
||||
* week 1 is the week that has the 4th day of the month in it)
|
||||
*
|
||||
* @return Week number [1-5]
|
||||
*/
|
||||
weekOfMonth(): number;
|
||||
/**
|
||||
* Returns the number of seconds that have passed on the current day
|
||||
* Does not consider leap seconds
|
||||
*
|
||||
* @return seconds [0-86399]
|
||||
*/
|
||||
secondOfDay(): number;
|
||||
/**
|
||||
* @return Milliseconds since 1970-01-01T00:00:00.000Z
|
||||
*/
|
||||
@@ -397,6 +464,13 @@ declare module '__timezonecomplete/datetime' {
|
||||
* @return The UTC seconds 0-59
|
||||
*/
|
||||
utcSecond(): number;
|
||||
/**
|
||||
* Returns the UTC day number within the year: Jan 1st has number 0,
|
||||
* Jan 2nd has number 1 etc.
|
||||
*
|
||||
* @return the day-of-year [0-366]
|
||||
*/
|
||||
utcDayOfYear(): number;
|
||||
/**
|
||||
* @return The UTC milliseconds 0-999
|
||||
*/
|
||||
@@ -406,6 +480,29 @@ declare module '__timezonecomplete/datetime' {
|
||||
* week day numbers)
|
||||
*/
|
||||
utcWeekDay(): basics.WeekDay;
|
||||
/**
|
||||
* The ISO 8601 UTC week number. Week 1 is the week
|
||||
* that has January 4th in it, and it starts on Monday.
|
||||
* See https://en.wikipedia.org/wiki/ISO_week_date
|
||||
*
|
||||
* @return Week number [1-53]
|
||||
*/
|
||||
utcWeekNumber(): number;
|
||||
/**
|
||||
* The week of this month. There is no official standard for this,
|
||||
* but we assume the same rules for the weekNumber (i.e.
|
||||
* week 1 is the week that has the 4th day of the month in it)
|
||||
*
|
||||
* @return Week number [1-5]
|
||||
*/
|
||||
utcWeekOfMonth(): number;
|
||||
/**
|
||||
* Returns the number of seconds that have passed on the current day
|
||||
* Does not consider leap seconds
|
||||
*
|
||||
* @return seconds [0-86399]
|
||||
*/
|
||||
utcSecondOfDay(): number;
|
||||
/**
|
||||
* Convert this date to the given time zone (in-place).
|
||||
* Throws if this date does not have a time zone.
|
||||
@@ -514,6 +611,7 @@ declare module '__timezonecomplete/datetime' {
|
||||
* E.g. "2014-01-01T23:15:33+01:00" for Europe/Amsterdam
|
||||
*/
|
||||
toIsoString(): string;
|
||||
format(formatString: string): string;
|
||||
/**
|
||||
* Modified ISO 8601 format string with IANA name if applicable.
|
||||
* E.g. "2014-01-01T23:15:33.000 Europe/Amsterdam"
|
||||
@@ -523,6 +621,10 @@ declare module '__timezonecomplete/datetime' {
|
||||
* Used by util.inspect()
|
||||
*/
|
||||
inspect(): string;
|
||||
/**
|
||||
* The valueOf() method returns the primitive value of the specified object.
|
||||
*/
|
||||
valueOf(): any;
|
||||
/**
|
||||
* Modified ISO 8601 format string in UTC without time zone info
|
||||
*/
|
||||
@@ -678,6 +780,10 @@ declare module '__timezonecomplete/duration' {
|
||||
* Used by util.inspect()
|
||||
*/
|
||||
inspect(): string;
|
||||
/**
|
||||
* The valueOf() method returns the primitive value of the specified object.
|
||||
*/
|
||||
valueOf(): any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -923,13 +1029,15 @@ declare module '__timezonecomplete/timezone' {
|
||||
hasDst(): boolean;
|
||||
/**
|
||||
* Calculate timezone offset from a UTC time.
|
||||
* @param year local full year
|
||||
* @param month local month 1-12 (note this deviates from JavaScript date)
|
||||
* @param day local day of month 1-31
|
||||
* @param hour local hour 0-23
|
||||
* @param minute local minute 0-59
|
||||
* @param second local second 0-59
|
||||
* @param millisecond local millisecond 0-999
|
||||
*
|
||||
* @param year Full year
|
||||
* @param month Month 1-12 (note this deviates from JavaScript date)
|
||||
* @param day Day of month 1-31
|
||||
* @param hour Hour 0-23
|
||||
* @param minute Minute 0-59
|
||||
* @param second Second 0-59
|
||||
* @param millisecond Millisecond 0-999
|
||||
*
|
||||
* @return the offset of this time zone with respect to UTC at the given time, in minutes.
|
||||
*/
|
||||
offsetForUtc(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number): number;
|
||||
@@ -965,6 +1073,21 @@ declare module '__timezonecomplete/timezone' {
|
||||
* @param funcs: the set of functions to use: get() or getUTC()
|
||||
*/
|
||||
offsetForZoneDate(date: Date, funcs: javascript.DateFunctions): number;
|
||||
/**
|
||||
* Zone abbreviation at given UTC timestamp e.g. CEST for Central European Summer Time.
|
||||
*
|
||||
* @param year Full year
|
||||
* @param month Month 1-12 (note this deviates from JavaScript date)
|
||||
* @param day Day of month 1-31
|
||||
* @param hour Hour 0-23
|
||||
* @param minute Minute 0-59
|
||||
* @param second Second 0-59
|
||||
* @param millisecond Millisecond 0-999
|
||||
* @param dstDependent (default true) set to false for a DST-agnostic abbreviation
|
||||
*
|
||||
* @return "local" for local timezone, the offset for an offset zone, or the abbreviation for a proper zone.
|
||||
*/
|
||||
abbreviationForUtc(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number, dstDependent?: boolean): string;
|
||||
/**
|
||||
* Normalizes non-existing local times by adding a forward offset change.
|
||||
* During a forward standard offset change or DST offset change, some amount of
|
||||
|
||||
Reference in New Issue
Block a user