@tsdotnet/date-time 1.0.33 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/{ClockTime.js → cjs/ClockTime.js} +64 -67
  2. package/dist/cjs/ClockTime.js.map +1 -0
  3. package/dist/{DateTime.js → cjs/DateTime.js} +219 -305
  4. package/dist/cjs/DateTime.js.map +1 -0
  5. package/dist/cjs/DateTimeKind.js +7 -0
  6. package/dist/cjs/DateTimeKind.js.map +1 -0
  7. package/dist/cjs/TimeQuantity.js +63 -0
  8. package/dist/cjs/TimeQuantity.js.map +1 -0
  9. package/dist/{TimeSpan.js → cjs/TimeSpan.js} +87 -111
  10. package/dist/cjs/TimeSpan.js.map +1 -0
  11. package/dist/{TimeStamp.js → cjs/TimeStamp.js} +41 -45
  12. package/dist/cjs/TimeStamp.js.map +1 -0
  13. package/dist/{TimeUnit.js → cjs/TimeUnit.js} +71 -99
  14. package/dist/cjs/TimeUnit.js.map +1 -0
  15. package/dist/{TimeUnitValue.js → cjs/TimeUnitValue.js} +42 -46
  16. package/dist/cjs/TimeUnitValue.js.map +1 -0
  17. package/dist/{date-time.js → cjs/date-time.js} +24 -28
  18. package/dist/cjs/date-time.js.map +1 -0
  19. package/dist/cjs/howMany.js +7 -0
  20. package/dist/cjs/howMany.js.map +1 -0
  21. package/{dist-esm → dist/esm}/ClockTime.js +68 -63
  22. package/dist/esm/ClockTime.js.map +1 -0
  23. package/{dist-esm → dist/esm}/DateTime.js +222 -302
  24. package/dist/esm/DateTime.js.map +1 -0
  25. package/dist/esm/TimeQuantity.js +64 -0
  26. package/dist/esm/TimeQuantity.js.map +1 -0
  27. package/{dist-esm → dist/esm}/TimeSpan.js +92 -107
  28. package/dist/esm/TimeSpan.js.map +1 -0
  29. package/{dist-esm → dist/esm}/TimeStamp.js +47 -41
  30. package/dist/esm/TimeStamp.js.map +1 -0
  31. package/{dist-esm → dist/esm}/TimeUnit.js +71 -97
  32. package/dist/esm/TimeUnit.js.map +1 -0
  33. package/{dist-esm → dist/esm}/TimeUnitValue.js +43 -43
  34. package/dist/esm/TimeUnitValue.js.map +1 -0
  35. package/dist/esm/date-time.js +10 -0
  36. package/dist/esm/date-time.js.map +1 -0
  37. package/dist/esm/howMany.js +5 -0
  38. package/dist/esm/howMany.js.map +1 -0
  39. package/dist/{CalendarDate.d.ts → types/CalendarDate.d.ts} +1 -0
  40. package/dist/{ClockTime.d.ts → types/ClockTime.d.ts} +20 -20
  41. package/dist/{ClockTimeValue.d.ts → types/ClockTimeValue.d.ts} +1 -0
  42. package/dist/types/DateTime.d.ts +60 -0
  43. package/dist/{DateTimeKind.d.ts → types/DateTimeKind.d.ts} +10 -15
  44. package/dist/{JsDateConvertible.d.ts → types/JsDateConvertible.d.ts} +1 -0
  45. package/dist/{TimeMeasurement.d.ts → types/TimeMeasurement.d.ts} +1 -0
  46. package/dist/types/TimeQuantity.d.ts +19 -0
  47. package/dist/{TimeSpan.d.ts → types/TimeSpan.d.ts} +33 -73
  48. package/dist/{TimeStamp.d.ts → types/TimeStamp.d.ts} +22 -25
  49. package/dist/{TimeStampValue.d.ts → types/TimeStampValue.d.ts} +1 -0
  50. package/dist/types/TimeUnit.d.ts +21 -0
  51. package/dist/{TimeUnitValue.d.ts → types/TimeUnitValue.d.ts} +16 -19
  52. package/{dist-esm/date-time.js → dist/types/date-time.d.ts} +21 -16
  53. package/dist/{howMany.d.ts → types/howMany.d.ts} +39 -39
  54. package/eslint.config.mjs +25 -0
  55. package/package.json +48 -42
  56. package/rollup.config.js +37 -0
  57. package/dist/ClockTime.js.map +0 -1
  58. package/dist/DateTime.d.ts +0 -154
  59. package/dist/DateTime.js.map +0 -1
  60. package/dist/TimeQuantity.d.ts +0 -50
  61. package/dist/TimeQuantity.js +0 -96
  62. package/dist/TimeQuantity.js.map +0 -1
  63. package/dist/TimeSpan.js.map +0 -1
  64. package/dist/TimeStamp.js.map +0 -1
  65. package/dist/TimeUnit.d.ts +0 -47
  66. package/dist/TimeUnit.js.map +0 -1
  67. package/dist/TimeUnitValue.js.map +0 -1
  68. package/dist/date-time.d.ts +0 -20
  69. package/dist/date-time.js.map +0 -1
  70. package/dist/howMany.js +0 -53
  71. package/dist/howMany.js.map +0 -1
  72. package/dist-esm/ClockTime.js.map +0 -1
  73. package/dist-esm/DateTime.js.map +0 -1
  74. package/dist-esm/TimeQuantity.js +0 -92
  75. package/dist-esm/TimeQuantity.js.map +0 -1
  76. package/dist-esm/TimeSpan.js.map +0 -1
  77. package/dist-esm/TimeStamp.js.map +0 -1
  78. package/dist-esm/TimeUnit.js.map +0 -1
  79. package/dist-esm/TimeUnitValue.js.map +0 -1
  80. package/dist-esm/date-time.js.map +0 -1
  81. package/dist-esm/howMany.js +0 -50
  82. package/dist-esm/howMany.js.map +0 -1
  83. /package/dist/{Calendars → types/Calendars}/Gregorian.d.ts +0 -0
