steamworks-ffi-node 0.5.0 → 0.5.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.
Files changed (42) hide show
  1. package/README.md +63 -6
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +7 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/internal/SteamFriendsManager.d.ts +368 -1
  7. package/dist/internal/SteamFriendsManager.d.ts.map +1 -1
  8. package/dist/internal/SteamFriendsManager.js +601 -0
  9. package/dist/internal/SteamFriendsManager.js.map +1 -1
  10. package/dist/internal/SteamLibraryLoader.d.ts +25 -0
  11. package/dist/internal/SteamLibraryLoader.d.ts.map +1 -1
  12. package/dist/internal/SteamLibraryLoader.js +30 -0
  13. package/dist/internal/SteamLibraryLoader.js.map +1 -1
  14. package/dist/internal/SteamOverlayManager.d.ts +407 -0
  15. package/dist/internal/SteamOverlayManager.d.ts.map +1 -0
  16. package/dist/internal/SteamOverlayManager.js +523 -0
  17. package/dist/internal/SteamOverlayManager.js.map +1 -0
  18. package/dist/internal/SteamRichPresenceManager.d.ts +265 -0
  19. package/dist/internal/SteamRichPresenceManager.d.ts.map +1 -0
  20. package/dist/internal/SteamRichPresenceManager.js +374 -0
  21. package/dist/internal/SteamRichPresenceManager.js.map +1 -0
  22. package/dist/steam.d.ts +63 -0
  23. package/dist/steam.d.ts.map +1 -1
  24. package/dist/steam.js +10 -0
  25. package/dist/steam.js.map +1 -1
  26. package/dist/types/friends.d.ts +16 -0
  27. package/dist/types/friends.d.ts.map +1 -1
  28. package/dist/types/friends.js +5 -1
  29. package/dist/types/friends.js.map +1 -1
  30. package/dist/types/index.d.ts +4 -0
  31. package/dist/types/index.d.ts.map +1 -1
  32. package/dist/types/index.js +6 -0
  33. package/dist/types/index.js.map +1 -1
  34. package/dist/types/overlay.d.ts +72 -0
  35. package/dist/types/overlay.d.ts.map +1 -0
  36. package/dist/types/overlay.js +79 -0
  37. package/dist/types/overlay.js.map +1 -0
  38. package/dist/types/richpresence.d.ts +43 -0
  39. package/dist/types/richpresence.d.ts.map +1 -0
  40. package/dist/types/richpresence.js +33 -0
  41. package/dist/types/richpresence.js.map +1 -0
  42. package/package.json +6 -4
package/README.md CHANGED
@@ -3,17 +3,23 @@
3
3
 
4
4
  # Steamworks FFI - Steamworks SDK Integration
5
5
 
6
- A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Koffi FFI, designed for Node.js and Electron applications with **Steamworks SDK integration**.
6
+ A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Koffi FFI, designed for Node.js and Electron applications with **Steamworks SDK v1.62 integration**.
7
7
 
8
8
  > ✅ **No C++ Compilation Required**: Uses Koffi FFI for seamless installation without Visual Studio Build Tools!
9
9
 
10
+ > ⚡ **Latest Steamworks SDK**: Built with Steamworks SDK v1.62 - includes all latest Steam features and improvements!
11
+
10
12
  > 🎉 **NEW: 100% Achievement API Coverage** - All 20 Steam achievement functions implemented! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/ACHIEVEMENT_MANAGER.md)
11
13
 
12
14
  > 🎉 **NEW: 100% Stats API Coverage** - All 14 Steam statistics functions implemented! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STATS_MANAGER.md)
13
15
 
14
16
  > 🎉 **NEW: 100% Leaderboard API Coverage** - All 7 Steam leaderboard functions implemented! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/LEADERBOARD_MANAGER.md)
15
17
 
