warscript
Version:
A typescript library for Warcraft III using Warpack.
88 lines (87 loc) • 2.7 kB
TypeScript
/** @noSelfInFile */
import { BinaryReader } from "../binaryreader";
import { BinaryWriter } from "../binarywriter";
export declare class LocalTime {
readonly hour: number;
readonly minute: number;
readonly second: number;
private readonly key;
/**
* The minimum supported {@code LocalTime}, '00:00'.
* This is the time of midnight at the start of the day.
*/
static readonly MIN: LocalTime;
/**
* The maximum supported {@code LocalTime}, '23:59:59'.
* This is the time just before midnight at the end of the day.
*/
static readonly MAX: LocalTime;
/**
* The time of midnight at the start of the day, '00:00'.
*/
static readonly MIDNIGHT: LocalTime;
/**
* The time of noon in the middle of the day, '12:00'.
*/
static readonly NOON: LocalTime;
/**
* Hours per day.
*/
static readonly HOURS_PER_DAY = 24;
/**
* Minutes per hour.
*/
static readonly MINUTES_PER_HOUR = 60;
/**
* Minutes per day.
*/
static readonly MINUTES_PER_DAY: number;
/**
* Seconds per minute.
*/
static readonly SECONDS_PER_MINUTE = 60;
/**
* Seconds per hour.
*/
static readonly SECONDS_PER_HOUR: number;
/**
* Seconds per day.
*/
static readonly SECONDS_PER_DAY: number;
private constructor();
/**
* Obtains the current time from the system clock in the default time-zone.
*
* @return the current time using the system clock and default time-zone
*/
static now(): LocalTime;
/**
* Obtains an instance of {@code LocalTime} from an hour, minute and second.
* <p>
* This returns a {@code LocalTime} with the specified hour, minute and second.
*
* @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 time
*/
static of(hour: number, minute: number, second?: number): LocalTime;
static deserialize(reader: BinaryReader): LocalTime;
serialize(writer: BinaryWriter): void;
/**
* Outputs this time as a {@code String}, such as {@code 10:15}.
* <p>
* The output will be one of the following ISO-8601 formats:
* <ul>
* <li>{@code HH:mm}</li>
* <li>{@code 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 time
*/
toString(): string;
private __lt;
private __le;
}