@@ -1,20 +1,20 @@
1
- /*!
2
- * @author electricessence / https://github.com/electricessence/
3
- * @license MIT
4
- */
5
- import ClockTimeValue from './ClockTimeValue';
6
- import TimeQuantity from './TimeQuantity';
7
- export declare class ClockTime extends TimeQuantity implements Required<ClockTimeValue> {
8
- readonly day: number;
9
- readonly hour: number;
10
- readonly minute: number;
11
- readonly second: number;
12
- readonly millisecond: number;
13
- readonly tick: number;
14
- constructor(milliseconds: number);
15
- constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number);
16
- static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime;
17
- static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number;
18
- toString(): string;
19
- }
20
- export default ClockTime;
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * @license MIT
4
+ */
5
+ import type ClockTimeValue from './ClockTimeValue';
6
+ import TimeQuantity from './TimeQuantity';
7
+ export declare class ClockTime extends TimeQuantity implements Required<ClockTimeValue> {
8
+ readonly day: number;
9
+ readonly hour: number;
10
+ readonly minute: number;
11
+ readonly second: number;
12
+ readonly millisecond: number;
13
+ readonly tick: number;
14
+ constructor(milliseconds: number);
15
+ constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number);
16
+ static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime;
17
+ static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number;
18
+ toString(): string;
19
+ }
20
+ export default ClockTime;
@@ -11,4 +11,5 @@ export default interface ClockTimeValue
11
11
  second?: number;
12
12
  millisecond?: number;
13
13
  tick?: number;
14
+ // eslint-disable-next-line semi
14
15
  }
