warframe-worldstate-parser 2.32.0 → 3.0.0

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 (98) hide show
  1. package/README.md +1 -0
  2. package/lib/WorldState.js +60 -94
  3. package/lib/models/Alert.js +18 -44
  4. package/lib/models/CambionCycle.js +8 -12
  5. package/lib/models/CetusCycle.js +34 -54
  6. package/lib/models/ChallengeInstance.js +11 -14
  7. package/lib/models/ConclaveChallenge.js +24 -44
  8. package/lib/models/ConstructionProgress.js +10 -22
  9. package/lib/models/DailyDeal.js +15 -34
  10. package/lib/models/DarkSector.js +14 -25
  11. package/lib/models/DarkSectorBattle.js +6 -8
  12. package/lib/models/DuviriCycle.js +9 -10
  13. package/lib/models/EarthCycle.js +36 -35
  14. package/lib/models/Fissure.js +36 -44
  15. package/lib/models/FlashSale.js +17 -37
  16. package/lib/models/GlobalUpgrade.js +23 -41
  17. package/lib/models/Invasion.js +37 -79
  18. package/lib/models/Kuva.js +20 -26
  19. package/lib/models/Mission.js +28 -38
  20. package/lib/models/News.js +34 -54
  21. package/lib/models/Nightwave.js +22 -48
  22. package/lib/models/NightwaveChallenge.js +15 -19
  23. package/lib/models/PersistentEnemy.js +21 -30
  24. package/lib/models/Reward.js +18 -20
  25. package/lib/models/SentientOutpost.js +11 -12
  26. package/lib/models/Simaris.js +9 -21
  27. package/lib/models/Sortie.js +36 -54
  28. package/lib/models/SortieVariant.js +23 -25
  29. package/lib/models/SteelPathOffering.js +26 -9
  30. package/lib/models/SyndicateJob.js +20 -30
  31. package/lib/models/SyndicateMission.js +22 -52
  32. package/lib/models/VallisCycle.js +37 -45
  33. package/lib/models/VoidTrader.js +35 -54
  34. package/lib/models/VoidTraderItem.js +5 -8
  35. package/lib/models/VoidTraderSchedule.js +7 -6
  36. package/lib/models/WeeklyChallenge.js +9 -17
  37. package/lib/models/WorldEvent.js +49 -74
  38. package/lib/models/WorldstateObject.js +23 -34
  39. package/lib/models/ZarimanCycle.js +34 -54
  40. package/lib/supporting/Dependency.js +2 -11
  41. package/lib/supporting/DuviriChoice.js +1 -5
  42. package/lib/supporting/ExternalMission.js +2 -6
  43. package/lib/supporting/MarkdownSettings.js +15 -19
  44. package/lib/supporting/RewardData.js +4 -6
  45. package/lib/supporting/RewardTypes.js +2 -4
  46. package/lib/utilities/integrity.js +11 -0
  47. package/lib/utilities/timeDate.js +16 -18
  48. package/lib/utilities/translation.js +188 -56
  49. package/main.js +2 -2
  50. package/package.json +3 -5
  51. package/types/lib/WorldState.d.ts +39 -28
  52. package/types/lib/models/Alert.d.ts +13 -24
  53. package/types/lib/models/CambionCycle.d.ts +5 -10
  54. package/types/lib/models/CetusCycle.d.ts +8 -26
  55. package/types/lib/models/ChallengeInstance.d.ts +7 -9
  56. package/types/lib/models/ConclaveChallenge.d.ts +11 -24
  57. package/types/lib/models/ConstructionProgress.d.ts +5 -16
  58. package/types/lib/models/DailyDeal.d.ts +7 -26
  59. package/types/lib/models/DarkSector.d.ts +11 -22
  60. package/types/lib/models/DarkSectorBattle.d.ts +3 -6
  61. package/types/lib/models/DuviriCycle.d.ts +5 -11
  62. package/types/lib/models/EarthCycle.d.ts +40 -17
  63. package/types/lib/models/Fissure.d.ts +10 -17
  64. package/types/lib/models/FlashSale.d.ts +8 -29
  65. package/types/lib/models/GlobalUpgrade.d.ts +8 -27
  66. package/types/lib/models/Invasion.d.ts +18 -53
  67. package/types/lib/models/Kuva.d.ts +10 -21
  68. package/types/lib/models/Mission.d.ts +11 -23
  69. package/types/lib/models/News.d.ts +18 -31
  70. package/types/lib/models/Nightwave.d.ts +12 -29
  71. package/types/lib/models/NightwaveChallenge.d.ts +10 -15
  72. package/types/lib/models/PersistentEnemy.d.ts +9 -20
  73. package/types/lib/models/Reward.d.ts +34 -18
  74. package/types/lib/models/SentientOutpost.d.ts +9 -13
  75. package/types/lib/models/Simaris.d.ts +6 -17
  76. package/types/lib/models/Sortie.d.ts +16 -25
  77. package/types/lib/models/SortieVariant.d.ts +13 -15
  78. package/types/lib/models/SteelPathOffering.d.ts +5 -8
  79. package/types/lib/models/SyndicateJob.d.ts +13 -14
  80. package/types/lib/models/SyndicateMission.d.ts +9 -22
  81. package/types/lib/models/VallisCycle.d.ts +28 -18
  82. package/types/lib/models/VoidTrader.d.ts +8 -21
  83. package/types/lib/models/VoidTraderItem.d.ts +4 -6
  84. package/types/lib/models/VoidTraderSchedule.d.ts +5 -8
  85. package/types/lib/models/WeeklyChallenge.d.ts +5 -14
  86. package/types/lib/models/WorldEvent.d.ts +38 -52
  87. package/types/lib/models/WorldstateObject.d.ts +46 -24
  88. package/types/lib/models/ZarimanCycle.d.ts +9 -27
  89. package/types/lib/supporting/Dependency.d.ts +2 -8
  90. package/types/lib/supporting/DuviriChoice.d.ts +1 -2
  91. package/types/lib/supporting/ExternalMission.d.ts +3 -7
  92. package/types/lib/supporting/MarkdownSettings.d.ts +29 -15
  93. package/types/lib/supporting/RewardData.d.ts +8 -2
  94. package/types/lib/supporting/RewardTypes.d.ts +2 -2
  95. package/types/lib/utilities/integrity.d.ts +1 -0
  96. package/types/lib/utilities/timeDate.d.ts +19 -12
  97. package/types/lib/utilities/translation.d.ts +188 -23
  98. package/types/main.d.ts +2 -4