16
- > 🎉 **NEW: Friends API** - 10 essential Steam friends and social functions implemented! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/FRIENDS_MANAGER.md)
18
+ > 🎉 **NEW: Friends API** - 22 complete Steam friends and social functions implemented! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/FRIENDS_MANAGER.md)
19
+
20
+ > 🎉 **NEW: Rich Presence API** - 6 functions for custom status display and friend join functionality! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/RICH_PRESENCE_MANAGER.md)
21
+
22
+ > 🎉 **NEW: Overlay API** - 7 functions for complete Steam overlay control! [See Documentation](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/OVERLAY_MANAGER.md)
17
23
 
18
24
  ## 🎯 Features
19
25
 
@@ -33,11 +39,25 @@ A production-ready TypeScript/JavaScript wrapper for the Steamworks SDK using Ko
33
39
  - ✅ Score operations (upload with optional details)
34
40
  - ✅ Entry download (global, friends, specific users)
35
41
  - ✅ UGC integration (attach replays/screenshots to entries)
36
- - **Friends & Social API**: Essential Steam friends and social features (10 core functions)
42
+ - **Friends & Social API**: Complete Steam friends and social features (22 functions)
37
43
  - ✅ Current user info (persona name, online state)
38
44
  - ✅ Friends list management (count, iterate, get all friends)
39
45
  - ✅ Friend information (names, states, relationships, Steam levels)
40
46
  - ✅ Friend activity (check games being played)
47
+ - ✅ Friend avatars (small/medium/large avatar handles)
48
+ - ✅ Friend groups (tags/categories management)
49
+ - ✅ Coplay tracking (recently played with users)
50
+ - **Rich Presence API**: Complete Rich Presence support (6 functions)
51
+ - ✅ Set/clear rich presence key/value pairs
52
+ - ✅ Query friend rich presence data
53
+ - ✅ Display custom status in friends list
54
+ - ✅ Enable friend join functionality
55
+ - **Overlay API**: Complete Steam overlay control (7 functions)
56
+ - ✅ Open overlay dialogs (friends, achievements, settings, etc.)
57
+ - ✅ Open user profiles, stats, and achievements
58
+ - ✅ Open overlay web browser to URLs
59
+ - ✅ Open store pages with purchase options
60
+ - ✅ Show invite dialogs for multiplayer sessions
41
61
  - **Steamworks Integration**: Direct FFI calls to Steamworks C++ SDK
42
62
  - **Cross-Platform**: Windows, macOS, and Linux support
43
63
  - **Batteries Included**: All Steamworks redistributables bundled - no SDK download needed!
@@ -133,12 +153,45 @@ if (initialized) {
133
153
  const level = steam.friends.getFriendSteamLevel(friend.steamId);
134
154
  console.log(`${name}: Level ${level}, Status: ${state}`);
135
155
 
156
+ // Get avatar handles
157
+ const smallAvatar = steam.friends.getSmallFriendAvatar(friend.steamId);
158
+ const mediumAvatar = steam.friends.getMediumFriendAvatar(friend.steamId);
159
+ if (smallAvatar > 0) {
160
+ console.log(` Avatar handles: small=${smallAvatar}, medium=${mediumAvatar}`);
161
+ }
162
+
136
163
  // Check if playing a game
137
164
  const gameInfo = steam.friends.getFriendGamePlayed(friend.steamId);
138
- if (gameInfo.playing) {
139
- console.log(` Playing: ${gameInfo.gameName} (AppID: ${gameInfo.gameId})`);
165
+ if (gameInfo) {
166
+ console.log(` Playing: App ${gameInfo.gameId}`);
140
167
  }
141
168
  });
