-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
441 lines (438 loc) · 11.5 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export interface GameSearch {
filter: GameFilter
loadRelations: GameSearchRelations
customIdOrder?: Array<string>
order: GameSearchOrder
offset?: GameSearchOffset
limit: number
slim: boolean
withTagFilter?: Array<string>
}
export interface GameSearchOffset {
value: string
title: string
gameId: string
}
export interface GameSearchOrder {
column: GameSearchSortable
direction: GameSearchDirection
}
export const enum GameSearchSortable {
TITLE = 0,
DEVELOPER = 1,
PUBLISHER = 2,
SERIES = 3,
PLATFORM = 4,
DATEADDED = 5,
DATEMODIFIED = 6,
RELEASEDATE = 7,
LASTPLAYED = 8,
PLAYTIME = 9,
RANDOM = 10,
CUSTOM = 11
}
export const enum GameSearchDirection {
ASC = 0,
DESC = 1
}
export interface GameSearchRelations {
tags: boolean
platforms: boolean
gameData: boolean
addApps: boolean
}
export interface GameFilter {
subfilters: Array<GameFilter>
whitelist: FieldFilter
blacklist: FieldFilter
exactWhitelist: FieldFilter
exactBlacklist: FieldFilter
lowerThan: SizeFilter
higherThan: SizeFilter
equalTo: SizeFilter
boolComp: BoolFilter
matchAny: boolean
}
export interface FieldFilter {
id?: Array<string>
generic?: Array<string>
library?: Array<string>
title?: Array<string>
developer?: Array<string>
publisher?: Array<string>
series?: Array<string>
tags?: Array<string>
platforms?: Array<string>
playMode?: Array<string>
status?: Array<string>
notes?: Array<string>
source?: Array<string>
originalDescription?: Array<string>
language?: Array<string>
applicationPath?: Array<string>
launchCommand?: Array<string>
}
export interface BoolFilter {
installed?: boolean
}
export interface SizeFilter {
tags?: number
platforms?: number
dateAdded?: string
dateModified?: string
releaseDate?: string
gameData?: number
addApps?: number
playtime?: number
playcount?: number
lastPlayed?: string
}
export interface PageTuple {
id: string
orderVal: string
title: string
}
export const enum ElementType {
MODIFIER = 0,
KEY = 1,
KEYCHAR = 2,
VALUE = 3
}
export interface ElementPosition {
element: ElementType
value: string
start: number
end: number
}
export interface ParsedInput {
search: GameSearch
positions: Array<ElementPosition>
}
export interface AdditionalApp {
id: string
name: string
applicationPath: string
launchCommand: string
autoRunBefore: boolean
waitForExit: boolean
parentGameId: string
}
export interface Game {
id: string
library: string
title: string
alternateTitles: string
series: string
developer: string
publisher: string
primaryPlatform: string
platforms: TagVec
dateAdded: string
dateModified: string
detailedPlatforms?: Array<Tag>
legacyBroken: boolean
legacyExtreme: boolean
playMode: string
status: string
notes: string
tags: TagVec
detailedTags?: Array<Tag>
source: string
legacyApplicationPath: string
legacyLaunchCommand: string
releaseDate: string
version: string
originalDescription: string
language: string
activeDataId?: number
activeDataOnDisk: boolean
lastPlayed?: string
playtime: number
playCounter: number
activeGameConfigId?: number
activeGameConfigOwner?: string
archiveState: number
gameData?: Array<GameData>
addApps?: Array<AdditionalApp>
}
export interface PartialGame {
id: string
library?: string
title?: string
alternateTitles?: string
series?: string
developer?: string
publisher?: string
primaryPlatform?: string
platforms?: TagVec
dateAdded?: string
dateModified?: string
legacyBroken?: boolean
legacyExtreme?: boolean
playMode?: string
status?: string
notes?: string
tags?: TagVec
source?: string
legacyApplicationPath?: string
legacyLaunchCommand?: string
releaseDate?: string
version?: string
originalDescription?: string
language?: string
activeDataId?: number
activeDataOnDisk?: boolean
lastPlayed?: string
playtime?: number
playCounter?: number
activeGameConfigId?: number
activeGameConfigOwner?: string
archiveState?: number
addApps?: Array<AdditionalApp>
}
export interface GameRedirect {
sourceId: string
destId: string
}
export interface GameData {
id: number
gameId: string
title: string
dateAdded: string
sha256: string
crc32: number
presentOnDisk: boolean
path?: string
size: number
parameters?: string
applicationPath: string
launchCommand: string
}
export interface PartialGameData {
id?: number
gameId: string
title?: string
dateAdded?: string
sha256?: string
crc32?: number
presentOnDisk?: boolean
path?: string
size?: number
parameters?: string
applicationPath?: string
launchCommand?: string
}
export interface PlatformAppPath {
appPath: string
count: number
}
export interface Tag {
id: number
name: string
description: string
dateModified: string
aliases: Array<string>
category?: string
}
export interface PartialTag {
id: number
name: string
description?: string
dateModified?: string
aliases?: Array<string>
category?: string
}
export interface TagSuggestion {
id: number
name: string
matchedFrom: string
gamesCount: number
category?: string
}
export interface LooseTagAlias {
id: number
value: string
}
export interface TagCategory {
id: number
name: string
color: string
description?: string
}
export interface PartialTagCategory {
id: number
name: string
color: string
description?: string
}
export interface RemoteDeletedGamesRes {
games: Array<RemoteDeletedGame>
}
export interface RemoteDeletedGame {
id: string
dateModified: string
reason: string
}
export interface RemoteGamesRes {
games: Array<RemoteGame>
addApps: Array<RemoteAddApp>
gameData: Array<RemoteGameData>
tagRelations: Array<Array<string>>
platformRelations: Array<Array<string>>
}
export interface RemoteGameData {
gameId: string
title: string
dateAdded: string
sha256: string
crc32: number
size: number
parameters?: string
applicationPath: string
launchCommand: string
}
export interface RemoteAddApp {
name: string
applicationPath: string
launchCommand: string
waitForExit: boolean
autoRunBefore: boolean
parentGameId: string
}
export interface RemoteGame {
id: string
title: string
alternateTitles: string
series: string
developer: string
publisher: string
dateAdded: string
dateModified: string
playMode: string
status: string
notes: string
source: string
applicationPath: string
launchCommand: string
releaseDate: string
version: string
originalDescription: string
language: string
library: string
platformName: string
archiveState: number
}
export interface RemoteCategory {
id: number
name: string
color: string
description: string
}
export interface RemoteTag {
id: number
name: string
description: string
category: string
dateModified: string
aliases: Array<string>
deleted: boolean
}
export interface RemotePlatform {
id: number
name: string
description: string
dateModified: string
aliases: Array<string>
deleted: boolean
}
export interface ContentTreeNode {
name: string
expanded: boolean
size: number
nodeType: string
children: Array<ContentTreeNode>
count: number
}
export function genContentTree(root: string): Promise<ContentTreeNode>
export function copyFolder(src: string, dest: string): Promise<number>
export function mergeGameFilters(a: GameFilter, b: GameFilter): GameFilter
export function parseUserSearchInput(input: string): ParsedInput
export function newSubfilter(): GameFilter
export function enableDebug(): void
export function disableDebug(): void
export function debugEnabled(): boolean
export function loggerSusbcribe(callback: (...args: any[]) => any): void
export type FlashpointNode = FlashpointArchive
export class FlashpointArchive {
constructor()
loadDatabase(source: string): void
searchGames(search: GameSearch): Promise<Array<Game>>
searchGamesIndex(search: GameSearch, limit?: number | undefined | null): Promise<Array<PageTuple>>
searchGamesTotal(search: GameSearch): Promise<number>
searchGamesWithTag(tag: string): Promise<Array<Game>>
searchGamesRandom(search: GameSearch, count: number): Promise<Array<Game>>
searchTagSuggestions(partial: string, blacklist: Array<string>): Promise<Array<TagSuggestion>>
searchPlatformSuggestions(partial: string): Promise<Array<TagSuggestion>>
findAllGameIds(): Promise<Array<string>>
findGame(id: string): Promise<Game | null>
createGame(partialGame: PartialGame): Promise<Game>
saveGame(partialGame: PartialGame): Promise<Game>
saveGames(partialGames: Array<PartialGame>): Promise<Array<Game>>
deleteGame(id: string): Promise<void>
countGames(): Promise<number>
findAddAppById(id: string): Promise<AdditionalApp | null>
createAddApp(addApp: AdditionalApp): Promise<AdditionalApp>
findAllTags(): Promise<Array<Tag>>
findTag(name: string): Promise<Tag | null>
findTagById(id: number): Promise<Tag | null>
createTag(name: string, category?: string | undefined | null, id?: number | undefined | null): Promise<Tag>
saveTag(partial: PartialTag): Promise<Tag>
deleteTag(name: string): Promise<void>
deleteTagById(id: number): Promise<void>
countTags(): Promise<number>
mergeTags(name: string, mergedInto: string): Promise<Tag>
findAllPlatforms(): Promise<Array<Tag>>
findPlatform(name: string): Promise<Tag | null>
findPlatformById(id: number): Promise<Tag | null>
createPlatform(name: string, id?: number | undefined | null): Promise<Tag>
savePlatform(partial: PartialTag): Promise<Tag>
deletePlatform(name: string): Promise<void>
countPlatforms(): Promise<number>
findAllTagCategories(): Promise<Array<TagCategory>>
findTagCategory(name: string): Promise<TagCategory | null>
findTagCategoryById(id: number): Promise<TagCategory | null>
createTagCategory(partial: PartialTagCategory): Promise<TagCategory>
saveTagCategory(partial: PartialTagCategory): Promise<TagCategory>
findGameDataById(gameDataId: number): Promise<GameData | null>
findGameData(gameId: string): Promise<Array<GameData>>
createGameData(gameData: PartialGameData): Promise<GameData>
saveGameData(gameData: PartialGameData): Promise<GameData>
deleteGameData(id: number): Promise<void>
newTagFilterIndex(search: GameSearch): Promise<void>
findAllGameDevelopers(): Promise<Array<string>>
findAllGamePublishers(): Promise<Array<string>>
findAllGameSeries(): Promise<Array<string>>
findAllGameLibraries(): Promise<Array<string>>
addGamePlaytime(id: string, seconds: number): Promise<void>
clearPlaytimeTrackingById(gameId: string): Promise<void>
clearPlaytimeTracking(): Promise<void>
findAllGameStatuses(): Promise<Array<string>>
findAllGamePlayModes(): Promise<Array<string>>
findAllGameApplicationPaths(): Promise<Array<string>>
findPlatformAppPaths(): Promise<Record<string, Array<PlatformAppPath>>>
forceGamesActiveDataMostRecent(): Promise<void>
createGameRedirect(srcId: string, destId: string): Promise<void>
deleteGameRedirect(srcId: string, destId: string): Promise<void>
updateApplyCategories(cats: Array<RemoteCategory>): Promise<void>
updateApplyPlatforms(plats: Array<RemotePlatform>): Promise<void>
updateApplyTags(tags: Array<RemoteTag>): Promise<void>
updateApplyGames(games: RemoteGamesRes): Promise<void>
updateDeleteGames(games: RemoteDeletedGamesRes): Promise<void>
updateApplyRedirects(redirects: Array<GameRedirect>): Promise<void>
optimizeDatabase(): Promise<void>
newCustomIdOrder(customIdOrder: Array<string>): Promise<void>
}
export type TagVec = string[];