@@ -1,10 +1,7 @@
1
- export = VoidTraderSchedule;
2
- declare class VoidTraderSchedule {
3
- constructor(data: any, { timeDate, translator, locale }: {
4
- timeDate: any;
5
- translator: any;
6
- locale: any;
1
+ export default class VoidTraderSchedule {
2
+ constructor(data: any, { locale }?: {
3
+ locale?: string;
7
4
  });
8
- expiry: any;
9
- item: any;
5
+ expiry: Date;
6
+ item: string;
10
7
  }
@@ -1,21 +1,12 @@
1
- export = WeeklyChallenge;
2
1
  /**
3
2
  * Represents a void trader
4
- * @extends {WorldstateObject}
3
+ * @augments {WorldstateObject}
5
4
  */
6
- declare class WeeklyChallenge extends WorldstateObject {
5
+ export default class WeeklyChallenge extends WorldstateObject {
7
6
  /**
8
- * @param {Object} data The Void trader data
9
- * @param {Object} deps The dependencies object
10
- * @param {MarkdownSettings} deps.mdConfig The markdown settings
11
- * @param {Translator} deps.translator The string translator
12
- * @param {TimeDateFunctions} deps.timeDate The time and date functions
7
+ * @param {object} data The Void trader data
13
8
  */
14
- constructor(data: any, { timeDate, translator }: {
15
- mdConfig: MarkdownSettings;
16
- translator: Translator;
17
- timeDate: TimeDateFunctions;
18
- });
9
+ constructor(data: object);
19
10
  challenges: any;
20
11
  }
21
- import WorldstateObject = require("./WorldstateObject");
12
+ import WorldstateObject from './WorldstateObject.js';
@@ -1,48 +1,30 @@
1
- export = WorldEvent;
2
1
  /**
3
2
  * Interim step for an event reward system.
4
- * @typedef {Object} InterimStep
5
- *
6
- * @property {Number} goal Goal amount
3
+ * @typedef {object} InterimStep
4
+ * @property {number} goal Goal amount
7
5
  * @property {Reward} reward Reward for reaching the step
8
- * @property {Number} winnerCount Amount of players at this step
9
- * @property {Object} message Message received when reaching the interim step
6
+ * @property {number} winnerCount Amount of players at this step
7
+ * @property {object} message Message received when reaching the interim step
10
8
  */
11
9
  /**
12
10
  * Progress for one of multiple stages
13
- * @typedef {Object} ProgressStep
14
- *
15
- * @property {string} type
16
- * @property {Number} progressAmt
11
+ * @typedef {object} ProgressStep
12
+ * @property {string} type Type of progress
13
+ * @property {number} progressAmt Amount of progress
17
14
  */
18
15
  /**
19
16
  * Represents an in-game special event
20
- *
21
- * @extends {WorldstateObject}
17
+ * @augments {WorldstateObject}
22
18
  */
23
- declare class WorldEvent extends WorldstateObject {
24
- /**
25
- * @param {Object} data The event data
26
- * @param {Object} deps The dependencies object
27
- * @param {MarkdownSettings} deps.mdConfig The markdown settings
28
- * @param {Translator} deps.translator The string translator
29
- * @param {TimeDateFunctions} deps.timeDate The time and date functions
30
- * @param {Reward} deps.Reward The Reward parser
19
+ export default class WorldEvent extends WorldstateObject {
20
+ /**
21
+ * @param {object} data The event data
22
+ * @param {object} deps The dependencies object
31
23
  * @param {string} deps.locale Locale to use for translations
32
24
  */
33
- constructor(data: any, { mdConfig, translator, timeDate, Reward, locale }: {
34
- mdConfig: MarkdownSettings;
35
- translator: Translator;
36
- timeDate: TimeDateFunctions;
37
- Reward: Reward;
25
+ constructor(data: object, { locale }?: {
38
26
  locale: string;
39
27
  });
40
- /**
41
- * The markdown settings
42
- * @type {MarkdownSettings}
43
- * @private
44
- */
45
- private mdConfig;
46
28
  /**
47
29
  * The event's main score goal
48
30
  * @type {number}
@@ -110,15 +92,15 @@ declare class WorldEvent extends WorldstateObject {
110
92
  expired: boolean;
111
93
  /**
112
94
  * Health remaining for the target
113
- * @type {Number}
95
+ * @type {number}
114
96
  */
115
97
  health: number;
116
- affiliatedWith: any;
98
+ affiliatedWith: string;
117
99
  jobs: any;
118
100
  previousJobs: any;
119
101
  /**
120
102
  * Previous job id
121
- * @type {String}
103
+ * @type {string}
122
104
  */
123
105
  previousId: string;
124
106
  /**
@@ -133,7 +115,7 @@ declare class WorldEvent extends WorldstateObject {
133
115
  progressSteps: ProgressStep[];
134
116
  /**
135
117
  * Total of all MultiProgress
136
- * @type {Number}
118
+ * @type {number}
137
119
  */
138
120
  progressTotal: number;
139
121
  /**
@@ -143,12 +125,12 @@ declare class WorldEvent extends WorldstateObject {
143
125
  showTotalAtEndOfMission: boolean;
144
126
  /**
145
127
  * Whether or not the event is personal
146
- * @type {Boolean}
128
+ * @type {boolean}
147
129
  */
148
130
  isPersonal: boolean;
149
131
  /**
150
132
  * Whether or not the event is community
151
- * @type {Boolean}
133
+ * @type {boolean}
152
134
  */
153
135
  isCommunity: boolean;
154
136
  /**
@@ -164,35 +146,31 @@ declare class WorldEvent extends WorldstateObject {
164
146
  asString: string;
165
147
  /**
166
148
  * Metadata provided by DE
167
- * @type {Object}
149
+ * @type {object}
168
150
  */
169
- metadata: any;
151
+ metadata: object;
170
152
  /**
171
153
  * Bonuses given for completion
172
- * @type {Array.<Number>}
154
+ * @type {Array.<number>}
173
155
  */
174
156
  completionBonuses: Array<number>;
175
157
  scoreVar: any;
176
- altExpiry: any;
177
- altActivation: any;
158
+ altExpiry: Date;
159
+ altActivation: Date;
178
160
  nextAlt: {
179
- expiry: any;
180
- activation: any;
161
+ expiry: Date;
162
+ activation: Date;
181
163
  };
182
164
  /**
183
165
  * Get whether or not the event has expired
184
- * @returns {boolean}
166
+ * @returns {boolean} whether the event has expired
185
167
  */
186
168
  getExpired(): boolean;
187
169
  }
188
- declare namespace WorldEvent {
189
- export { InterimStep, ProgressStep };
190
- }
191
- import WorldstateObject = require("./WorldstateObject");
192
170
  /**
193
171
  * Interim step for an event reward system.
194
172
  */
195
- type InterimStep = {
173
+ export type InterimStep = {
196
174
  /**
197
175
  * Goal amount
198
176
  */
@@ -208,12 +186,20 @@ type InterimStep = {
208
186
  /**
209
187
  * Message received when reaching the interim step
210
188
  */
211
- message: any;
189
+ message: object;
212
190
  };
213
191
  /**
214
192
  * Progress for one of multiple stages
215
193
  */
216
- type ProgressStep = {
194
+ export type ProgressStep = {
195
+ /**
196
+ * Type of progress
197
+ */
217
198
  type: string;
199
+ /**
200
+ * Amount of progress
201
+ */
218
202
  progressAmt: number;
219
203
  };
204
+ import WorldstateObject from './WorldstateObject.js';
205
+ import Reward from './Reward.js';
@@ -1,23 +1,39 @@
1
- export = WorldstateObject;
2
- declare class WorldstateObject {
1
+ /**
2
+ * @typedef {object} Identifier
3
+ * @property {string} $id older identifier schema
4
+ * @property {string} $oid newer global identifier schema
5
+ */
6
+ /**
7
+ * @typedef {object} LegacyTimestamp
8
+ * @property {number} sec second-based timestamp
9
+ */
10
+ /**
11
+ * @typedef {object} Timestamp
12
+ * @property {number} $numberLong millisecond-based timestamp
13
+ */
14
+ /**
15
+ * @typedef {object} ContentTimestamp
16
+ * @property {LegacyTimestamp|Timestamp} $date timestamp number wrapper
17
+ */
18
+ /**
19
+ * @typedef {object} BaseContentObject
20
+ * @property {Identifier} _id object identifier
21
+ * @property {ContentTimestamp} Activation activation timestamp
22
+ * @property {ContentTimestamp} Expiry expiry timestamp
23
+ */
24
+ /**
25
+ * Represents a generic object from Worldstate
26
+ */
27
+ export default class WorldstateObject {
3
28
  /**
4
29
  * @param {BaseContentObject} data The object data
5
- * @param {TimeDateFunctions} timeDate time date functions
6
- * @param {Translator} translator translation functions
7
30
  */
8
- constructor(data: BaseContentObject, { timeDate, translator }: TimeDateFunctions);
31
+ constructor(data: BaseContentObject);
9
32
  /**
10
33
  * The object's id field
11
34
  * @type {Identifier.$id|Identifier.$oid}
12
35
  */
13
36
  id: Identifier.$id | Identifier.$oid;
14
- /**
15
- * The time and date functions
16
- * @type {TimeDateFunctions}
17
- * @private
18
- */
19
- private timeDate;
20
- translator: any;
21
37
  /**
22
38
  * The date and time at which the void trader arrives
23
39
  * @type {Date}
@@ -41,29 +57,26 @@ declare class WorldstateObject {
41
57
  active: boolean;
42
58
  /**
43
59
  * Returns a string representation of the object
44
- * @returns {string}
60
+ * @returns {string} basic representation from the id
45
61
  */
46
62
  toString(): string;
47
63
  /**
48
64
  * Get whether the trader is currently active
49
- * @returns {boolean}
65
+ * @returns {boolean} whether the trader is active
50
66
  */
51
67
  isActive(): boolean;
52
68
  /**
53
69
  * Get a string indicating how long it will take for the trader to arrive
54
- * @returns {string}
70
+ * @returns {string} time delta string from now to the start
55
71
  */
56
72
  getStartString(): string;
57
73
  /**
58
74
  * Get a string indicating how long it will take for the trader to leave
59
- * @returns {string}
75
+ * @returns {string} time delta string from now to the end
60
76
  */
61
77
  getEndString(): string;
62
78
  }
63
- declare namespace WorldstateObject {
64
- export { Identifier, LegacyTimestamp, Timestamp, ContentTimestamp, BaseContentObject };
65
- }
66
- type Identifier = {
79
+ export type Identifier = {
67
80
  /**
68
81
  * older identifier schema
69
82
  */
@@ -73,26 +86,35 @@ type Identifier = {
73
86
  */
74
87
  $oid: string;
75
88
  };
76
- type LegacyTimestamp = {
89
+ export type LegacyTimestamp = {
77
90
  /**
78
91
  * second-based timestamp
79
92
  */
80
93
  sec: number;
81
94
  };
82
- type Timestamp = {
95
+ export type Timestamp = {
83
96
  /**
84
97
  * millisecond-based timestamp
85
98
  */
86
99
  $numberLong: number;
87
100
  };
88
- type ContentTimestamp = {
101
+ export type ContentTimestamp = {
89
102
  /**
90
103
  * timestamp number wrapper
91
104
  */
92
105
  $date: LegacyTimestamp | Timestamp;
93
106
  };
94
- type BaseContentObject = {
107
+ export type BaseContentObject = {
108
+ /**
109
+ * object identifier
110
+ */
95
111
  _id: Identifier;
112
+ /**
113
+ * activation timestamp
114
+ */
96
115
  Activation: ContentTimestamp;
116
+ /**
117
+ * expiry timestamp
118
+ */
97
119
  Expiry: ContentTimestamp;
98
120
  };
@@ -1,31 +1,12 @@
1
- export = ZarimanCycle;
2
1
  /**
3
2
  * Represents the current Zariman Corpus/Grineer Cycle
4
- * @extends {WorldstateObject}
3
+ * @augments {WorldstateObject}
5
4
  */
6
- declare class ZarimanCycle extends WorldstateObject {
5
+ export default class ZarimanCycle extends WorldstateObject {
7
6
  /**
8
- * @param {Date} bountiesEndDate The current zariman cycle expiry
9
- * @param {Object} deps The dependencies object
10
- * @param {MarkdownSettings} deps.mdConfig The markdown settings
11
- * @param {TimeDateFunctions} deps.timeDate The time and date functions
7
+ * @param {Date} bountiesEndDate The current Zariman cycle expiry
12
8
  */
13
- constructor(bountiesEndDate: Date, { mdConfig, timeDate }: {
14
- mdConfig: MarkdownSettings;
15
- timeDate: TimeDateFunctions;
16
- });
17
- /**
18
- * The markdown settings
19
- * @type {MarkdownSettings}
20
- * @private
21
- */
22
- private mdConfig;
23
- /**
24
- * The end of the Zariman bounties timer, the faction changes exactly half way through
25
- * @type {Date}
26
- * @private
27
- */
28
- private bountiesEndDate;
9
+ constructor(bountiesEndDate: Date);
29
10
  /**
30
11
  * Whether or not this it's corpus or grineer
31
12
  * @type {boolean}
@@ -45,16 +26,17 @@ declare class ZarimanCycle extends WorldstateObject {
45
26
  shortString: string;
46
27
  /**
47
28
  * Get whether the event has expired
48
- * @returns {boolean}
29
+ * @returns {boolean} whether this is expired
49
30
  */
50
31
  getExpired(): boolean;
51
32
  getCurrentZarimanCycle(): {
52
33
  isCorpus: boolean;
53
- timeLeft: any;
34
+ timeLeft: string;
54
35
  expiry: Date;
55
- expiresIn: any;
36
+ expiresIn: number;
56
37
  state: string;
57
38
  start: number;
58
39
  };
40
+ #private;
59
41
  }
60
- import WorldstateObject = require("./WorldstateObject");
42
+ import WorldstateObject from './WorldstateObject.js';
@@ -1,13 +1,7 @@
1
- export = Dependency;
2
1
  /**
3
2
  * Dependency Object
4
- * @property {MarkdownSettings} mdConfig The markdown settings
5
- * @property {Translator} translator The string translator
6
- * @property {TimeDateFunctions} timeDate The time and date functions
7
- * @property {Mission} Mission The Mission parser
8
- * @property {Reward} Reward The Reward parser
9
3
  * @property {string} locale Locale to use for translations
10
- * @property {Object} logger Generic logger to use if needed
4
+ * @property {object} logger Generic logger to use if needed
11
5
  */
12
- declare class Dependency {
6
+ export default class Dependency {
13
7
  }
@@ -1,8 +1,7 @@
1
- export = DuviriChoice;
2
1
  /**
3
2
  * Single category of duviri choices
4
3
  */
5
- declare class DuviriChoice {
4
+ export default class DuviriChoice {
6
5
  constructor(data: any);
7
6
  category: string;
8
7
  categoryKey: any;
@@ -1,7 +1,6 @@
1
- export = ExternalMission;
2
1
  /**
3
2
  * External mission data retrieved from https://10o.io/kuvalog.json
4
- * @typedef {Object} ExternalMission
3
+ * @typedef {object} ExternalMission
5
4
  * @property {Date} activation start time
6
5
  * @property {Date} expiry end timer
7
6
  * @property {string} node formatted node name with planet
@@ -11,15 +10,12 @@ export = ExternalMission;
11
10
  * @property {boolean} sharkwing whether or not the tile requires
12
11
  * sumbersible archwing
13
12
  */
14
- declare class ExternalMission {
15
- }
16
- declare namespace ExternalMission {
17
- export { ExternalMission };
13
+ export default class ExternalMission {
18
14
  }
19
15
  /**
20
16
  * External mission data retrieved from https://10o.io/kuvalog.json
21
17
  */
22
- type ExternalMission = {
18
+ export type ExternalMission = {
23
19
  /**
24
20
  * start time
25
21
  */
@@ -1,16 +1,30 @@
1
- export = MarkdownSettings;
2
- declare class MarkdownSettings {
3
- lineEnd: string;
4
- blockEnd: string;
5
- doubleReturn: string;
6
- linkBegin: string;
7
- linkMid: string;
8
- linkEnd: string;
9
- bold: string;
10
- italic: string;
11
- underline: string;
12
- strike: string;
13
- codeLine: string;
14
- codeBlock: string;
15
- spoiler: string;
1
+ /**
2
+ * A collection of strings that are used by the parser to produce markdown-formatted text
3
+ * @property {string} lineEnd - Line return character
4
+ * @property {string} blockEnd - Block end string
5
+ * @property {string} doubleReturn - Double line return string
6
+ * @property {string} linkBegin - Link begin string
7
+ * @property {string} linkMid - Link middle string
8
+ * @property {string} linkEnd - Link end string
9
+ * @property {string} bold - String for denoting bold text
10
+ * @property {string} italic - String for denoting italicized text
11
+ * @property {string} underline - String for denoting underlined text
12
+ * @property {string} strike - String for denoting striked-through text
13
+ * @property {string} codeLine - String for denoting in-line code
14
+ * @property {string} codeBlock - String for denoting multi-line code blocks
15
+ */
16
+ export default class MarkdownSettings {
17
+ static lineEnd: string;
18
+ static blockEnd: string;
19
+ static doubleReturn: string;
20
+ static linkBegin: string;
21
+ static linkMid: string;
22
+ static linkEnd: string;
23
+ static bold: string;
24
+ static italic: string;
25
+ static underline: string;
26
+ static strike: string;
27
+ static codeLine: string;
28
+ static codeBlock: string;
29
+ static spoiler: string;
16
30
  }
@@ -1,3 +1,9 @@
1
- export const nightmare: string[];
2
- export const auras: string[];
3
1
  export const resources: string[];
2
+ export const auras: string[];
3
+ export const nightmare: string[];
4
+ declare namespace _default {
5
+ export { nightmare };
6
+ export { auras };
7
+ export { resources };
8
+ }
9
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _exports: Array<RewardType>;
2
- export = _exports;
1
+ declare const _default: Array<RewardType>;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export function insist(thing: any, ...args: any[]): void;
@@ -1,29 +1,36 @@
1
- /**
2
- * An object containing functions to format dates and times
3
- */
4
- export type TimeDateFunctions = any;
5
1
  /**
6
2
  * @param {number} millis The number of milliseconds in the time delta
7
- * @returns {string}
3
+ * @returns {string} formatted time delta
8
4
  */
9
5
  export function timeDeltaToString(millis: number): string;
10
6
  /**
11
7
  * Returns the number of milliseconds between now and a given date
12
8
  * @param {Date} d The date from which the current time will be subtracted
13
- * @param {function} [now] A function that returns the current UNIX time in milliseconds
14
- * @returns {number}
9
+ * @param {Function} [now] A function that returns the current UNIX time in milliseconds
10
+ * @returns {number} The number of milliseconds after the given date to now
15
11
  */
16
12
  export function fromNow(d: Date, now?: Function): number;
17
13
  /**
18
14
  * Returns the number of milliseconds between a given date and now
19
15
  * @param {Date} d The date that the current time will be subtracted from
20
- * @param {function} [now] A function that returns the current UNIX time in milliseconds
21
- * @returns {number}
16
+ * @param {Function} [now] A function that returns the current UNIX time in milliseconds
17
+ * @returns {number} The number of milliseconds after now to the given date
22
18
  */
23
19
  export function toNow(d: Date, now?: Function): number;
24
20
  /**
25
21
  * Returns a new Date constructed from a worldState date object
26
- * @param {Object} d The worldState date object
27
- * @returns {Date}
22
+ * @param {object} d The worldState date object
23
+ * @returns {Date} parsed date from DE date format
24
+ */
25
+ export function parseDate(d: object): Date;
26
+ declare namespace _default {
27
+ export { timeDeltaToString };
28
+ export { fromNow };
29
+ export { toNow };
30
+ export { parseDate };
31
+ }
32
+ export default _default;
33
+ /**
34
+ * An object containing functions to format dates and times
28
35
  */
29
- export function parseDate(d: any): Date;
36
+ export type TimeDateFunctions = Record<string, Function>;