169
+
170
+ // Check friend groups (tags)
171
+ const groupCount = steam.friends.getFriendsGroupCount();
172
+ if (groupCount > 0) {
173
+ const groupId = steam.friends.getFriendsGroupIDByIndex(0);
174
+ const groupName = steam.friends.getFriendsGroupName(groupId);
175
+ const members = steam.friends.getFriendsGroupMembersList(groupId);
176
+ console.log(`Group "${groupName}" has ${members.length} members`);
177
+ }
178
+
179
+ // Check recently played with
180
+ const coplayCount = steam.friends.getCoplayFriendCount();
181
+ if (coplayCount > 0) {
182
+ const recentPlayer = steam.friends.getCoplayFriend(0);
183
+ const playerName = steam.friends.getFriendPersonaName(recentPlayer);
184
+ const coplayTime = steam.friends.getFriendCoplayTime(recentPlayer);
185
+ console.log(`Recently played with ${playerName}`);
186
+ }
187
+
188
+ // Set rich presence for custom status
189
+ steam.richPresence.setRichPresence('status', 'In Main Menu');
190
+ steam.richPresence.setRichPresence('connect', '+connect server:27015');
191
+
192
+ // Open Steam overlay
193
+ steam.overlay.activateGameOverlay('Friends'); // Open friends list
194
+ steam.overlay.activateGameOverlayToWebPage('https://example.com/wiki'); // Open wiki
142
195
  }
143
196
 
144
197
  // Cleanup
