swcombine.js 0.0.2 → 0.0.3
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.
- package/dist/index.cjs.js +664 -9
- package/dist/index.d.ts +497 -5
- package/dist/index.esm.js +664 -9
- package/package.json +8 -8
- package/dist/index.d.mts +0 -33
- package/dist/index.d.ts.map +0 -1
- package/dist/permissions.d.ts +0 -289
- package/dist/permissions.d.ts.map +0 -1
- package/dist/resources/ApiResource.d.ts +0 -7
- package/dist/resources/ApiResource.d.ts.map +0 -1
- package/dist/resources/Resource.d.ts +0 -6
- package/dist/resources/Resource.d.ts.map +0 -1
- package/dist/resources/index.d.ts +0 -3
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/responses/SwcApiResponse.d.ts +0 -8
- package/dist/responses/SwcApiResponse.d.ts.map +0 -1
- package/dist/responses/api/getPermissionsResponse.d.ts +0 -17
- package/dist/responses/api/getPermissionsResponse.d.ts.map +0 -1
- package/dist/responses/api/index.d.ts +0 -2
- package/dist/responses/api/index.d.ts.map +0 -1
- package/dist/responses/index.d.ts +0 -3
- package/dist/responses/index.d.ts.map +0 -1
- package/dist/types/Permission.d.ts +0 -7
- package/dist/types/Permission.d.ts.map +0 -1
- package/dist/types/SwcTimestamp.d.ts +0 -34
- package/dist/types/SwcTimestamp.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,497 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
declare class AuthenticatedCharacterResource extends PublicCharacterResource {
|
|
2
|
+
private auth;
|
|
3
|
+
constructor(auth: AuthService);
|
|
4
|
+
getCurrentCharacter(): Promise<CharacterResponse>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare class AuthService {
|
|
8
|
+
private config;
|
|
9
|
+
private tokenInfo?;
|
|
10
|
+
constructor(config: OAuthConfig);
|
|
11
|
+
get isAuthenticated(): boolean;
|
|
12
|
+
getAccessToken(): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param scopesToRequest Indicates the resource access your application is requesting. The values passed in this parameter inform the consent page shown to the user. There is an inverse relationship between the number of permissions requested and the likelihood of obtaining user consent
|
|
16
|
+
* @param stateToAdd Indicates any state which may be useful to your application upon receipt of the response. The Web Service Authorization Server roundtrips this parameter, so your application receives the same value it sent. Possible uses include redirecting the user to the correct resource in your site, nonces, and cross-site-request-forgery mitigations.
|
|
17
|
+
*/
|
|
18
|
+
getAuthorizationUrl(scopesToRequest?: string[], stateToAdd?: string): string;
|
|
19
|
+
exchangeCode(code: string): Promise<void>;
|
|
20
|
+
setTokenInfo(tokenInfo: TokenInfo): void;
|
|
21
|
+
getTokenInfo(): TokenInfo | undefined;
|
|
22
|
+
private refreshToken;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare interface CharacterFaction {
|
|
26
|
+
uid: SwcUid;
|
|
27
|
+
name: string;
|
|
28
|
+
isPrimary: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare type CharacterFactionPrivileges = {
|
|
32
|
+
factionId: number;
|
|
33
|
+
factionName: string;
|
|
34
|
+
privilegeCount: number;
|
|
35
|
+
privileges: {
|
|
36
|
+
setInfoFields: boolean;
|
|
37
|
+
viewMemberList: boolean;
|
|
38
|
+
acceptOrDeclineMembers: boolean;
|
|
39
|
+
expelMembers: boolean;
|
|
40
|
+
isFactionLeader: boolean;
|
|
41
|
+
viewCredits: boolean;
|
|
42
|
+
sendCredits: boolean;
|
|
43
|
+
viewTransactions: boolean;
|
|
44
|
+
viewBudgets: boolean;
|
|
45
|
+
modifyBudgets: boolean;
|
|
46
|
+
setTaxLevels: boolean;
|
|
47
|
+
operateVendors: boolean;
|
|
48
|
+
givePrivileges: boolean;
|
|
49
|
+
changePasscode: boolean;
|
|
50
|
+
protectAssets: boolean;
|
|
51
|
+
combatEvents: boolean;
|
|
52
|
+
manageTemplates: boolean;
|
|
53
|
+
canSeeOverview: boolean;
|
|
54
|
+
canViewPanelRequests: boolean;
|
|
55
|
+
enforceArrestWarrant: boolean;
|
|
56
|
+
enforceDeathWarrant: boolean;
|
|
57
|
+
releasePrisoners: boolean;
|
|
58
|
+
issueArrestWarrant: boolean;
|
|
59
|
+
issueDeathWarrant: boolean;
|
|
60
|
+
modifyFriendFoeList: boolean;
|
|
61
|
+
hasSecurityAuthorisation: boolean;
|
|
62
|
+
postGnsSocial: boolean;
|
|
63
|
+
postGnsMilitary: boolean;
|
|
64
|
+
postGnsPolitics: boolean;
|
|
65
|
+
postGnsEconomics: boolean;
|
|
66
|
+
gnsCensorship: boolean;
|
|
67
|
+
produceInFacilities: boolean;
|
|
68
|
+
produceInStations: boolean;
|
|
69
|
+
canAbortProduction: boolean;
|
|
70
|
+
assignDatacards: boolean;
|
|
71
|
+
revokeAssignedDatacards: boolean;
|
|
72
|
+
constructFacilities: boolean;
|
|
73
|
+
constructCities: boolean;
|
|
74
|
+
constructStations: boolean;
|
|
75
|
+
canAbortConstruction: boolean;
|
|
76
|
+
performAsteroidMining: boolean;
|
|
77
|
+
performRecycling: boolean;
|
|
78
|
+
purchaseNpcs: boolean;
|
|
79
|
+
editNpcs: boolean;
|
|
80
|
+
fireNpcs: boolean;
|
|
81
|
+
isSecondInCommand: boolean;
|
|
82
|
+
assignTags: boolean;
|
|
83
|
+
renameTags: boolean;
|
|
84
|
+
createTags: boolean;
|
|
85
|
+
deleteTags: boolean;
|
|
86
|
+
viewCombatReports: boolean;
|
|
87
|
+
launchGarrisonSquad: boolean;
|
|
88
|
+
modifyGarrisonReserve: boolean;
|
|
89
|
+
launchCargoSquad: boolean;
|
|
90
|
+
linkCargoBase: boolean;
|
|
91
|
+
viewCargoSquad: boolean;
|
|
92
|
+
changeFactionProfile: boolean;
|
|
93
|
+
renameFaction: boolean;
|
|
94
|
+
factionCustomImages: boolean;
|
|
95
|
+
createSubfactions: boolean;
|
|
96
|
+
manageSubfactionMembers: boolean;
|
|
97
|
+
subfactionFullPrivileges: boolean;
|
|
98
|
+
manageFactionModules: boolean;
|
|
99
|
+
manageAlliance: boolean;
|
|
100
|
+
viewShips: boolean;
|
|
101
|
+
assignShips: boolean;
|
|
102
|
+
renameShips: boolean;
|
|
103
|
+
makeoverShips: boolean;
|
|
104
|
+
viewVehicles: boolean;
|
|
105
|
+
assignVehicles: boolean;
|
|
106
|
+
renameVehicles: boolean;
|
|
107
|
+
makeoverVehicles: boolean;
|
|
108
|
+
viewItems: boolean;
|
|
109
|
+
assignItems: boolean;
|
|
110
|
+
renameItems: boolean;
|
|
111
|
+
makeoverItems: boolean;
|
|
112
|
+
viewDroids: boolean;
|
|
113
|
+
assignDroids: boolean;
|
|
114
|
+
renameDroids: boolean;
|
|
115
|
+
makeoverDroids: boolean;
|
|
116
|
+
viewStations: boolean;
|
|
117
|
+
assignStations: boolean;
|
|
118
|
+
renameStations: boolean;
|
|
119
|
+
makeoverStations: boolean;
|
|
120
|
+
stationControlRoom: boolean;
|
|
121
|
+
manageStationPermissions: boolean;
|
|
122
|
+
viewFacilities: boolean;
|
|
123
|
+
assignFacilities: boolean;
|
|
124
|
+
renameFacilities: boolean;
|
|
125
|
+
makeoverFacilities: boolean;
|
|
126
|
+
facilityControlRoom: boolean;
|
|
127
|
+
manageFacilityPermissions: boolean;
|
|
128
|
+
viewMaterials: boolean;
|
|
129
|
+
assignMaterials: boolean;
|
|
130
|
+
renameMaterials: boolean;
|
|
131
|
+
makeoverMaterials: boolean;
|
|
132
|
+
viewNpcs: boolean;
|
|
133
|
+
assignNpcs: boolean;
|
|
134
|
+
renameNpcs: boolean;
|
|
135
|
+
makeoverNpcs: boolean;
|
|
136
|
+
viewCities: boolean;
|
|
137
|
+
assignCities: boolean;
|
|
138
|
+
renameCities: boolean;
|
|
139
|
+
makeoverCities: boolean;
|
|
140
|
+
manageCityPermissions: boolean;
|
|
141
|
+
viewCreatures: boolean;
|
|
142
|
+
assignCreatures: boolean;
|
|
143
|
+
renameCreatures: boolean;
|
|
144
|
+
makeoverCreatures: boolean;
|
|
145
|
+
viewPlanets: boolean;
|
|
146
|
+
assignPlanets: boolean;
|
|
147
|
+
viewStocks: boolean;
|
|
148
|
+
makeoverStocks: boolean;
|
|
149
|
+
viewDatacards: boolean;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
declare interface CharacterLocation {
|
|
154
|
+
container?: {
|
|
155
|
+
type: 'ship' | 'vehicle' | 'station' | 'facility';
|
|
156
|
+
uid: SwcUid;
|
|
157
|
+
name: string;
|
|
158
|
+
};
|
|
159
|
+
sector?: {
|
|
160
|
+
uid: SwcUid;
|
|
161
|
+
name: string;
|
|
162
|
+
};
|
|
163
|
+
system?: {
|
|
164
|
+
uid: SwcUid;
|
|
165
|
+
name: string;
|
|
166
|
+
};
|
|
167
|
+
planet?: {
|
|
168
|
+
uid: SwcUid;
|
|
169
|
+
name: string;
|
|
170
|
+
};
|
|
171
|
+
city?: {
|
|
172
|
+
uid: SwcUid;
|
|
173
|
+
name: string;
|
|
174
|
+
};
|
|
175
|
+
coordinates: {
|
|
176
|
+
galaxy: {
|
|
177
|
+
x: number | null;
|
|
178
|
+
y: number | null;
|
|
179
|
+
};
|
|
180
|
+
system: {
|
|
181
|
+
x: number | null;
|
|
182
|
+
y: number | null;
|
|
183
|
+
};
|
|
184
|
+
surface: {
|
|
185
|
+
x: number | null;
|
|
186
|
+
y: number | null;
|
|
187
|
+
};
|
|
188
|
+
ground: {
|
|
189
|
+
x: number | null;
|
|
190
|
+
y: number | null;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare type CharacterResource<TOAuth extends boolean> = TOAuth extends true ? AuthenticatedCharacterResource : PublicCharacterResource;
|
|
196
|
+
|
|
197
|
+
declare interface CharacterResponse {
|
|
198
|
+
/** Unique ID referring to this character */
|
|
199
|
+
uid: SwcUid;
|
|
200
|
+
/** Character's handle. Always available */
|
|
201
|
+
name: string;
|
|
202
|
+
/** Link to the character's avatar. Always available. */
|
|
203
|
+
image: string;
|
|
204
|
+
/** The character's current HP. Visible if you have the character_stats scope. */
|
|
205
|
+
hp?: number;
|
|
206
|
+
/** The character's maximum HP. Visible if you have the character_stats scope. */
|
|
207
|
+
maxHp?: number;
|
|
208
|
+
/** The character's current XP. Visible if you have the character_stats scope. */
|
|
209
|
+
xp?: number;
|
|
210
|
+
/** The character's current level. Visible if you have the character_stats scope. */
|
|
211
|
+
level?: number;
|
|
212
|
+
/** Whether the character's profile is private. */
|
|
213
|
+
isProfilePrivate: boolean;
|
|
214
|
+
/** The character's gender. Visible if their profile is NOT private. */
|
|
215
|
+
gender?: 'Male' | 'Female';
|
|
216
|
+
/** The character's biography. Visible if their profile is NOT private. */
|
|
217
|
+
biography?: string;
|
|
218
|
+
/** Last login time of this character. Visible if their profile is NOT private. */
|
|
219
|
+
lastLogin?: SwcTimestamp;
|
|
220
|
+
/** short description for this character. Visible if their profile is NOT private. */
|
|
221
|
+
shortDescription?: string;
|
|
222
|
+
/** The character's race. Visible if their profile is NOT private. */
|
|
223
|
+
race?: {
|
|
224
|
+
uid: SwcUid;
|
|
225
|
+
name: string;
|
|
226
|
+
};
|
|
227
|
+
/** Whether the character is aware of the force. Visible if you have the character_force scope. */
|
|
228
|
+
isForceAware?: boolean;
|
|
229
|
+
/** The character's factions. Always visible. */
|
|
230
|
+
factions: Array<CharacterFaction>;
|
|
231
|
+
/** The character's skill sheet. Visible if you have the character_skills scope. */
|
|
232
|
+
skills?: CharacterSkills;
|
|
233
|
+
/** The character's privileges within their factions. Visible if you have the character_privileges scope. */
|
|
234
|
+
factionPrivileges?: CharacterFactionPrivileges;
|
|
235
|
+
/** The amount of credits the character has. Visible if you have the character_location scope. */
|
|
236
|
+
location?: CharacterLocation;
|
|
237
|
+
/** The amount of credits the character has. Visible if you have the character_credits scope. */
|
|
238
|
+
credits?: number;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare interface CharacterSkills {
|
|
242
|
+
strength: SkillLevel;
|
|
243
|
+
dexterity: SkillLevel;
|
|
244
|
+
speed: SkillLevel;
|
|
245
|
+
dodge: SkillLevel;
|
|
246
|
+
projectileWeapons: SkillLevel;
|
|
247
|
+
nonProjectileWeapons: SkillLevel;
|
|
248
|
+
medical: SkillLevel;
|
|
249
|
+
diplomacy: SkillLevel;
|
|
250
|
+
crafting: SkillLevel;
|
|
251
|
+
management: SkillLevel;
|
|
252
|
+
perception: SkillLevel;
|
|
253
|
+
stealth: SkillLevel;
|
|
254
|
+
rndHull: SkillLevel;
|
|
255
|
+
rndElectronics: SkillLevel;
|
|
256
|
+
rndEngines: SkillLevel;
|
|
257
|
+
rndWeapons: SkillLevel;
|
|
258
|
+
repair: SkillLevel;
|
|
259
|
+
computerOperations: SkillLevel;
|
|
260
|
+
fighterPiloting: SkillLevel;
|
|
261
|
+
fighterCombat: SkillLevel;
|
|
262
|
+
capitalPiloting: SkillLevel;
|
|
263
|
+
capitalCombat: SkillLevel;
|
|
264
|
+
spaceCommand: SkillLevel;
|
|
265
|
+
vehiclePiloting: SkillLevel;
|
|
266
|
+
vehicleCombat: SkillLevel;
|
|
267
|
+
infantryCommand: SkillLevel;
|
|
268
|
+
vehicleCommand: SkillLevel;
|
|
269
|
+
heavyWeapons: SkillLevel;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export declare interface Duration {
|
|
273
|
+
years: number;
|
|
274
|
+
days: number;
|
|
275
|
+
hours: number;
|
|
276
|
+
minutes: number;
|
|
277
|
+
seconds: number;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare abstract class GenericResource {
|
|
281
|
+
private resourceName;
|
|
282
|
+
protected constructor(resourceName: string);
|
|
283
|
+
protected get<T>(endpointUrl: string, accessToken?: string): Promise<SwcApiResponse<T> | SwcApiError>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare interface HandleCheckResult {
|
|
287
|
+
uid: SwcUid;
|
|
288
|
+
handle: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export declare interface OAuthConfig {
|
|
292
|
+
clientId: string;
|
|
293
|
+
clientSecret: string;
|
|
294
|
+
redirectUri: string;
|
|
295
|
+
/** Indicates if your application needs to access a Resource when the user is not present at the browser. This parameter defaults to online. If your application needs to refresh access tokens when the user is not present at the browser, then use offline. This will result in your application obtaining a refresh token the first time your application exchanges an authorization code for a user. */
|
|
296
|
+
accessType: 'online' | 'offline';
|
|
297
|
+
/** Indicates whether previously granted permissions should be renewed if not explicitly included within the scope parameter. Defaults to not renewing previously granted permissions. **/
|
|
298
|
+
renewPreviouslyGranted?: boolean;
|
|
299
|
+
/** Indicates the resource access your application is requesting. The values passed in this parameter inform the consent page shown to the user. There is an inverse relationship between the number of permissions requested and the likelihood of obtaining user consent */
|
|
300
|
+
defaultScopes?: string[];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
declare interface Permission {
|
|
304
|
+
name: string;
|
|
305
|
+
description: string;
|
|
306
|
+
inheritedPermissions: Permission[];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
*
|
|
311
|
+
* @method getPermissions
|
|
312
|
+
*/
|
|
313
|
+
declare class PublicApiResource extends GenericResource {
|
|
314
|
+
constructor();
|
|
315
|
+
/**
|
|
316
|
+
* Get a list of all permissions in the SWC webservices.
|
|
317
|
+
*/
|
|
318
|
+
getPermissions(): Promise<Permission[]>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare class PublicCharacterResource extends GenericResource {
|
|
322
|
+
constructor();
|
|
323
|
+
handleCheck(handle: string): Promise<HandleCheckResult | undefined>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare type SkillLevel = 0 | 1 | 2 | 3 | 4 | 5;
|
|
327
|
+
|
|
328
|
+
declare type SwcApiError = SwcApiResponse<{
|
|
329
|
+
error_code: number;
|
|
330
|
+
error_message: string;
|
|
331
|
+
}>;
|
|
332
|
+
|
|
333
|
+
declare interface SwcApiResponse<T> {
|
|
334
|
+
version: string;
|
|
335
|
+
timestamp: number;
|
|
336
|
+
resource: string;
|
|
337
|
+
request: string;
|
|
338
|
+
swcapi: T;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export declare class SwcClient<TOAuth extends boolean> {
|
|
342
|
+
api: PublicApiResource;
|
|
343
|
+
character: CharacterResource<TOAuth>;
|
|
344
|
+
protected constructor();
|
|
345
|
+
static public(): SwcClient<false>;
|
|
346
|
+
static withOAuth(oAuthConfig: OAuthConfig): SwcClientWithOAuth;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export declare class SwcClientWithOAuth extends SwcClient<true> {
|
|
350
|
+
auth: AuthService;
|
|
351
|
+
constructor(config: OAuthConfig);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Utility class for working with Star Wars Combine timestamps. Represents Combine Galactic Time and can convert unix timestamps and Date objects to/from CGT.
|
|
356
|
+
* @method toUnixTimestamp
|
|
357
|
+
* @method toDate
|
|
358
|
+
* @method getYear
|
|
359
|
+
* @method getDay
|
|
360
|
+
* @method getHour
|
|
361
|
+
* @method getMinute
|
|
362
|
+
* @method getSecond
|
|
363
|
+
*/
|
|
364
|
+
export declare class SwcTimestamp {
|
|
365
|
+
private static swcStart;
|
|
366
|
+
protected year: number;
|
|
367
|
+
protected day: number;
|
|
368
|
+
protected hour: number;
|
|
369
|
+
protected minute: number;
|
|
370
|
+
protected second: number;
|
|
371
|
+
/**
|
|
372
|
+
* Create a new SwcTimestamp object for a specific moment in Combine Galactic Time.
|
|
373
|
+
* @param {TimestampMoment} source
|
|
374
|
+
*/
|
|
375
|
+
constructor(source: TimestampMoment);
|
|
376
|
+
/**
|
|
377
|
+
* Convert a unix timestamp to Combine Galactic Time.
|
|
378
|
+
* @param {number} unixTimestamp timestamp to convert. Can be either seconds or milliseconds, the code will detect which units to use.
|
|
379
|
+
* @returns {SwcTimestamp}
|
|
380
|
+
*/
|
|
381
|
+
static fromUnixTimestamp(unixTimestamp: number): SwcTimestamp;
|
|
382
|
+
/**
|
|
383
|
+
* Convert a Date object into Combine Galactic Time.
|
|
384
|
+
* @param {Date} date
|
|
385
|
+
* @returns {SwcTimestamp}
|
|
386
|
+
*/
|
|
387
|
+
static fromDate(date: Date): SwcTimestamp;
|
|
388
|
+
/**
|
|
389
|
+
* Get the current Combine Galactic Time.
|
|
390
|
+
* @returns {SwcTimestamp}
|
|
391
|
+
*/
|
|
392
|
+
static now(): SwcTimestamp;
|
|
393
|
+
/**
|
|
394
|
+
*
|
|
395
|
+
* @param {number} msSinceSwcStart
|
|
396
|
+
* @returns {SwcTimestamp}
|
|
397
|
+
* @private
|
|
398
|
+
*/
|
|
399
|
+
private static calculateSwcTimestampFromMillisecondsSinceStart;
|
|
400
|
+
/**
|
|
401
|
+
* Convert the SWC timestamp into a unix timestamp
|
|
402
|
+
* @param {'sec' | 'ms' | 'seconds' | 'milliseconds'} unit Whether the unix timestamp should be in seconds or milliseconds.
|
|
403
|
+
* @returns {number}
|
|
404
|
+
*/
|
|
405
|
+
toUnixTimestamp(unit: 'sec' | 'ms' | 'seconds' | 'milliseconds'): number;
|
|
406
|
+
/**
|
|
407
|
+
* Convert the SWC timestamp into a Date object.
|
|
408
|
+
* @returns {Date}
|
|
409
|
+
*/
|
|
410
|
+
toDate(): Date;
|
|
411
|
+
asMoment(): TimestampMoment;
|
|
412
|
+
/**
|
|
413
|
+
* @returns {number}
|
|
414
|
+
*/
|
|
415
|
+
getYear(): number;
|
|
416
|
+
/**
|
|
417
|
+
* @returns {number}
|
|
418
|
+
*/
|
|
419
|
+
getDay(): number;
|
|
420
|
+
/**
|
|
421
|
+
* @returns {number}
|
|
422
|
+
*/
|
|
423
|
+
getHour(): number;
|
|
424
|
+
/**
|
|
425
|
+
* @returns {number}
|
|
426
|
+
*/
|
|
427
|
+
getMinute(): number;
|
|
428
|
+
/**
|
|
429
|
+
* @returns {number}
|
|
430
|
+
*/
|
|
431
|
+
getSecond(): number;
|
|
432
|
+
/**
|
|
433
|
+
* Calculate a new timestamp by adding time to this timestamp, and return the newly calculated timestamp.
|
|
434
|
+
* @param duration
|
|
435
|
+
*/
|
|
436
|
+
add(duration: Partial<Duration>): SwcTimestamp;
|
|
437
|
+
/**
|
|
438
|
+
* Calculate a new timestamp by subtracting time from this timestamp, and return the newly calculated timestamp.
|
|
439
|
+
* @param duration
|
|
440
|
+
*/
|
|
441
|
+
subtract(duration: Partial<Duration>): SwcTimestamp;
|
|
442
|
+
getDurationTo(otherTimestamp: SwcTimestamp): Duration;
|
|
443
|
+
/**
|
|
444
|
+
* @returns {number}
|
|
445
|
+
* @private
|
|
446
|
+
*/
|
|
447
|
+
private calculateMillisecondsSinceStartFromSwcTimestamp;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
declare class SwcUid {
|
|
451
|
+
private readonly _entityType;
|
|
452
|
+
private readonly _id;
|
|
453
|
+
constructor(entityType: SwcUidType, id: number);
|
|
454
|
+
constructor(uid: string);
|
|
455
|
+
get entityType(): SwcUidType;
|
|
456
|
+
get id(): number;
|
|
457
|
+
get uid(): string;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
declare enum SwcUidType {
|
|
461
|
+
character = 1,
|
|
462
|
+
ship = 2,
|
|
463
|
+
vehicle = 3,
|
|
464
|
+
facility = 4,
|
|
465
|
+
station = 5,
|
|
466
|
+
city = 7,
|
|
467
|
+
planet = 8,
|
|
468
|
+
system = 9,
|
|
469
|
+
npc = 10,
|
|
470
|
+
creature = 11,
|
|
471
|
+
item = 12,
|
|
472
|
+
droid = 13,
|
|
473
|
+
datacard = 14,
|
|
474
|
+
material = 16,
|
|
475
|
+
stock = 17,
|
|
476
|
+
weapon = 18,
|
|
477
|
+
faction = 20,
|
|
478
|
+
race = 22,
|
|
479
|
+
sector = 25,
|
|
480
|
+
customImage = 37
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export declare interface TimestampMoment {
|
|
484
|
+
year: number;
|
|
485
|
+
day: number;
|
|
486
|
+
hour?: number;
|
|
487
|
+
minute?: number;
|
|
488
|
+
second?: number;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export declare interface TokenInfo {
|
|
492
|
+
accessToken: string;
|
|
493
|
+
refreshToken?: string;
|
|
494
|
+
expiryTime: Date;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export { }
|