UNPKG

warscript

Version:

A typescript library for Warcraft III using Warpack.

147 lines (146 loc) 5.41 kB
/** @noSelfInFile */ import { BinaryReader } from "../binaryreader"; import { BinaryWriter } from "../binarywriter"; /** * A month-of-year, such as 'July'. * <p> * {@code Month} is a class representing the 12 months of the year - * January, February, March, April, May, June, July, August, September, October, * November and December. * <p> * This class represents a common concept that is found in many calendar systems. * As such, this class may be used by any calendar system that has the month-of-year * concept defined exactly equivalent to the ISO-8601 calendar system. */ export declare class Month { readonly value: number; /** * The singleton instance for the month of January with 31 days. * This has the numeric value of {@code 1}. */ static readonly JANUARY: Month; /** * The singleton instance for the month of February with 28 days, or 29 in a leap year. * This has the numeric value of {@code 2}. */ static readonly FEBRUARY: Month; /** * The singleton instance for the month of March with 31 days. * This has the numeric value of {@code 3}. */ static readonly MARCH: Month; /** * The singleton instance for the month of April with 30 days. * This has the numeric value of {@code 4}. */ static readonly APRIL: Month; /** * The singleton instance for the month of May with 31 days. * This has the numeric value of {@code 5}. */ static readonly MAY: Month; /** * The singleton instance for the month of June with 30 days. * This has the numeric value of {@code 6}. */ static readonly JUNE: Month; /** * The singleton instance for the month of July with 31 days. * This has the numeric value of {@code 7}. */ static readonly JULY: Month; /** * The singleton instance for the month of August with 31 days. * This has the numeric value of {@code 8}. */ static readonly AUGUST: Month; /** * The singleton instance for the month of September with 30 days. * This has the numeric value of {@code 9}. */ static readonly SEPTEMBER: Month; /** * The singleton instance for the month of October with 31 days. * This has the numeric value of {@code 10}. */ static readonly OCTOBER: Month; /** * The singleton instance for the month of November with 30 days. * This has the numeric value of {@code 11}. */ static readonly NOVEMBER: Month; /** * The singleton instance for the month of December with 31 days. * This has the numeric value of {@code 12}. */ static readonly DECEMBER: Month; private constructor(); /** * Obtains an instance of {@code Month} from an {@code int} value. * <p> * {@code Month} is a class representing the 12 months of the year. * This factory allows the class to be obtained from the {@code int} value. * The {@code int} value follows the ISO-8601 standard, from 1 (January) to 12 (December). * * @param month the month-of-year to represent, from 1 (January) to 12 (December) * @return the month-of-year */ static of(month: number): Month; static deserialize(reader: BinaryReader): Month; serialize(writer: BinaryWriter): void; /** * Returns the month-of-year that is the specified number of months after this one. * <p> * The calculation rolls around the end of the year from December to January. * The specified period may be negative. * <p> * This instance is immutable and unaffected by this method call. * * @param months the months to add, positive or negative * @return the resulting month */ plus(months: number): Month; /** * Returns the month-of-year that is the specified number of months before this one. * <p> * The calculation rolls around the start of the year from January to December. * The specified period may be negative. * <p> * This instance is immutable and unaffected by this method call. * * @param months the months to subtract, positive or negative * @return the resulting month */ minus(months: number): Month; /** * Gets the length of this month in days. * <p> * This takes a flag to determine whether to return the length for a leap year or not. * <p> * February has 28 days in a standard year and 29 days in a leap year. * April, June, September and November have 30 days. * All other months have 31 days. * * @param leapYear true if the length is required for a leap year * @return the length of this month in days, from 28 to 31 */ getLength(leapYear: boolean): number; /** * Gets the day-of-year corresponding to the first day of this month. * <p> * This returns the day-of-year that this month begins on, using the leap * year flag to determine the length of February. * * @param leapYear true if the length is required for a leap year * @return the day of year corresponding to the first day of this month, from 1 to 336 */ getFirstDayOfYear(leapYear: boolean): number; /** * Outputs this month as a {@code string}. * * @return a string representation of this month */ toString(): string; private __lt; private __le; }