@@ -0,0 +1,60 @@
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * Based on .NET DateTime's interface.
4
+ * @license MIT
5
+ */
6
+ import CalendarDate from './CalendarDate';
7
+ import Gregorian from './Calendars/Gregorian';
8
+ import ClockTime from './ClockTime';
9
+ import DateTimeKind from './DateTimeKind';
10
+ import type JsDateConvertible from './JsDateConvertible';
11
+ import TimeQuantity from './TimeQuantity';
12
+ import TimeSpan from './TimeSpan';
13
+ import TimeStamp from './TimeStamp';
14
+ export default class DateTime implements CalendarDate, JsDateConvertible {
15
+ private readonly _value;
16
+ private readonly _kind;
17
+ private _time;
18
+ constructor();
19
+ constructor(dateString: string, kind?: DateTimeKind);
20
+ constructor(milliseconds: number, kind?: DateTimeKind);
21
+ constructor(source: Date, kind?: DateTimeKind);
22
+ constructor(source: DateTime, kind?: DateTimeKind);
23
+ static get now(): DateTime;
24
+ static get today(): DateTime;
25
+ static get tomorrow(): DateTime;
26
+ get kind(): DateTimeKind;
27
+ get year(): number;
28
+ get month(): Gregorian.Month;
29
+ get calendarMonth(): number;
30
+ get calendar(): CalendarDate;
31
+ get day(): number;
32
+ get dayIndex(): number;
33
+ get dayOfWeek(): Gregorian.DayOfWeek;
34
+ get date(): DateTime;
35
+ get timeOfDay(): ClockTime;
36
+ static between(first: Date | DateTime, last: Date | DateTime): TimeSpan;
37
+ static isLeapYear(year: number): boolean;
38
+ static daysInMonth(year: number, month: Gregorian.Month): number;
39
+ static from(calendarDate: CalendarDate): DateTime;
40
+ static from(year: number, month: Gregorian.Month, day: number): DateTime;
41
+ static fromCalendarDate(calendarDate: CalendarDate): DateTime;
42
+ static fromCalendarDate(year: number, month: number, day: number): DateTime;
43
+ toJsDate(): Date;
44
+ addMilliseconds(ms: number): DateTime;
45
+ addSeconds(seconds: number): DateTime;
46
+ addMinutes(minutes: number): DateTime;
47
+ addHours(hours: number): DateTime;
48
+ addDays(days: number): DateTime;
49
+ addMonths(months: number): DateTime;
50
+ addYears(years: number): DateTime;
51
+ add(time: TimeQuantity): DateTime;
52
+ subtract(time: TimeQuantity): DateTime;
53
+ timePassedSince(previous: Date | DateTime): TimeSpan;
54
+ toTimeStamp(): TimeStamp;
55
+ toUniversalTime(): DateTime;
56
+ equals(other: Date): boolean;
57
+ equals(other: JsDateConvertible, strict?: boolean): boolean;
58
+ compareTo(other: Date | JsDateConvertible): number;
59
+ equivalent(other: Date | JsDateConvertible): boolean;
60
+ }
@@ -1,15 +1,10 @@
1
- /*!
2
- * @author electricessence / https://github.com/electricessence/
3
- * @license MIT
4
- */
5
-
6
-
7
-
8
- declare const enum DateTimeKind
9
- {
10
- Unspecified,
11
- Local,
12
- Utc,
13
- }
14
-
15
- export default DateTimeKind;
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * @license MIT
4
+ */
5
+ declare const enum DateTimeKind {
6
+ Unspecified = 0,
7
+ Local = 1,
8
+ Utc = 2
9
+ }
10
+ export default DateTimeKind;
@@ -7,4 +7,5 @@
7
7
  export default interface JsDateConvertible
8
8
  {
9
9
  toJsDate (): Date;
10
+ // eslint-disable-next-line semi
10
11
  }
@@ -12,4 +12,5 @@ export default interface TimeMeasurement
12
12
  minutes: number;
13
13
  hours: number;
14
14
  days: number;
