steamworks.js-timmy 0.1.0 → 0.1.2

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/index.d.ts CHANGED
@@ -1,514 +1,5 @@
1
- /* auto-generated by NAPI-RS */
2
- /* eslint-disable */
3
- export declare function init(appId?: number | undefined | null): void
4
-
5
- export interface PlayerSteamId {
6
- steamId64: bigint
7
- steamId32: string
8
- accountId: number
9
- }
10
-
11
- export declare function restartAppIfNecessary(appId: number): boolean
12
-
13
- export declare function runCallbacks(): void
14
-
15
- export declare namespace achievement {
16
- export function activate(achievement: string): boolean
17
- export function clear(achievement: string): boolean
18
- export function isActivated(achievement: string): boolean
19
- export function names(): Array<string>
20
- }
21
-
22
- export declare namespace apps {
23
- export function appBuildId(): number
24
- export function appInstallDir(appId: number): string
25
- export function appOwner(): PlayerSteamId
26
- export function availableGameLanguages(): Array<string>
27
- export function currentBetaName(): string | null
28
- export function currentGameLanguage(): string
29
- export function isAppInstalled(appId: number): boolean
30
- export function isCybercafe(): boolean
31
- export function isDlcInstalled(appId: number): boolean
32
- export function isLowViolence(): boolean
33
- export function isSubscribed(): boolean
34
- export function isSubscribedApp(appId: number): boolean
35
- export function isSubscribedFromFreeWeekend(): boolean
36
- export function isVacBanned(): boolean
37
- }
38
-
39
- export declare namespace auth {
40
- export class Ticket {
41
- cancel(): void
42
- getBytes(): Buffer
43
- }
44
- export function getAuthTicketForWebApi(identity: string, timeoutSeconds?: number | undefined | null): Promise<Ticket>
45
- /**
46
- * @param ip - The string of IPv4 or IPv6 address. Use as NetworkIdentity of the remote system that will authenticate the ticket.
47
- * @param timeoutSeconds - The number of seconds to wait for the ticket to be validated. Default value is 10 seconds.
48
- */
49
- export function getSessionTicketWithIp(ip: string, timeoutSeconds?: number | undefined | null): Promise<Ticket>
50
- /**
51
- * @param steamId64 - The user steam id or game server steam id. Use as NetworkIdentity of the remote system that will authenticate the ticket. If it is peer-to-peer then the user steam ID. If it is a game server, then the game server steam ID may be used if it was obtained from a trusted 3rd party
52
- * @param timeoutSeconds - The number of seconds to wait for the ticket to be validated. Default value is 10 seconds.
53
- */
54
- export function getSessionTicketWithSteamId(steamId64: bigint, timeoutSeconds?: number | undefined | null): Promise<Ticket>
55
- }
56
-
57
- export declare namespace callback {
58
- export class Handle {
59
- disconnect(): void
60
- }
61
- export function register<C extends keyof import('./callbacks').CallbackReturns>(steamCallback: C, handler: (value: import('./callbacks').CallbackReturns[C]) => void): Handle
62
- export const enum SteamCallback {
63
- PersonaStateChange = 0,
64
- SteamServersConnected = 1,
65
- SteamServersDisconnected = 2,
66
- SteamServerConnectFailure = 3,
67
- LobbyDataUpdate = 4,
68
- LobbyChatUpdate = 5,
69
- P2PSessionRequest = 6,
70
- P2PSessionConnectFail = 7,
71
- GameLobbyJoinRequested = 8,
72
- MicroTxnAuthorizationResponse = 9
73
- }
74
- }
75
-
76
- export declare namespace cloud {
77
- export function deleteFile(name: string): boolean
78
- export function fileExists(name: string): boolean
79
- export interface FileInfo {
80
- name: string
81
- size: bigint
82
- }
83
- export function isEnabledForAccount(): boolean
84
- export function isEnabledForApp(): boolean
85
- export function listFiles(): Array<FileInfo>
86
- export function readFile(name: string): string
87
- export function setEnabledForApp(enabled: boolean): void
88
- export function writeFile(name: string, content: string): boolean
89
- }
90
-
91
- export declare namespace input {
92
- export class Controller {
93
- activateActionSet(actionSetHandle: bigint): void
94
- isDigitalActionPressed(actionHandle: bigint): boolean
95
- getAnalogActionVector(actionHandle: bigint): AnalogActionVector
96
- getType(): InputType
97
- getHandle(): bigint
98
- /** Gets controller latest data, best use for low latency if you call this all the time */
99
- runFrame(): void
100
- /** Gets controller's motion sensors */
101
- getMotionData(): MotionData | null
102
- }
103
- export interface AnalogActionVector {
104
- x: number
105
- y: number
106
- }
107
- export function getActionSet(actionSetName: string): bigint
108
- export function getAnalogAction(actionName: string): bigint
109
- export function getControllers(): Array<Controller>
110
- export function getDigitalAction(actionName: string): bigint
111
- export function init(): void
112
- export const enum InputType {
113
- Unknown = 'Unknown',
114
- SteamController = 'SteamController',
115
- XBox360Controller = 'XBox360Controller',
116
- XBoxOneController = 'XBoxOneController',
117
- GenericGamepad = 'GenericGamepad',
118
- PS4Controller = 'PS4Controller',
119
- AppleMFiController = 'AppleMFiController',
120
- AndroidController = 'AndroidController',
121
- SwitchJoyConPair = 'SwitchJoyConPair',
122
- SwitchJoyConSingle = 'SwitchJoyConSingle',
123
- SwitchProController = 'SwitchProController',
124
- MobileTouch = 'MobileTouch',
125
- PS3Controller = 'PS3Controller',
126
- PS5Controller = 'PS5Controller',
127
- SteamDeckController = 'SteamDeckController'
128
- }
129
- export interface MotionData {
130
- /** Absolute Rotation (drift) X axis */
131
- rotQuatX: number
132
- /** Absolute Rotation (drift) Y axis */
133
- rotQuatY: number
134
- /** Absolute Rotation (drift) Z axis */
135
- rotQuatZ: number
136
- /** Absolute Rotation (drift) W axis */
137
- rotQuatW: number
138
- /** Positional Acceleration X axis */
139
- posAccelX: number
140
- /** Positional Acceleration Y axis */
141
- posAccelY: number
142
- /** Positional Acceleration Z axis */
143
- posAccelZ: number
144
- /** Rotational Velocity X axis */
145
- rotVelX: number
146
- /** Rotational Velocity Y axis */
147
- rotVelY: number
148
- /** Rotational Velocity Z axis */
149
- rotVelZ: number
150
- }
151
- export function shutdown(): void
152
- }
153
-
154
- export declare namespace localplayer {
155
- /** @returns the 2 digit ISO 3166-1-alpha-2 format country code which client is running in, e.g. "US" or "UK". */
156
- export function getIpCountry(): string
157
- export function getLevel(): number
158
- export function getName(): string
159
- export function getSteamId(): PlayerSteamId
160
- export function setRichPresence(key: string, value?: string | undefined | null): void
161
- }
162
-
163
- export declare namespace matchmaking {
164
- export class Lobby {
165
- join(): Promise<Lobby>
166
- leave(): void
167
- openInviteDialog(): void
168
- getMemberCount(): bigint
169
- getMemberLimit(): bigint | null
170
- getMembers(): Array<PlayerSteamId>
171
- getOwner(): PlayerSteamId
172
- setJoinable(joinable: boolean): boolean
173
- getData(key: string): string | null
174
- setData(key: string, value: string): boolean
175
- deleteData(key: string): boolean
176
- /** Get an object containing all the lobby data */
177
- getFullData(): Record<string, string>
178
- /**
179
- * Merge current lobby data with provided data in a single batch
180
- * @returns true if all data was set successfully
181
- */
182
- mergeFullData(data: Record<string, string>): boolean
183
- get id(): bigint
184
- get idAsU64(): bigint
185
- }
186
- export function createLobby(lobbyType: LobbyType, maxMembers: number): Promise<Lobby>
187
- export function getLobbies(): Promise<Array<Lobby>>
188
- export function joinLobby(lobbyId: bigint): Promise<Lobby>
189
- export const enum LobbyType {
190
- Private = 0,
191
- FriendsOnly = 1,
192
- Public = 2,
193
- Invisible = 3
194
- }
195
- }
196
-
197
- export declare namespace networking {
198
- export function acceptP2PSession(steamId64: bigint): void
199
- export function isP2PPacketAvailable(): number
200
- export interface P2PPacket {
201
- data: Buffer
202
- size: number
203
- steamId: PlayerSteamId
204
- }
205
- export function readP2PPacket(size: number): P2PPacket
206
- export function sendP2PPacket(steamId64: bigint, sendType: SendType, data: Buffer): boolean
207
- /** The method used to send a packet */
208
- export const enum SendType {
209
- /**
210
- * Send the packet directly over udp.
211
- *
212
- * Can't be larger than 1200 bytes
213
- */
214
- Unreliable = 0,
215
- /**
216
- * Like `Unreliable` but doesn't buffer packets
217
- * sent before the connection has started.
218
- */
219
- UnreliableNoDelay = 1,
220
- /**
221
- * Reliable packet sending.
222
- *
223
- * Can't be larger than 1 megabyte.
224
- */
225
- Reliable = 2,
226
- /**
227
- * Like `Reliable` but applies the nagle
228
- * algorithm to packets being sent
229
- */
230
- ReliableWithBuffering = 3
231
- }
232
- }
233
-
234
- export declare namespace overlay {
235
- export function activateDialog(dialog: Dialog): void
236
- export function activateDialogToUser(dialog: Dialog, steamId64: bigint): void
237
- export function activateInviteDialog(lobbyId: bigint): void
238
- export function activateToStore(appId: number, flag: StoreFlag): void
239
- export function activateToWebPage(url: string): void
240
- export const enum Dialog {
241
- Friends = 0,
242
- Community = 1,
243
- Players = 2,
244
- Settings = 3,
245
- OfficialGameGroup = 4,
246
- Stats = 5,
247
- Achievements = 6
248
- }
249
- export const enum StoreFlag {
250
- None = 0,
251
- AddToCart = 1,
252
- AddToCartAndShow = 2
253
- }
254
- }
255
-
256
- export declare namespace stats {
257
- export function getInt(name: string): number | null
258
- export function resetAll(achievementsToo: boolean): boolean
259
- export function setInt(name: string, value: number): boolean
260
- export function store(): boolean
261
- }
262
-
263
- export declare namespace utils {
264
- export const enum FloatingGamepadTextInputMode {
265
- SingleLine = 0,
266
- MultipleLines = 1,
267
- Email = 2,
268
- Numeric = 3
269
- }
270
- export const enum GamepadTextInputLineMode {
271
- SingleLine = 0,
272
- MultipleLines = 1
273
- }
274
- export const enum GamepadTextInputMode {
275
- Normal = 0,
276
- Password = 1
277
- }
278
- export function getAppId(): number
279
- export function getServerRealTime(): number
280
- export function isSteamRunningOnSteamDeck(): boolean
281
- /** @returns true if the floating keyboard was shown, otherwise, false */
282
- export function showFloatingGamepadTextInput(keyboardMode: FloatingGamepadTextInputMode, x: number, y: number, width: number, height: number): Promise<boolean>
283
- /** @returns the entered text, or null if cancelled or could not show the input */
284
- export function showGamepadTextInput(inputMode: GamepadTextInputMode, inputLineMode: GamepadTextInputLineMode, description: string, maxCharacters: number, existingText?: string | undefined | null): Promise<string | null>
285
- }
286
-
287
- export declare namespace workshop {
288
- export interface AppIDs {
289
- creator?: number
290
- consumer?: number
291
- }
292
- export function createItem(appId?: number | undefined | null): Promise<UgcResult>
293
- export function deleteItem(itemId: bigint): Promise<void>
294
- /**
295
- * Download or update a workshop item.
296
- *
297
- * @param highPriority - If high priority is true, start the download in high priority mode, pausing any existing in-progress Steam downloads and immediately begin downloading this workshop item.
298
- * @returns true or false
299
- *
300
- * {@link https://partner.steamgames.com/doc/api/ISteamUGC#DownloadItem}
301
- */
302
- export function download(itemId: bigint, highPriority: boolean): boolean
303
- /**
304
- * Get info about a pending download of a workshop item.
305
- *
306
- * @returns an object with the properties {current, total}
307
- *
308
- * {@link https://partner.steamgames.com/doc/api/ISteamUGC#GetItemDownloadInfo}
309
- */
310
- export function downloadInfo(itemId: bigint): DownloadInfo | null
311
- export interface DownloadInfo {
312
- current: bigint
313
- total: bigint
314
- }
315
- export function getAllItems(page: number, queryType: UGCQueryType, itemType: UGCType, creatorAppId: number, consumerAppId: number, queryConfig?: WorkshopItemQueryConfig | undefined | null): Promise<WorkshopPaginatedResult>
316
- export function getItem(item: bigint, queryConfig?: WorkshopItemQueryConfig | undefined | null): Promise<WorkshopItem | null>
317
- export function getItems(items: Array<bigint>, queryConfig?: WorkshopItemQueryConfig | undefined | null): Promise<WorkshopItemsResult>
318
- /**
319
- * Get all subscribed workshop items.
320
- * @returns an array of subscribed workshop item ids
321
- */
322
- export function getSubscribedItems(): Array<bigint>
323
- export function getUserItems(page: number, accountId: number, listType: UserListType, itemType: UGCType, sortOrder: UserListOrder, appIds: AppIDs, queryConfig?: WorkshopItemQueryConfig | undefined | null): Promise<WorkshopPaginatedResult>
324
- /**
325
- * Gets info about currently installed content on the disc for workshop item.
326
- *
327
- * @returns an object with the the properties {folder, size_on_disk, timestamp}
328
- *
329
- * {@link https://partner.steamgames.com/doc/api/ISteamUGC#GetItemInstallInfo}
330
- */
331
- export function installInfo(itemId: bigint): InstallInfo | null
332
- export interface InstallInfo {
333
- folder: string
334
- sizeOnDisk: bigint
335
- timestamp: number
336
- }
337
- /**
338
- * Gets the current state of a workshop item on this client. States can be combined.
339
- *
340
- * @returns a number with the current item state, e.g. 9
341
- * 9 = 1 (The current user is subscribed to this item) + 8 (The item needs an update)
342
- *
343
- * {@link https://partner.steamgames.com/doc/api/ISteamUGC#GetItemState}
344
- * {@link https://partner.steamgames.com/doc/api/ISteamUGC#EItemState}
345
- */
346
- export function state(itemId: bigint): number
347
- /**
348
- * Subscribe to a workshop item. It will be downloaded and installed as soon as possible.
349
- *
350
- * {@link https://partner.steamgames.com/doc/api/ISteamUGC#SubscribeItem}
351
- */
352
- export function subscribe(itemId: bigint): Promise<void>
353
- export const enum UgcItemVisibility {
354
- Public = 0,
355
- FriendsOnly = 1,
356
- Private = 2,
357
- Unlisted = 3
358
- }
359
- export const enum UGCQueryType {
360
- RankedByVote = 0,
361
- RankedByPublicationDate = 1,
362
- AcceptedForGameRankedByAcceptanceDate = 2,
363
- RankedByTrend = 3,
364
- FavoritedByFriendsRankedByPublicationDate = 4,
365
- CreatedByFriendsRankedByPublicationDate = 5,
366
- RankedByNumTimesReported = 6,
367
- CreatedByFollowedUsersRankedByPublicationDate = 7,
368
- NotYetRated = 8,
369
- RankedByTotalVotesAsc = 9,
370
- RankedByVotesUp = 10,
371
- RankedByTextSearch = 11,
372
- RankedByTotalUniqueSubscriptions = 12,
373
- RankedByPlaytimeTrend = 13,
374
- RankedByTotalPlaytime = 14,
375
- RankedByAveragePlaytimeTrend = 15,
376
- RankedByLifetimeAveragePlaytime = 16,
377
- RankedByPlaytimeSessionsTrend = 17,
378
- RankedByLifetimePlaytimeSessions = 18,
379
- RankedByLastUpdatedDate = 19
380
- }
381
- export interface UgcResult {
382
- itemId: bigint
383
- needsToAcceptAgreement: boolean
384
- }
385
- export const enum UGCType {
386
- Items = 0,
387
- ItemsMtx = 1,
388
- ItemsReadyToUse = 2,
389
- Collections = 3,
390
- Artwork = 4,
391
- Videos = 5,
392
- Screenshots = 6,
393
- AllGuides = 7,
394
- WebGuides = 8,
395
- IntegratedGuides = 9,
396
- UsableInGame = 10,
397
- ControllerBindings = 11,
398
- GameManagedItems = 12,
399
- All = 13
400
- }
401
- export interface UgcUpdate {
402
- title?: string
403
- description?: string
404
- changeNote?: string
405
- previewPath?: string
406
- contentPath?: string
407
- tags?: Array<string>
408
- visibility?: UgcItemVisibility
409
- }
410
- /**
411
- * Unsubscribe from a workshop item. This will result in the item being removed after the game quits.
412
- *
413
- * {@link https://partner.steamgames.com/doc/api/ISteamUGC#UnsubscribeItem}
414
- */
415
- export function unsubscribe(itemId: bigint): Promise<void>
416
- export function updateItem(itemId: bigint, updateDetails: UgcUpdate, appId?: number | undefined | null): Promise<UgcResult>
417
- export function updateItemWithCallback(itemId: bigint, updateDetails: UgcUpdate, appId: number | undefined | null, successCallback: (data: UgcResult) => void, errorCallback: (err: any) => void, progressCallback?: (data: UpdateProgress) => void, progressCallbackIntervalMs?: number | undefined | null): void
418
- export interface UpdateProgress {
419
- status: UpdateStatus
420
- progress: bigint
421
- total: bigint
422
- }
423
- export const enum UpdateStatus {
424
- Invalid = 0,
425
- PreparingConfig = 1,
426
- PreparingContent = 2,
427
- UploadingContent = 3,
428
- UploadingPreviewFile = 4,
429
- CommittingChanges = 5
430
- }
431
- export const enum UserListOrder {
432
- CreationOrderAsc = 0,
433
- CreationOrderDesc = 1,
434
- TitleAsc = 2,
435
- LastUpdatedDesc = 3,
436
- SubscriptionDateDesc = 4,
437
- VoteScoreDesc = 5,
438
- ForModeration = 6
439
- }
440
- export const enum UserListType {
441
- Published = 0,
442
- VotedOn = 1,
443
- VotedUp = 2,
444
- VotedDown = 3,
445
- Favorited = 4,
446
- Subscribed = 5,
447
- UsedOrPlayed = 6,
448
- Followed = 7
449
- }
450
- export interface WorkshopItem {
451
- publishedFileId: bigint
452
- creatorAppId?: number
453
- consumerAppId?: number
454
- title: string
455
- description: string
456
- owner: PlayerSteamId
457
- /** Time created in unix epoch seconds format */
458
- timeCreated: number
459
- /** Time updated in unix epoch seconds format */
460
- timeUpdated: number
461
- /** Time when the user added the published item to their list (not always applicable), provided in Unix epoch format (time since Jan 1st, 1970). */
462
- timeAddedToUserList: number
463
- visibility: UgcItemVisibility
464
- banned: boolean
465
- acceptedForUse: boolean
466
- tags: Array<string>
467
- tagsTruncated: boolean
468
- url: string
469
- numUpvotes: number
470
- numDownvotes: number
471
- numChildren: number
472
- previewUrl?: string
473
- statistics: WorkshopItemStatistic
474
- }
475
- export interface WorkshopItemQueryConfig {
476
- cachedResponseMaxAge?: number
477
- includeMetadata?: boolean
478
- includeLongDescription?: boolean
479
- includeAdditionalPreviews?: boolean
480
- onlyIds?: boolean
481
- onlyTotal?: boolean
482
- language?: string
483
- matchAnyTag?: boolean
484
- requiredTags?: Array<string>
485
- excludedTags?: Array<string>
486
- searchText?: string
487
- rankedByTrendDays?: number
488
- }
489
- export interface WorkshopItemsResult {
490
- items: Array<WorkshopItem | undefined | null>
491
- wasCached: boolean
492
- }
493
- export interface WorkshopItemStatistic {
494
- numSubscriptions?: bigint
495
- numFavorites?: bigint
496
- numFollowers?: bigint
497
- numUniqueSubscriptions?: bigint
498
- numUniqueFavorites?: bigint
499
- numUniqueFollowers?: bigint
500
- numUniqueWebsiteViews?: bigint
501
- reportScore?: bigint
502
- numSecondsPlayed?: bigint
503
- numPlaytimeSessions?: bigint
504
- numComments?: bigint
505
- numSecondsPlayedDuringTimePeriod?: bigint
506
- numPlaytimeSessionsDuringTimePeriod?: bigint
507
- }
508
- export interface WorkshopPaginatedResult {
509
- items: Array<WorkshopItem | undefined | null>
510
- returnedResults: number
511
- totalResults: number
512
- wasCached: boolean
513
- }
514
- }
1
+ export function init(appId?: number): Omit<Client, "init" | "runCallbacks">;
2
+ export function restartAppIfNecessary(appId: number): boolean;
3
+ export function electronEnableSteamOverlay(disableEachFrameInvalidation?: boolean): void;
4
+ export type Client = typeof import("./client.d");
5
+ export const SteamCallback: typeof import("./client.d").callback.SteamCallback;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamworks.js-timmy",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "napi": {
@@ -42,6 +42,6 @@
42
42
  },
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "https://github.com/ceifa/steamworks.js"
45
+ "url": "https://github.com/timelessnesses/steamworks.js-inputs"
46
46
  }
47
47
  }