warscript
Version:
A typescript library for Warcraft III using Warpack.
134 lines (133 loc) • 4.47 kB
TypeScript
/** @noSelfInFile */
import { BinaryReader } from "../binaryreader";
import { BinaryWriter } from "../binarywriter";
import { DayOfWeek } from "./dayOfWeek";
import { Month } from "./month";
import { LocalDate } from "./localDate";
import { LocalTime } from "./localTime";
export declare class LocalDateTime {
private readonly date;
private readonly time;
private readonly key;
private constructor();
static now(this: void): LocalDateTime;
/**
* Obtains an instance of {@code LocalDateTime} from year, month,
* day, hour, minute and second.
* <p>
* This returns a {@code LocalDateTime} with the specified year, month,
* day-of-month, hour and minute.
* The day must be valid for the year and month, otherwise an exception will be thrown.
*
* @param year the year to represent, from MIN_YEAR to MAX_YEAR
* @param month the month-of-year to represent
* @param dayOfMonth the day-of-month to represent, from 1 to 31
* @param hour the hour-of-day to represent, from 0 to 23
* @param minute the minute-of-hour to represent, from 0 to 59
* @param second the second-of-minute to represent, from 0 to 59
* @return the local date-time
*/
static of(year: number, month: number | Month, dayOfMonth: number, hour: number, minute: number, second?: number): LocalDateTime;
/**
* Obtains an instance of {@code LocalDateTime} using seconds from the
* epoch of 1970-01-01T00:00:00Z.
*
* @param epochSecond the number of seconds from the epoch of 1970-01-01T00:00:00Z
* @return the local date-time
*/
static ofEpochSecond(epochSecond: number): LocalDateTime;
static deserialize(reader: BinaryReader): LocalDateTime;
serialize(writer: BinaryWriter): void;
/**
* Gets the {@code LocalDate} part of this date-time.
* <p>
* This returns a {@code LocalDate} with the same year, month and day
* as this date-time.
*
* @return the date part of this date-time
*/
toLocalDate(): LocalDate;
/**
* Gets the year field.
* <p>
* This method returns the primitive {@code number} value for the year.
*
* @return the year, from MIN_YEAR to MAX_YEAR
*/
get year(): number;
/**
* Gets the month-of-year field using the {@code Month} enum.
* <p>
* This method returns the class {@link Month} for the month.
*
* @return the month-of-year
*/
get month(): Month;
/**
* Gets the day-of-month field.
* <p>
* This method returns the primitive {@code number} value for the day-of-month.
*
* @return the day-of-month, from 1 to 31
*/
get dayOfMonth(): number;
/**
* Gets the day-of-year field.
* <p>
* This method returns the primitive {@code number} value for the day-of-year.
*
* @return the day-of-year, from 1 to 365, or 366 in a leap year
*/
get dayOfYear(): number;
/**
* Gets the day-of-week field, which is a class {@code DayOfWeek}.
* <p>
* This method returns the class {@link DayOfWeek} for the day-of-week.
*
* @return the day-of-week
*/
get dayOfWeek(): DayOfWeek;
/**
* Gets the {@code LocalTime} part of this date-time.
* <p>
* This returns a {@code LocalTime} with the same hour, minute, second and
* nanosecond as this date-time.
*
* @return the time part of this date-time
*/
toLocalTime(): LocalTime;
/**
* Gets the hour-of-day field.
*
* @return the hour-of-day, from 0 to 23
*/
get hour(): number;
/**
* Gets the minute-of-hour field.
*
* @return the minute-of-hour, from 0 to 59
*/
get minute(): number;
/**
* Gets the second-of-minute field.
*
* @return the second-of-minute, from 0 to 59
*/
get second(): number;
/**
* Outputs this date-time as a {@code String}, such as {@code 2007-12-03T10:15:30}.
* <p>
* The output will be one of the following ISO-8601 formats:
* <ul>
* <li>{@code uuuu-MM-dd'T'HH:mm}</li>
* <li>{@code uuuu-MM-dd'T'HH:mm:ss}</li>
* </ul>
* The format used will be the shortest that outputs the full value of
* the time where the omitted parts are implied to be zero.
*
* @return a string representation of this date-time
*/
toString(): string;
private __lt;
private __le;
}