15
+ // eslint-disable-next-line semi
15
16
  }
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * @license MIT
4
+ */
5
+ import { ResettableLazy } from '@tsdotnet/lazy';
6
+ import type TimeMeasurement from './TimeMeasurement';
7
+ import TimeUnit from './TimeUnit';
8
+ export default class TimeQuantity {
9
+ protected _quantity: number;
10
+ constructor(_quantity?: number);
11
+ static getTotalMillisecondsFrom(values: Partial<TimeMeasurement>): number;
12
+ get direction(): number;
13
+ protected _total: ResettableLazy<Readonly<TimeMeasurement>>;
14
+ get total(): Readonly<TimeMeasurement>;
15
+ getTotalMilliseconds(): number;
16
+ equals(other: TimeQuantity): boolean;
17
+ compareTo(other: TimeQuantity): number;
18
+ getTotal(units: TimeUnit.UnitType): number;
19
+ }
@@ -1,73 +1,33 @@
1
- /*!
2
- * @author electricessence / https://github.com/electricessence/
3
- * Originally based upon .NET source but with many additions and improvements.
4
- * @license MIT
5
- */
6
- import ClockTime from './ClockTime';
7
- import TimeMeasurement from './TimeMeasurement';
8
- import TimeQuantity from './TimeQuantity';
9
- import TimeUnit from './TimeUnit';
10
- /**
11
- * TimeSpan expands on TimeQuantity to provide an class that is similar to .NET's TimeSpan including many useful static methods.
12
- */
13
- export declare class TimeSpan extends TimeQuantity implements TimeMeasurement {
14
- /**
15
- * The total number of ticks that represent this amount of time.
16
- */
17
- readonly ticks: number;
18
- /**
19
- * The total number of ticks that milliseconds this amount of time.
20
- */
21
- readonly milliseconds: number;
22
- /**
23
- * The total number of ticks that seconds this amount of time.
24
- */
25
- readonly seconds: number;
26
- /**
27
- * The total number of ticks that minutes this amount of time.
28
- */
29
- readonly minutes: number;
30
- /**
31
- * The total number of ticks that hours this amount of time.
32
- */
33
- readonly hours: number;
34
- /**
35
- * The total number of ticks that days this amount of time.
36
- */
37
- readonly days: number;
38
- protected constructor(value: number, units?: TimeUnit.UnitType);
39
- static get zero(): TimeSpan;
40
- /**
41
- * Provides an standard interface for acquiring the total time.
42
- * @returns {TimeSpan}
43
- */
44
- get total(): TimeSpan;
45
- private _time;
46
- /**
47
- * The value of this TimeSpan reduced to the clock and calendar.
48
- * @return {ClockTime}
49
- */
50
- get time(): ClockTime;
51
- static from(values: Partial<TimeMeasurement>): TimeSpan;
52
- static from(value: number, units: TimeUnit.UnitType): TimeSpan;
53
- static fromDays(value: number): TimeSpan;
54
- static fromHours(value: number): TimeSpan;
55
- static fromMinutes(value: number): TimeSpan;
56
- static fromSeconds(value: number): TimeSpan;
57
- static fromMilliseconds(value: number): TimeSpan;
58
- static fromTicks(value: number): TimeSpan;
59
- /**
60
- * Sum the value of this TimeSpan with another time quantity.
61
- * @param {TimeQuantity | Partial<TimeMeasurement>} other
62
- * @return {TimeSpan}
63
- */
64
- add(other: TimeSpan | TimeQuantity | Partial<TimeMeasurement>): TimeSpan;
65
- /**
66
- * Sum the value of this TimeSpan with another unit value.
67
- * @param {number} value
68
- * @param {TimeUnit.UnitType} units
69
- * @return {TimeSpan}
70
- */
71
- addUnit(value: number, units?: TimeUnit.UnitType): TimeSpan;
72
- }
73
- export default TimeSpan;
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * Originally based upon .NET source but with many additions and improvements.
4
+ * @license MIT
5
+ */
6
+ import ClockTime from './ClockTime';
7
+ import TimeMeasurement from './TimeMeasurement';
8
+ import TimeQuantity from './TimeQuantity';
9
+ import TimeUnit from './TimeUnit';
10
+ export declare class TimeSpan extends TimeQuantity implements TimeMeasurement {
11
+ readonly ticks: number;
12
+ readonly milliseconds: number;
13
+ readonly seconds: number;
14
+ readonly minutes: number;
15
+ readonly hours: number;
16
+ readonly days: number;
17
+ protected constructor(value: number, units?: TimeUnit.UnitType);
18
+ static get zero(): TimeSpan;
19
+ get total(): TimeSpan;
20
+ private _time;
21
+ get time(): ClockTime;
22
+ static from(values: Partial<TimeMeasurement>): TimeSpan;
23
+ static from(value: number, units: TimeUnit.UnitType): TimeSpan;
24
+ static fromDays(value: number): TimeSpan;
25
+ static fromHours(value: number): TimeSpan;
26
+ static fromMinutes(value: number): TimeSpan;
27
+ static fromSeconds(value: number): TimeSpan;
28
+ static fromMilliseconds(value: number): TimeSpan;
29
+ static fromTicks(value: number): TimeSpan;
30
+ add(other: TimeSpan | TimeQuantity | Partial<TimeMeasurement>): TimeSpan;
31
+ addUnit(value: number, units?: TimeUnit.UnitType): TimeSpan;
32
+ }
33
+ export default TimeSpan;
@@ -1,25 +1,22 @@
1
- /*!
2
- * @author electricessence / https://github.com/electricessence/
3
- * @license MIT
4
- */
5
- import Gregorian from './Calendars/Gregorian';
6
- import JsDateConvertible from './JsDateConvertible';
7
- import TimeStampValue from './TimeStampValue';
8
- /**
9
- * An alternative to Date or DateTime. Is a model representing the exact date and time.
10
- */
11
- export declare class TimeStamp implements Required<TimeStampValue>, JsDateConvertible {
12
- readonly year: number;
13
- readonly month: Gregorian.Month;
14
- readonly day: number;
15
- readonly hour: number;
16
- readonly minute: number;
17
- readonly second: number;
18
- readonly millisecond: number;
19
- readonly tick: number;
20
- constructor(year: number, month: Gregorian.Month, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, tick?: number);
21
- static from(d: Date | JsDateConvertible): TimeStamp;
22
- static now(): TimeStamp;
23
- toJsDate(): Date;
24
- }
25
- export default TimeStamp;
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * @license MIT
4
+ */
5
+ import Gregorian from './Calendars/Gregorian';
6
+ import JsDateConvertible from './JsDateConvertible';
7
+ import TimeStampValue from './TimeStampValue';
8
+ export declare class TimeStamp implements Required<TimeStampValue>, JsDateConvertible {
9
+ readonly year: number;
10
+ readonly month: Gregorian.Month;
11
+ readonly day: number;
12
+ readonly hour: number;
13
+ readonly minute: number;
14
+ readonly second: number;
15
+ readonly millisecond: number;
16
+ readonly tick: number;
17
+ constructor(year: number, month: Gregorian.Month, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, tick?: number);
18
+ static from(d: Date | JsDateConvertible): TimeStamp;
19
+ static now(): TimeStamp;
20
+ toJsDate(): Date;
21
+ }
22
+ export default TimeStamp;
@@ -10,4 +10,5 @@ export default interface TimeStampValue
10
10
  extends CalendarDate, Partial<ClockTimeValue>