@@ -187,7 +240,9 @@ Complete documentation for all APIs is available in the [docs folder](https://gi
187
240
  - **[Achievement Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/ACHIEVEMENT_MANAGER.md)** - Complete achievement system (20 functions)
188
241
  - **[Stats Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/STATS_MANAGER.md)** - User and global statistics (14 functions)
189
242
  - **[Leaderboard Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/LEADERBOARD_MANAGER.md)** - Leaderboard operations (7 functions)
190
- - **[Friends Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/FRIENDS_MANAGER.md)** - Friends and social features (10 functions)
243
+ - **[Friends Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/FRIENDS_MANAGER.md)** - Friends and social features (22 functions)
244
+ - **[Rich Presence Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/RICH_PRESENCE_MANAGER.md)** - Custom status display and join functionality (6 functions)
245
+ - **[Overlay Manager](https://github.com/ArtyProf/steamworks-ffi-node/blob/main/docs/OVERLAY_MANAGER.md)** - Steam overlay control (7 functions)
191
246
 
192
247
  ## 🎮 Steamworks Integration
193
248
 
@@ -291,6 +346,8 @@ This ensures native libraries work correctly in packaged Electron apps!
291
346
  - ✅ **macOS**: Included (libsteam_api.dylib)
292
347
  - ✅ **Linux**: Included (libsteam_api.so)
293
348
 
349
+ **Steamworks SDK Version**: v1.62 (Latest)
350
+
294
351
  All redistributable binaries are included in the package - no manual SDK download required!
295
352
 
296
353
  ## 🔧 Troubleshooting
package/dist/index.d.ts CHANGED
@@ -2,6 +2,9 @@ import SteamworksSDK from './steam';
2
2
  export { SteamAchievementManager } from './internal/SteamAchievementManager';
3
3
  export { SteamStatsManager } from './internal/SteamStatsManager';
4
4
  export { SteamLeaderboardManager } from './internal/SteamLeaderboardManager';
5
+ export { SteamFriendsManager } from './internal/SteamFriendsManager';
6
+ export { SteamRichPresenceManager } from './internal/SteamRichPresenceManager';
7
+ export { SteamOverlayManager } from './internal/SteamOverlayManager';
5
8
  export * from './types';
6
9
  export default SteamworksSDK;
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,SAAS,CAAC;AAGpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,cAAc,SAAS,CAAC;AAGxB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,SAAS,CAAC;AAGpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,cAAc,SAAS,CAAC;AAGxB,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.SteamLeaderboardManager = exports.SteamStatsManager = exports.SteamAchievementManager = void 0;
20
+ exports.SteamOverlayManager = exports.SteamRichPresenceManager = exports.SteamFriendsManager = exports.SteamLeaderboardManager = exports.SteamStatsManager = exports.SteamAchievementManager = void 0;
21
21
  const steam_1 = __importDefault(require("./steam"));
22
22
  // Export manager classes for advanced usage
23
23
  var SteamAchievementManager_1 = require("./internal/SteamAchievementManager");
@@ -26,6 +26,12 @@ var SteamStatsManager_1 = require("./internal/SteamStatsManager");
26
26
  Object.defineProperty(exports, "SteamStatsManager", { enumerable: true, get: function () { return SteamStatsManager_1.SteamStatsManager; } });
27
27
  var SteamLeaderboardManager_1 = require("./internal/SteamLeaderboardManager");
28
28
  Object.defineProperty(exports, "SteamLeaderboardManager", { enumerable: true, get: function () { return SteamLeaderboardManager_1.SteamLeaderboardManager; } });
29
+ var SteamFriendsManager_1 = require("./internal/SteamFriendsManager");
30
+ Object.defineProperty(exports, "SteamFriendsManager", { enumerable: true, get: function () { return SteamFriendsManager_1.SteamFriendsManager; } });
31
+ var SteamRichPresenceManager_1 = require("./internal/SteamRichPresenceManager");
32
+ Object.defineProperty(exports, "SteamRichPresenceManager", { enumerable: true, get: function () { return SteamRichPresenceManager_1.SteamRichPresenceManager; } });
33
+ var SteamOverlayManager_1 = require("./internal/SteamOverlayManager");
34
+ Object.defineProperty(exports, "SteamOverlayManager", { enumerable: true, get: function () { return SteamOverlayManager_1.SteamOverlayManager; } });
29
35
  // Export all types from organized structure
30
36
  __exportStar(require("./types"), exports);
31
37
  // Export main Steam class
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAAoC;AAEpC,4CAA4C;AAC5C,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,kEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAC1B,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAEhC,4CAA4C;AAC5C,0CAAwB;AAExB,0BAA0B;AAC1B,kBAAe,eAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAAoC;AAEpC,4CAA4C;AAC5C,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,kEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAC1B,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,sEAAqE;AAA5D,0HAAA,mBAAmB,OAAA;AAC5B,gFAA+E;AAAtE,oIAAA,wBAAwB,OAAA;AACjC,sEAAqE;AAA5D,0HAAA,mBAAmB,OAAA;AAE5B,4CAA4C;AAC5C,0CAAwB;AAExB,0BAA0B;AAC1B,kBAAe,eAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { SteamLibraryLoader } from './SteamLibraryLoader';
2
2
  import { SteamAPICore } from './SteamAPICore';
3
- import { EFriendRelationship, EPersonaState, EFriendFlags, FriendInfo, FriendGameInfo } from '../types';
3
+ import { EFriendRelationship, EPersonaState, EFriendFlags, FriendInfo, FriendGameInfo, FriendsGroupID_t } from '../types';
4
4
  /**
5
5
  * Manager for Steam Friends API operations
6
6
  *
@@ -361,5 +361,372 @@ export declare class SteamFriendsManager {
361
361
  * @see {@link FriendGameInfo}
362
362
  */
363
363
  getFriendGamePlayed(steamId: string): FriendGameInfo | null;
364
+ /**
365
+ * Gets the handle for a friend's small (32x32) avatar image
366
+ *
367
+ * @param steamId - The friend's Steam ID as a string
368
+ * @returns Image handle for use with ISteamUtils, or 0 if unavailable
369
+ *
370
+ * @remarks
371
+ * This returns a handle that can be used with ISteamUtils::GetImageSize()
372
+ * and ISteamUtils::GetImageRGBA() to retrieve the actual image data.
373
+ *
374
+ * Small avatars are 32x32 pixels and are suitable for:
375
+ * - Friend list thumbnails
376
+ * - Chat message icons
377
+ * - Compact UI elements
378
+ *
379
+ * The avatar image is cached by Steam. If it returns 0, the image might
380
+ * still be loading. You can try again after a short delay.
381
+ *
382
+ * @example
383
+ * ```typescript
384
+ * const avatarHandle = steam.friends.getSmallFriendAvatar(friendSteamId);
385
+ * if (avatarHandle > 0) {
386
+ * console.log(`Small avatar handle: ${avatarHandle}`);
387
+ * // Use with ISteamUtils to get actual image data
388
+ * }
389
+ * ```
390
+ *
391
+ * @see {@link getMediumFriendAvatar}
392
+ * @see {@link getLargeFriendAvatar}
393
+ */
394
+ getSmallFriendAvatar(steamId: string): number;
395
+ /**
396
+ * Gets the handle for a friend's medium (64x64) avatar image
397
+ *
398
+ * @param steamId - The friend's Steam ID as a string
399
+ * @returns Image handle for use with ISteamUtils, or 0 if unavailable
400
+ *
401
+ * @remarks
402
+ * This returns a handle that can be used with ISteamUtils::GetImageSize()
403
+ * and ISteamUtils::GetImageRGBA() to retrieve the actual image data.
404
+ *
405
+ * Medium avatars are 64x64 pixels and are suitable for:
406
+ * - User profiles
407
+ * - Game lobby player lists
408
+ * - Standard UI elements
409
+ *
410
+ * The avatar image is cached by Steam. If it returns 0, the image might
411
+ * still be loading. You can try again after a short delay.
412
+ *
413
+ * @example
414
+ * ```typescript
415
+ * const avatarHandle = steam.friends.getMediumFriendAvatar(friendSteamId);
416
+ * if (avatarHandle > 0) {
417
+ * console.log(`Medium avatar handle: ${avatarHandle}`);
418
+ * // Use with ISteamUtils to get actual image data
419
+ * }
420
+ * ```
421
+ *
422
+ * @see {@link getSmallFriendAvatar}
423
+ * @see {@link getLargeFriendAvatar}
424
+ */
425
+ getMediumFriendAvatar(steamId: string): number;
426
+ /**
427
+ * Gets the handle for a friend's large (184x184) avatar image
428
+ *
429
+ * @param steamId - The friend's Steam ID as a string
430
+ * @returns Image handle for use with ISteamUtils, or 0 if unavailable
431
+ *
432
+ * @remarks
433
+ * This returns a handle that can be used with ISteamUtils::GetImageSize()
434
+ * and ISteamUtils::GetImageRGBA() to retrieve the actual image data.
435
+ *
436
+ * Large avatars are 184x184 pixels and are suitable for:
437
+ * - Detailed profile views
438
+ * - Full-screen overlays
439
+ * - High-resolution displays
440
+ *
441
+ * The avatar image is cached by Steam. If it returns 0, the image might
442
+ * still be loading. You can try again after a short delay.
443
+ *
444
+ * @example
445
+ * ```typescript
446
+ * const avatarHandle = steam.friends.getLargeFriendAvatar(friendSteamId);
447
+ * if (avatarHandle > 0) {
448
+ * console.log(`Large avatar handle: ${avatarHandle}`);
449
+ * // Use with ISteamUtils to get actual image data
450
+ * }
451
+ * ```
452
+ *
453
+ * @see {@link getSmallFriendAvatar}
454
+ * @see {@link getMediumFriendAvatar}
455
+ */
456
+ getLargeFriendAvatar(steamId: string): number;
457
+ /**
458
+ * Gets the number of Steam friend groups (tags) the user has created
459
+ *
460
+ * @returns The number of friend groups, or 0 if unavailable
461
+ *
462
+ * @remarks
463
+ * Steam allows users to organize friends into custom groups (also called tags).
464
+ * This returns the total number of groups the current user has created.
465
+ *
466
+ * Use this with {@link getFriendsGroupIDByIndex} to iterate through all groups.
467
+ *
468
+ * @example
469
+ * ```typescript
470
+ * const groupCount = steam.friends.getFriendsGroupCount();
471
+ * console.log(`You have ${groupCount} friend groups`);
472
+ *
473
+ * for (let i = 0; i < groupCount; i++) {
474
+ * const groupId = steam.friends.getFriendsGroupIDByIndex(i);
475
+ * const groupName = steam.friends.getFriendsGroupName(groupId);
476
+ * console.log(`Group ${i}: ${groupName}`);
477
+ * }
478
+ * ```
479
+ *
480
+ * @see {@link getFriendsGroupIDByIndex}
481
+ * @see {@link getFriendsGroupName}
482
+ */
483
+ getFriendsGroupCount(): number;
484
+ /**
485
+ * Gets a friend group ID by its index
486
+ *
487
+ * @param index - Zero-based index of the group (0 to {@link getFriendsGroupCount}() - 1)
488
+ * @returns The group ID, or {@link INVALID_FRIENDS_GROUP_ID} if the index is invalid
489
+ *
490
+ * @remarks
491
+ * Use this method to iterate through all friend groups:
492
+ * 1. Call {@link getFriendsGroupCount} to get the total number of groups
493
+ * 2. Loop from 0 to count-1 calling this method to get each group ID
494
+ * 3. Use the returned ID with {@link getFriendsGroupName} and {@link getFriendsGroupMembersList}
495
+ *
496
+ * @example
497
+ * ```typescript
498
+ * const groupCount = steam.friends.getFriendsGroupCount();
499
+ * for (let i = 0; i < groupCount; i++) {
500
+ * const groupId = steam.friends.getFriendsGroupIDByIndex(i);
501
+ * if (groupId !== INVALID_FRIENDS_GROUP_ID) {
502
+ * const name = steam.friends.getFriendsGroupName(groupId);
503
+ * const memberCount = steam.friends.getFriendsGroupMembersCount(groupId);
504
+ * console.log(`Group: ${name} (${memberCount} members)`);
505
+ * }
506
+ * }
507
+ * ```
508
+ *
509
+ * @see {@link getFriendsGroupCount}
510
+ * @see {@link getFriendsGroupName}
511
+ * @see {@link INVALID_FRIENDS_GROUP_ID}
512
+ */
513
+ getFriendsGroupIDByIndex(index: number): FriendsGroupID_t;
514
+ /**
515
+ * Gets the name of a friend group
516
+ *
517
+ * @param groupId - The ID of the friend group
518
+ * @returns The group name, or empty string if unavailable
519
+ *
520
+ * @remarks
521
+ * Returns the user-defined name for the specified friend group.
522
+ * Group names are created and managed by the user in the Steam client.
523
+ *
524
+ * @example
525
+ * ```typescript
526
+ * const groupId = steam.friends.getFriendsGroupIDByIndex(0);
527
+ * if (groupId !== INVALID_FRIENDS_GROUP_ID) {
528
+ * const name = steam.friends.getFriendsGroupName(groupId);
529
+ * console.log(`First group is named: ${name}`);
530
+ * }
531
+ * ```
532
+ *
533
+ * @see {@link getFriendsGroupIDByIndex}
534
+ * @see {@link getFriendsGroupMembersCount}
535
+ */
536
+ getFriendsGroupName(groupId: FriendsGroupID_t): string;
537
+ /**
538
+ * Gets the number of members in a friend group
539
+ *
540
+ * @param groupId - The ID of the friend group
541
+ * @returns The number of friends in the group, or 0 if unavailable
542
+ *
543
+ * @remarks
544
+ * Returns how many friends are assigned to the specified group.
545
+ * Use this with {@link getFriendsGroupMembersList} to retrieve the actual members.
546
+ *
547
+ * @example
548
+ * ```typescript
549
+ * const groupId = steam.friends.getFriendsGroupIDByIndex(0);
550
+ * const memberCount = steam.friends.getFriendsGroupMembersCount(groupId);
551
+ * console.log(`Group has ${memberCount} members`);
552
+ * ```
553
+ *
554
+ * @see {@link getFriendsGroupMembersList}
555
+ * @see {@link getFriendsGroupName}
556
+ */
557
+ getFriendsGroupMembersCount(groupId: FriendsGroupID_t): number;
558
+ /**
559
+ * Gets the list of Steam IDs for all members in a friend group
560
+ *
561
+ * @param groupId - The ID of the friend group
562
+ * @returns Array of Steam IDs (as strings) of friends in the group
563
+ *
564
+ * @remarks
565
+ * Returns an array containing the Steam ID of each friend assigned to this group.
566
+ * The array will be empty if the group has no members or if an error occurs.
567
+ *
568
+ * This method allocates memory for the maximum possible members and then
569
+ * populates it with the actual members. The returned array only contains
570
+ * the actual members, not the full allocated buffer.
571
+ *
572
+ * @example
573
+ * ```typescript
574
+ * const groupId = steam.friends.getFriendsGroupIDByIndex(0);
575
+ * const groupName = steam.friends.getFriendsGroupName(groupId);
576
+ * const members = steam.friends.getFriendsGroupMembersList(groupId);
577
+ *
578
+ * console.log(`Group "${groupName}" has ${members.length} members:`);
579
+ * members.forEach(steamId => {
580
+ * const name = steam.friends.getFriendPersonaName(steamId);
581
+ * console.log(` - ${name} (${steamId})`);
582
+ * });
583
+ * ```
584
+ *
585
+ * @see {@link getFriendsGroupMembersCount}
586
+ * @see {@link getFriendsGroupName}
587
+ */
588
+ getFriendsGroupMembersList(groupId: FriendsGroupID_t): string[];
589
+ /**
590
+ * Gets the number of users the current user has recently played with
591
+ *
592
+ * @returns The number of coplay friends, or 0 if unavailable
593
+ *
594
+ * @remarks
595
+ * "Coplay" refers to users you've recently been in multiplayer games with.
596
+ * Steam tracks these relationships automatically when you play games together.
597
+ *
598
+ * Use this with {@link getCoplayFriend} to iterate through all coplay friends.
599
+ *
600
+ * @example
601
+ * ```typescript
602
+ * const coplayCount = steam.friends.getCoplayFriendCount();
603
+ * console.log(`You've recently played with ${coplayCount} users`);
604
+ *
605
+ * for (let i = 0; i < coplayCount; i++) {
606
+ * const steamId = steam.friends.getCoplayFriend(i);
607
+ * const name = steam.friends.getFriendPersonaName(steamId);
608
+ * const time = steam.friends.getFriendCoplayTime(steamId);
609
+ * console.log(`Played with ${name} at ${new Date(time * 1000)}`);
610
+ * }
611
+ * ```
612
+ *
613
+ * @see {@link getCoplayFriend}
614
+ * @see {@link getFriendCoplayTime}
615
+ * @see {@link getFriendCoplayGame}
616
+ */
617
+ getCoplayFriendCount(): number;
618
+ /**
619
+ * Gets a coplay friend's Steam ID by their index
620
+ *
621
+ * @param index - Zero-based index of the coplay friend (0 to {@link getCoplayFriendCount}() - 1)
622
+ * @returns The friend's Steam ID as a string, or empty string if the index is invalid
623
+ *
624
+ * @remarks
625
+ * Use this method to iterate through all users you've recently played with:
626
+ * 1. Call {@link getCoplayFriendCount} to get the total number
627
+ * 2. Loop from 0 to count-1 calling this method to get each Steam ID
628
+ * 3. Use the returned ID with {@link getFriendCoplayTime} and {@link getFriendCoplayGame}
629
+ *
630
+ * @example
631
+ * ```typescript
632
+ * const count = steam.friends.getCoplayFriendCount();
633
+ * for (let i = 0; i < count; i++) {
634
+ * const steamId = steam.friends.getCoplayFriend(i);
635
+ * if (steamId) {
636
+ * const name = steam.friends.getFriendPersonaName(steamId);
637
+ * const appId = steam.friends.getFriendCoplayGame(steamId);
638
+ * console.log(`Played with ${name} in app ${appId}`);
639
+ * }
640
+ * }
641
+ * ```
642
+ *
643
+ * @see {@link getCoplayFriendCount}
644
+ * @see {@link getFriendCoplayTime}
645
+ */
646
+ getCoplayFriend(index: number): string;
647
+ /**
648
+ * Gets the last time you played with a specific user
649
+ *
650
+ * @param steamId - The friend's Steam ID as a string
651
+ * @returns Unix timestamp of when you last played together, or 0 if never/unavailable
652
+ *
653
+ * @remarks
654
+ * Returns the Unix timestamp (seconds since January 1, 1970) of the most recent
655
+ * time you were in a multiplayer game with this user.
656
+ *
657
+ * Returns 0 if:
658
+ * - You've never played with this user
659
+ * - The information is not available
660
+ * - The Steam API is not initialized
661
+ *
662
+ * @example
663
+ * ```typescript
664
+ * const steamId = steam.friends.getCoplayFriend(0);
665
+ * const timestamp = steam.friends.getFriendCoplayTime(steamId);
666
+ *
667
+ * if (timestamp > 0) {
668
+ * const date = new Date(timestamp * 1000);
669
+ * console.log(`Last played together on: ${date.toLocaleDateString()}`);
670
+ * }
671
+ * ```
672
+ *
673
+ * @see {@link getCoplayFriend}
674
+ * @see {@link getFriendCoplayGame}
675
+ */
676
+ getFriendCoplayTime(steamId: string): number;
677
+ /**
678
+ * Gets the App ID of the game you last played with a specific user
679
+ *
680
+ * @param steamId - The friend's Steam ID as a string
681
+ * @returns The Steam App ID of the game, or 0 if never/unavailable
682
+ *
683
+ * @remarks
684
+ * Returns the Steam App ID of the game you most recently played together with this user.
685
+ *
686
+ * Returns 0 if:
687
+ * - You've never played with this user
688
+ * - The information is not available
689
+ * - The Steam API is not initialized
690
+ *
691
+ * @example
692
+ * ```typescript
693
+ * const count = steam.friends.getCoplayFriendCount();
694
+ * for (let i = 0; i < count; i++) {
695
+ * const steamId = steam.friends.getCoplayFriend(i);
696
+ * const name = steam.friends.getFriendPersonaName(steamId);
697
+ * const appId = steam.friends.getFriendCoplayGame(steamId);
698
+ * const time = steam.friends.getFriendCoplayTime(steamId);
699
+ *
700
+ * console.log(`Played with ${name} in App ${appId}`);
701
+ * console.log(`Last played: ${new Date(time * 1000).toLocaleDateString()}`);
702
+ * }
703
+ * ```
704
+ *
705
+ * @example Get all coplay information
706
+ * ```typescript
707
+ * function getAllCoplayInfo(): CoplayFriendInfo[] {
708
+ * const count = steam.friends.getCoplayFriendCount();
709
+ * const coplayFriends: CoplayFriendInfo[] = [];
710
+ *
711
+ * for (let i = 0; i < count; i++) {
712
+ * const steamId = steam.friends.getCoplayFriend(i);
713
+ * if (steamId) {
714
+ * coplayFriends.push({
715
+ * steamId,
716
+ * coplayTime: steam.friends.getFriendCoplayTime(steamId),
717
+ * coplayGame: steam.friends.getFriendCoplayGame(steamId)
718
+ * });
719
+ * }
720
+ * }
721
+ *
722
+ * return coplayFriends;
723
+ * }
724
+ * ```
725
+ *
726
+ * @see {@link getCoplayFriend}
727
+ * @see {@link getFriendCoplayTime}
728
+ * @see {@link CoplayFriendInfo}
729
+ */
730
+ getFriendCoplayGame(steamId: string): number;
364
731
  }
365
732
  //# sourceMappingURL=SteamFriendsManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Ste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