11
11
  {
12
12
 
13
+ // eslint-disable-next-line semi
13
14
  }
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * Originally based upon .NET source but with many additions and improvements.
4
+ * @license MIT
5
+ */
6
+ import TimeQuantity from './TimeQuantity';
7
+ export declare namespace TimeUnit {
8
+ enum UnitType {
9
+ Ticks = 0,
10
+ Milliseconds = 1,
11
+ Seconds = 2,
12
+ Minutes = 3,
13
+ Hours = 4,
14
+ Days = 5
15
+ }
16
+ function toMilliseconds(value: number, units: UnitType): number;
17
+ function fromMilliseconds(ms: number, units: UnitType): number;
18
+ function from(quantity: TimeQuantity, toUnits: UnitType): number;
19
+ function assertValid(unit: UnitType): true | never;
20
+ }
21
+ export default TimeUnit;
@@ -1,19 +1,16 @@
1
- /*!
2
- * @author electricessence / https://github.com/electricessence/
3
- * @license MIT
4
- */
5
- import TimeQuantity from './TimeQuantity';
6
- import TimeUnit from './TimeUnit';
7
- /**
8
- * TimeUnitValue allows for passing around a reference to a mutable measure of time coerced by its unit type.
9
- */
10
- export default class TimeUnitValue extends TimeQuantity {
11
- private _units;
12
- constructor(value: number | TimeQuantity, _units: TimeUnit.UnitType);
13
- get value(): number;
14
- set value(v: number);
15
- get units(): TimeUnit.UnitType;
16
- static from(value: number | TimeQuantity, units?: TimeUnit.UnitType): TimeUnitValue;
17
- getTotalMilliseconds(): number;
18
- to(units?: TimeUnit.UnitType): TimeUnitValue;
19
- }
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * @license MIT
4
+ */
5
+ import TimeQuantity from './TimeQuantity';
6
+ import TimeUnit from './TimeUnit';
7
+ export default class TimeUnitValue extends TimeQuantity {
8
+ private _units;
9
+ constructor(value: number | TimeQuantity, _units: TimeUnit.UnitType);
10
+ get value(): number;
11
+ set value(v: number);
12
+ get units(): TimeUnit.UnitType;
13
+ static from(value: number | TimeQuantity, units?: TimeUnit.UnitType): TimeUnitValue;
14
+ getTotalMilliseconds(): number;
15
+ to(units?: TimeUnit.UnitType): TimeUnitValue;
16
+ }
@@ -1,16 +1,21 @@
1
- /*!
2
- * @author electricessence / https://github.com/electricessence/
3
- * @license MIT
4
- */
5
- import Gregorian from './Calendars/Gregorian';
6
- import ClockTime from './ClockTime';
7
- import DateTime from './DateTime';
8
- import DateTimeKind from './DateTimeKind';
9
- import * as howMany from './howMany';
10
- import TimeQuantity from './TimeQuantity';
11
- import TimeSpan from './TimeSpan';
12
- import TimeStamp from './TimeStamp';
13
- import TimeUnit from './TimeUnit';
14
- import TimeUnitValue from './TimeUnitValue';
15
- export { Gregorian, ClockTime, DateTime, DateTimeKind, howMany, TimeQuantity, TimeSpan, TimeStamp, TimeUnit, TimeUnitValue };
16
- //# sourceMappingURL=date-time.js.map
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * @license MIT
4
+ */
5
+ import Gregorian from './Calendars/Gregorian';
6
+ import type CalendarDate from './CalendarDate';
7
+ import ClockTime from './ClockTime';
8
+ import type ClockTimeValue from './ClockTimeValue';
9
+ import DateTime from './DateTime';
10
+ import DateTimeKind from './DateTimeKind';
11
+ import * as howMany from './howMany';
12
+ import type TimeMeasurement from './TimeMeasurement';
13
+ import TimeQuantity from './TimeQuantity';
14
+ import TimeSpan from './TimeSpan';
15
+ import TimeStamp from './TimeStamp';
16
+ import type TimeStampValue from './TimeStampValue';
17
+ import TimeUnit from './TimeUnit';
18
+ import TimeUnitValue from './TimeUnitValue';
19
+ import type JsDateConvertible from './JsDateConvertible';
20
+ export { Gregorian, ClockTime, DateTime, DateTimeKind, howMany, TimeQuantity, TimeSpan, TimeStamp, TimeUnit, TimeUnitValue };
21
+ export type { CalendarDate, ClockTimeValue, TimeMeasurement, TimeStampValue, JsDateConvertible };
@@ -1,39 +1,39 @@
1
- /*!
2
- * @author electricessence / https://github.com/electricessence/
3
- * @license MIT
4
- */
5
- export declare namespace hours {
6
- const enum per {
7
- day = 24
8
- }
9
- }
10
- export declare namespace minutes {
11
- const enum per {
12
- hour = 60,
13
- day = 1440
14
- }
15
- }
16
- export declare namespace seconds {
17
- const enum per {
18
- minute = 60,
19
- hour = 3600,
20
- day = 86400
21
- }
22
- }
23
- export declare namespace milliseconds {
24
- const enum per {
25
- second = 1000,
26
- minute = 60000,
27
- hour = 3600000,
28
- day = 86400000
29
- }
30
- }
31
- export declare namespace ticks {
32
- const enum per {
33
- millisecond = 10000,
34
- second = 10000000,
35
- minute = 600000000,
36
- hour = 36000000000,
37
- day = 864000000000
38
- }
39
- }
1
+ /*!
2
+ * @author electricessence / https://github.com/electricessence/
3
+ * @license MIT
4
+ */
5
+ export declare namespace hours {
6
+ const enum per {
7
+ day = 24
8
+ }
9
+ }
10
+ export declare namespace minutes {
11
+ const enum per {
12
+ hour = 60,
13
+ day = 1440
14
+ }
15
+ }
16
+ export declare namespace seconds {
17
+ const enum per {
18
+ minute = 60,
19
+ hour = 3600,
20
+ day = 86400
21
+ }
22
+ }
23
+ export declare namespace milliseconds {
24
+ const enum per {
25
+ second = 1000,
26
+ minute = 60000,
27
+ hour = 3600000,
28
+ day = 86400000
29
+ }
30
+ }
31
+ export declare namespace ticks {
32
+ const enum per {
33
+ millisecond = 10000,
34
+ second = 10000000,
35
+ minute = 600000000,
36
+ hour = 36000000000,
37
+ day = 864000000000
38
+ }
39
+ }
@@ -0,0 +1,25 @@
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+
4
+ export default tseslint.config(
5
+ eslint.configs.recommended,
6
+ ...tseslint.configs.recommended,
7
+ {
8
+ rules: {
9
+ "semi": ["warn", "always"],
10
+ "indent": ["warn", "tab", { "SwitchCase": 1 }],
11
+ "@typescript-eslint/no-explicit-any": "off",
12
+ "@typescript-eslint/no-namespace": "off",
13
+ "@typescript-eslint/no-this-alias": "off"
14
+ },
15
+ files: ['src/**/*.ts'],
16
+ languageOptions: {
17
+ ecmaVersion: 2022,
18
+ sourceType: 'module',
19
+ globals: {
20
+ console: 'readonly',
21
+ process: 'readonly'
22
+ }
23
+ }
24
+ }
25
+ );