steamworks-ffi-node 0.6.0 → 0.6.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/README.md +74 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/SteamAPICore.d.ts +23 -0
- package/dist/internal/SteamAPICore.d.ts.map +1 -1
- package/dist/internal/SteamAPICore.js +30 -0
- package/dist/internal/SteamAPICore.js.map +1 -1
- package/dist/internal/SteamCallbackPoller.d.ts +72 -0
- package/dist/internal/SteamCallbackPoller.d.ts.map +1 -1
- package/dist/internal/SteamCallbackPoller.js +144 -2
- package/dist/internal/SteamCallbackPoller.js.map +1 -1
- package/dist/internal/SteamCloudManager.d.ts.map +1 -1
- package/dist/internal/SteamCloudManager.js +18 -18
- package/dist/internal/SteamCloudManager.js.map +1 -1
- package/dist/internal/SteamLibraryLoader.d.ts +27 -0
- package/dist/internal/SteamLibraryLoader.d.ts.map +1 -1
- package/dist/internal/SteamLibraryLoader.js +43 -2
- package/dist/internal/SteamLibraryLoader.js.map +1 -1
- package/dist/internal/SteamOverlayManager.js +21 -21
- package/dist/internal/SteamOverlayManager.js.map +1 -1
- package/dist/internal/SteamRichPresenceManager.js +18 -18
- package/dist/internal/SteamRichPresenceManager.js.map +1 -1
- package/dist/internal/SteamWorkshopManager.d.ts +602 -0
- package/dist/internal/SteamWorkshopManager.d.ts.map +1 -0
- package/dist/internal/SteamWorkshopManager.js +1426 -0
- package/dist/internal/SteamWorkshopManager.js.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.d.ts +26 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.d.ts.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.js +35 -0
- package/dist/internal/callbackTypes/SteamCallbackIds.js.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.d.ts +89 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.d.ts.map +1 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.js +9 -0
- package/dist/internal/callbackTypes/SteamCallbackTypes.js.map +1 -0
- package/dist/internal/callbackTypes/index.d.ts +6 -0
- package/dist/internal/callbackTypes/index.d.ts.map +1 -0
- package/dist/internal/callbackTypes/index.js +22 -0
- package/dist/internal/callbackTypes/index.js.map +1 -0
- package/dist/steam.d.ts +42 -0
- package/dist/steam.d.ts.map +1 -1
- package/dist/steam.js +4 -0
- package/dist/steam.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/workshop.d.ts +302 -0
- package/dist/types/workshop.d.ts.map +1 -0
- package/dist/types/workshop.js +203 -0
- package/dist/types/workshop.js.map +1 -0
- package/docs/README.md +12 -0
- package/package.json +3 -1
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import { SteamLibraryLoader } from './SteamLibraryLoader';
|
|
2
|
+
import { SteamAPICore } from './SteamAPICore';
|
|
3
|
+
import { PublishedFileId, UGCQueryHandle, UGCUpdateHandle, WorkshopItem, ItemInstallInfo, ItemDownloadInfo, ItemUpdateProgress, EUGCMatchingUGCType, EUserUGCList, EUserUGCListSortOrder, EUGCQuery, EWorkshopFileType, ERemoteStoragePublishedFileVisibility } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Manager for Steam Workshop / User Generated Content (UGC) operations
|
|
6
|
+
*
|
|
7
|
+
* The SteamWorkshopManager provides comprehensive access to Steam's Workshop system,
|
|
8
|
+
* allowing you to browse, subscribe to, create, and manage user-generated content.
|
|
9
|
+
*
|
|
10
|
+
* Key Features:
|
|
11
|
+
* - Query and browse Workshop items
|
|
12
|
+
* - Subscribe/unsubscribe to Workshop content
|
|
13
|
+
* - Download and install Workshop items
|
|
14
|
+
* - Create and update your own Workshop items
|
|
15
|
+
* - Vote on and favorite Workshop content
|
|
16
|
+
* - Track download and installation progress
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* All methods require the Steam API to be initialized.
|
|
20
|
+
* Workshop items are automatically downloaded and installed when subscribed.
|
|
21
|
+
*
|
|
22
|
+
* @example Basic subscription
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const steam = SteamworksSDK.getInstance();
|
|
25
|
+
* steam.init({ appId: 480 });
|
|
26
|
+
*
|
|
27
|
+
* // Subscribe to a Workshop item
|
|
28
|
+
* const itemId = BigInt('123456789');
|
|
29
|
+
* await steam.workshop.subscribeItem(itemId);
|
|
30
|
+
*
|
|
31
|
+
* // Check if subscribed
|
|
32
|
+
* const subscribed = steam.workshop.getSubscribedItems();
|
|
33
|
+
* console.log(`Subscribed to ${subscribed.length} items`);
|
|
34
|
+
*
|
|
35
|
+
* // Get installation info
|
|
36
|
+
* const info = steam.workshop.getItemInstallInfo(itemId);
|
|
37
|
+
* if (info) {
|
|
38
|
+
* console.log(`Installed at: ${info.folder}`);
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example Query Workshop items
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // Query popular items
|
|
45
|
+
* const query = steam.workshop.createQueryAllUGCRequest(
|
|
46
|
+
* EUGCQuery.RankedByVote,
|
|
47
|
+
* EUGCMatchingUGCType.Items,
|
|
48
|
+
* 1 // page 1
|
|
49
|
+
* );
|
|
50
|
+
*
|
|
51
|
+
* // Results come through callbacks
|
|
52
|
+
* // Listen for query completion in your callback handler
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @see {@link https://partner.steamgames.com/doc/api/ISteamUGC ISteamUGC Documentation}
|
|
56
|
+
*/
|
|
57
|
+
export declare class SteamWorkshopManager {
|
|
58
|
+
/** Steam library loader for FFI function calls */
|
|
59
|
+
private libraryLoader;
|
|
60
|
+
/** Steam API core for accessing interfaces */
|
|
61
|
+
private apiCore;
|
|
62
|
+
/** Callback poller for async operations */
|
|
63
|
+
private callbackPoller;
|
|
64
|
+
constructor(libraryLoader: SteamLibraryLoader, apiCore: SteamAPICore);
|
|
65
|
+
/**
|
|
66
|
+
* Subscribes to a Workshop item
|
|
67
|
+
*
|
|
68
|
+
* @param publishedFileId - The Workshop item ID to subscribe to
|
|
69
|
+
* @returns True if subscription was successful, false otherwise
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* - Item will be automatically downloaded and installed
|
|
73
|
+
* - Use getItemInstallInfo() to check installation status
|
|
74
|
+
* - Use getItemDownloadInfo() to track download progress
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const itemId = BigInt('123456789');
|
|
79
|
+
* const success = await steam.workshop.subscribeItem(itemId);
|
|
80
|
+
*
|
|
81
|
+
* if (success) {
|
|
82
|
+
* console.log('Successfully subscribed!');
|
|
83
|
+
* // Check download progress
|
|
84
|
+
* const progress = steam.workshop.getItemDownloadInfo(itemId);
|
|
85
|
+
* if (progress) {
|
|
86
|
+
* console.log(`Downloading: ${progress.percentComplete}%`);
|
|
87
|
+
* }
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
subscribeItem(publishedFileId: PublishedFileId): Promise<boolean>; /**
|
|
92
|
+
* Unsubscribes from a Workshop item
|
|
93
|
+
*
|
|
94
|
+
* @param publishedFileId - The Workshop item ID to unsubscribe from
|
|
95
|
+
* @returns True if unsubscription was successful, false otherwise
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* - Item will be uninstalled after the game quits
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const itemId = BigInt('123456789');
|
|
103
|
+
* const success = await steam.workshop.unsubscribeItem(itemId);
|
|
104
|
+
*
|
|
105
|
+
* if (success) {
|
|
106
|
+
* console.log('Successfully unsubscribed!');
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
unsubscribeItem(publishedFileId: PublishedFileId): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the number of subscribed Workshop items
|
|
113
|
+
*
|
|
114
|
+
* @returns Number of subscribed items
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const count = steam.workshop.getNumSubscribedItems();
|
|
119
|
+
* console.log(`Subscribed to ${count} Workshop items`);
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
getNumSubscribedItems(): number;
|
|
123
|
+
/**
|
|
124
|
+
* Gets all subscribed Workshop item IDs
|
|
125
|
+
*
|
|
126
|
+
* @returns Array of subscribed Workshop item IDs
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const items = steam.workshop.getSubscribedItems();
|
|
131
|
+
* items.forEach(itemId => {
|
|
132
|
+
* console.log(`Subscribed to item: ${itemId}`);
|
|
133
|
+
* const info = steam.workshop.getItemInstallInfo(itemId);
|
|
134
|
+
* if (info) {
|
|
135
|
+
* console.log(` Installed at: ${info.folder}`);
|
|
136
|
+
* }
|
|
137
|
+
* });
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
getSubscribedItems(): PublishedFileId[];
|
|
141
|
+
/**
|
|
142
|
+
* Gets the state flags for a Workshop item
|
|
143
|
+
*
|
|
144
|
+
* @param publishedFileId - The Workshop item ID
|
|
145
|
+
* @returns State flags (combination of EItemState values)
|
|
146
|
+
*
|
|
147
|
+
* @remarks
|
|
148
|
+
* Use bitwise operations to check for specific states:
|
|
149
|
+
* - EItemState.Subscribed - User is subscribed
|
|
150
|
+
* - EItemState.Installed - Item is installed
|
|
151
|
+
* - EItemState.Downloading - Currently downloading
|
|
152
|
+
* - EItemState.NeedsUpdate - Update available
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const itemId = BigInt('123456789');
|
|
157
|
+
* const state = steam.workshop.getItemState(itemId);
|
|
158
|
+
*
|
|
159
|
+
* if (state & EItemState.Subscribed) {
|
|
160
|
+
* console.log('Subscribed');
|
|
161
|
+
* }
|
|
162
|
+
* if (state & EItemState.Installed) {
|
|
163
|
+
* console.log('Installed');
|
|
164
|
+
* }
|
|
165
|
+
* if (state & EItemState.Downloading) {
|
|
166
|
+
* console.log('Downloading...');
|
|
167
|
+
* }
|
|
168
|
+
* if (state & EItemState.NeedsUpdate) {
|
|
169
|
+
* console.log('Update available');
|
|
170
|
+
* }
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
getItemState(publishedFileId: PublishedFileId): number;
|
|
174
|
+
/**
|
|
175
|
+
* Gets installation information for a Workshop item
|
|
176
|
+
*
|
|
177
|
+
* @param publishedFileId - The Workshop item ID
|
|
178
|
+
* @returns Installation info or null if not installed
|
|
179
|
+
*
|
|
180
|
+
* @remarks
|
|
181
|
+
* Only returns data if item has EItemState.Installed flag set
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const itemId = BigInt('123456789');
|
|
186
|
+
* const info = steam.workshop.getItemInstallInfo(itemId);
|
|
187
|
+
*
|
|
188
|
+
* if (info) {
|
|
189
|
+
* console.log(`Installed at: ${info.folder}`);
|
|
190
|
+
* console.log(`Size on disk: ${info.sizeOnDisk} bytes`);
|
|
191
|
+
* console.log(`Install time: ${new Date(info.timestamp * 1000)}`);
|
|
192
|
+
* }
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
getItemInstallInfo(publishedFileId: PublishedFileId): ItemInstallInfo | null;
|
|
196
|
+
/**
|
|
197
|
+
* Gets download progress for a Workshop item
|
|
198
|
+
*
|
|
199
|
+
* @param publishedFileId - The Workshop item ID
|
|
200
|
+
* @returns Download info or null if not downloading
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* Only returns data if item has EItemState.Downloading flag set
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```typescript
|
|
207
|
+
* const itemId = BigInt('123456789');
|
|
208
|
+
* const progress = steam.workshop.getItemDownloadInfo(itemId);
|
|
209
|
+
*
|
|
210
|
+
* if (progress) {
|
|
211
|
+
* console.log(`Download: ${progress.percentComplete.toFixed(1)}%`);
|
|
212
|
+
* console.log(`${progress.bytesDownloaded} / ${progress.bytesTotal} bytes`);
|
|
213
|
+
* }
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
getItemDownloadInfo(publishedFileId: PublishedFileId): ItemDownloadInfo | null;
|
|
217
|
+
/**
|
|
218
|
+
* Downloads a Workshop item (forces download if not subscribed)
|
|
219
|
+
*
|
|
220
|
+
* @param publishedFileId - The Workshop item ID
|
|
221
|
+
* @param highPriority - If true, suspends other downloads and prioritizes this one
|
|
222
|
+
* @returns True if download started, false otherwise
|
|
223
|
+
*
|
|
224
|
+
* @remarks
|
|
225
|
+
* - If item is already installed, files should not be used until callback received
|
|
226
|
+
* - Listen for DownloadItemResult_t callback for completion
|
|
227
|
+
* - If not subscribed, item will be cached temporarily
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* const itemId = BigInt('123456789');
|
|
232
|
+
* const started = steam.workshop.downloadItem(itemId, true);
|
|
233
|
+
*
|
|
234
|
+
* if (started) {
|
|
235
|
+
* console.log('Download started');
|
|
236
|
+
* // Poll getItemDownloadInfo() for progress
|
|
237
|
+
* }
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
downloadItem(publishedFileId: PublishedFileId, highPriority?: boolean): boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Creates a query for a user's Workshop items
|
|
243
|
+
*
|
|
244
|
+
* @param accountId - Steam account ID (32-bit, lower part of SteamID)
|
|
245
|
+
* @param listType - Type of list to query
|
|
246
|
+
* @param matchingType - Type of UGC to match
|
|
247
|
+
* @param sortOrder - How to sort results
|
|
248
|
+
* @param creatorAppId - App that created the items
|
|
249
|
+
* @param consumerAppId - App that will consume the items
|
|
250
|
+
* @param page - Page number (1-based)
|
|
251
|
+
* @returns Query handle for use with sendQueryUGCRequest
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```typescript
|
|
255
|
+
* // Query current user's published items
|
|
256
|
+
* const accountId = 12345678; // Get from user's SteamID
|
|
257
|
+
* const query = steam.workshop.createQueryUserUGCRequest(
|
|
258
|
+
* accountId,
|
|
259
|
+
* EUserUGCList.Published,
|
|
260
|
+
* EUGCMatchingUGCType.Items,
|
|
261
|
+
* EUserUGCListSortOrder.CreationOrderDesc,
|
|
262
|
+
* 480, // Spacewar
|
|
263
|
+
* 480,
|
|
264
|
+
* 1 // First page
|
|
265
|
+
* );
|
|
266
|
+
*
|
|
267
|
+
* steam.workshop.sendQueryUGCRequest(query);
|
|
268
|
+
* // Wait for SteamUGCQueryCompleted_t callback
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
createQueryUserUGCRequest(accountId: number, listType: EUserUGCList, matchingType: EUGCMatchingUGCType, sortOrder: EUserUGCListSortOrder, creatorAppId: number, consumerAppId: number, page: number): UGCQueryHandle;
|
|
272
|
+
/**
|
|
273
|
+
* Creates a query for all Workshop items
|
|
274
|
+
*
|
|
275
|
+
* @param queryType - Type of query/sorting
|
|
276
|
+
* @param matchingType - Type of UGC to match
|
|
277
|
+
* @param creatorAppId - App that created the items
|
|
278
|
+
* @param consumerAppId - App that will consume the items
|
|
279
|
+
* @param page - Page number (1-based)
|
|
280
|
+
* @returns Query handle for use with sendQueryUGCRequest
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* // Query most popular items
|
|
285
|
+
* const query = steam.workshop.createQueryAllUGCRequest(
|
|
286
|
+
* EUGCQuery.RankedByVote,
|
|
287
|
+
* EUGCMatchingUGCType.Items,
|
|
288
|
+
* 480, // Spacewar
|
|
289
|
+
* 480,
|
|
290
|
+
* 1 // First page
|
|
291
|
+
* );
|
|
292
|
+
*
|
|
293
|
+
* steam.workshop.sendQueryUGCRequest(query);
|
|
294
|
+
* // Wait for SteamUGCQueryCompleted_t callback
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
createQueryAllUGCRequest(queryType: EUGCQuery, matchingType: EUGCMatchingUGCType, creatorAppId: number, consumerAppId: number, page: number): UGCQueryHandle;
|
|
298
|
+
/**
|
|
299
|
+
* Sends a UGC query to Steam and waits for results
|
|
300
|
+
*
|
|
301
|
+
* @param queryHandle - Handle from createQueryUserUGCRequest or createQueryAllUGCRequest
|
|
302
|
+
* @returns Query result with number of results and metadata, or null if failed
|
|
303
|
+
*
|
|
304
|
+
* @remarks
|
|
305
|
+
* After processing results, call releaseQueryUGCRequest to free memory
|
|
306
|
+
* Use getQueryUGCResult to retrieve individual item details
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* ```typescript
|
|
310
|
+
* const query = steam.workshop.createQueryAllUGCRequest(...);
|
|
311
|
+
* const result = await steam.workshop.sendQueryUGCRequest(query);
|
|
312
|
+
*
|
|
313
|
+
* if (result) {
|
|
314
|
+
* console.log(`Found ${result.numResults} items (${result.totalResults} total)`);
|
|
315
|
+
*
|
|
316
|
+
* // Get individual results
|
|
317
|
+
* for (let i = 0; i < result.numResults; i++) {
|
|
318
|
+
* const item = steam.workshop.getQueryUGCResult(query, i);
|
|
319
|
+
* if (item) {
|
|
320
|
+
* console.log(`Item: ${item.title}`);
|
|
321
|
+
* }
|
|
322
|
+
* }
|
|
323
|
+
*
|
|
324
|
+
* // Clean up
|
|
325
|
+
* steam.workshop.releaseQueryUGCRequest(query);
|
|
326
|
+
* }
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
329
|
+
sendQueryUGCRequest(queryHandle: UGCQueryHandle): Promise<{
|
|
330
|
+
numResults: number;
|
|
331
|
+
totalResults: number;
|
|
332
|
+
cachedData: boolean;
|
|
333
|
+
} | null>;
|
|
334
|
+
/**
|
|
335
|
+
* Gets a single result from a completed UGC query
|
|
336
|
+
*
|
|
337
|
+
* @param queryHandle - Handle from a completed query
|
|
338
|
+
* @param index - Index of the result to retrieve (0-based)
|
|
339
|
+
* @returns Workshop item details or null if failed
|
|
340
|
+
*
|
|
341
|
+
* @remarks
|
|
342
|
+
* Call this after receiving SteamUGCQueryCompleted_t callback
|
|
343
|
+
* Index must be less than the number of results returned in callback
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```typescript
|
|
347
|
+
* // After query completes via callback:
|
|
348
|
+
* const query = steam.workshop.createQueryAllUGCRequest(...);
|
|
349
|
+
* steam.workshop.sendQueryUGCRequest(query);
|
|
350
|
+
*
|
|
351
|
+
* // In callback handler when query completes:
|
|
352
|
+
* // Get first 10 results
|
|
353
|
+
* for (let i = 0; i < 10; i++) {
|
|
354
|
+
* const item = steam.workshop.getQueryUGCResult(query, i);
|
|
355
|
+
* if (item) {
|
|
356
|
+
* console.log(`${item.title} by ${item.steamIdOwner}`);
|
|
357
|
+
* console.log(`Votes: ${item.votesUp} up, ${item.votesDown} down`);
|
|
358
|
+
* }
|
|
359
|
+
* }
|
|
360
|
+
*
|
|
361
|
+
* steam.workshop.releaseQueryUGCRequest(query);
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
getQueryUGCResult(queryHandle: UGCQueryHandle, index: number): WorkshopItem | null;
|
|
365
|
+
/**
|
|
366
|
+
* Releases a query handle and frees associated memory
|
|
367
|
+
*
|
|
368
|
+
* @param queryHandle - Handle to release
|
|
369
|
+
* @returns True if released successfully
|
|
370
|
+
*
|
|
371
|
+
* @remarks
|
|
372
|
+
* Always call this after processing query results to prevent memory leaks
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* ```typescript
|
|
376
|
+
* const query = steam.workshop.createQueryAllUGCRequest(...);
|
|
377
|
+
* steam.workshop.sendQueryUGCRequest(query);
|
|
378
|
+
* // After callback and processing results:
|
|
379
|
+
* steam.workshop.releaseQueryUGCRequest(query);
|
|
380
|
+
* ```
|
|
381
|
+
*/
|
|
382
|
+
releaseQueryUGCRequest(queryHandle: UGCQueryHandle): boolean;
|
|
383
|
+
/**
|
|
384
|
+
* Creates a new Workshop item and waits for the result
|
|
385
|
+
*
|
|
386
|
+
* @param consumerAppId - App ID that will consume this item
|
|
387
|
+
* @param fileType - Type of Workshop file
|
|
388
|
+
* @returns The published file ID of the newly created item, or null if failed
|
|
389
|
+
*
|
|
390
|
+
* @remarks
|
|
391
|
+
* This method automatically waits for the CreateItemResult_t callback.
|
|
392
|
+
* Once created, use startItemUpdate to set content and properties.
|
|
393
|
+
* Blocks until result is ready or times out (default 5 seconds).
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```typescript
|
|
397
|
+
* const publishedFileId = await steam.workshop.createItem(
|
|
398
|
+
* 480,
|
|
399
|
+
* EWorkshopFileType.Community
|
|
400
|
+
* );
|
|
401
|
+
*
|
|
402
|
+
* if (publishedFileId) {
|
|
403
|
+
* console.log(`Created item with ID: ${publishedFileId}`);
|
|
404
|
+
*
|
|
405
|
+
* // Now you can update the item
|
|
406
|
+
* const updateHandle = steam.workshop.startItemUpdate(480, publishedFileId);
|
|
407
|
+
* steam.workshop.setItemTitle(updateHandle, 'My Awesome Mod');
|
|
408
|
+
* steam.workshop.setItemContent(updateHandle, '/path/to/content');
|
|
409
|
+
* steam.workshop.submitItemUpdate(updateHandle, 'Initial release');
|
|
410
|
+
* }
|
|
411
|
+
* ```
|
|
412
|
+
*/
|
|
413
|
+
createItem(consumerAppId: number, fileType: EWorkshopFileType): Promise<PublishedFileId | null>;
|
|
414
|
+
/**
|
|
415
|
+
* Starts an update for a Workshop item
|
|
416
|
+
*
|
|
417
|
+
* @param consumerAppId - App ID
|
|
418
|
+
* @param publishedFileId - Workshop item ID to update
|
|
419
|
+
* @returns Update handle for use with set* functions
|
|
420
|
+
*
|
|
421
|
+
* @remarks
|
|
422
|
+
* Call set* functions to modify properties, then submitItemUpdate to commit
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```typescript
|
|
426
|
+
* const itemId = BigInt('123456789');
|
|
427
|
+
* const updateHandle = steam.workshop.startItemUpdate(480, itemId);
|
|
428
|
+
*
|
|
429
|
+
* steam.workshop.setItemTitle(updateHandle, 'My Awesome Mod v2.0');
|
|
430
|
+
* steam.workshop.setItemDescription(updateHandle, 'Updated with new features!');
|
|
431
|
+
* steam.workshop.setItemContent(updateHandle, '/path/to/mod/folder');
|
|
432
|
+
*
|
|
433
|
+
* steam.workshop.submitItemUpdate(updateHandle, 'Version 2.0 changelog');
|
|
434
|
+
* ```
|
|
435
|
+
*/
|
|
436
|
+
startItemUpdate(consumerAppId: number, publishedFileId: PublishedFileId): UGCUpdateHandle;
|
|
437
|
+
/**
|
|
438
|
+
* Sets the title of a Workshop item being updated
|
|
439
|
+
*
|
|
440
|
+
* @param updateHandle - Handle from startItemUpdate
|
|
441
|
+
* @param title - New title for the item
|
|
442
|
+
* @returns True if set successfully
|
|
443
|
+
*/
|
|
444
|
+
setItemTitle(updateHandle: UGCUpdateHandle, title: string): boolean;
|
|
445
|
+
/**
|
|
446
|
+
* Sets the description of a Workshop item being updated
|
|
447
|
+
*
|
|
448
|
+
* @param updateHandle - Handle from startItemUpdate
|
|
449
|
+
* @param description - New description for the item
|
|
450
|
+
* @returns True if set successfully
|
|
451
|
+
*/
|
|
452
|
+
setItemDescription(updateHandle: UGCUpdateHandle, description: string): boolean;
|
|
453
|
+
/**
|
|
454
|
+
* Sets the visibility of a Workshop item being updated
|
|
455
|
+
*
|
|
456
|
+
* @param updateHandle - Handle from startItemUpdate
|
|
457
|
+
* @param visibility - Visibility setting
|
|
458
|
+
* @returns True if set successfully
|
|
459
|
+
*/
|
|
460
|
+
setItemVisibility(updateHandle: UGCUpdateHandle, visibility: ERemoteStoragePublishedFileVisibility): boolean;
|
|
461
|
+
/**
|
|
462
|
+
* Sets the content folder for a Workshop item being updated
|
|
463
|
+
*
|
|
464
|
+
* @param updateHandle - Handle from startItemUpdate
|
|
465
|
+
* @param contentFolder - Path to folder containing item content
|
|
466
|
+
* @returns True if set successfully
|
|
467
|
+
*
|
|
468
|
+
* @remarks
|
|
469
|
+
* All files in the folder will be uploaded to Workshop
|
|
470
|
+
*/
|
|
471
|
+
setItemContent(updateHandle: UGCUpdateHandle, contentFolder: string): boolean;
|
|
472
|
+
/**
|
|
473
|
+
* Sets the preview image for a Workshop item being updated
|
|
474
|
+
*
|
|
475
|
+
* @param updateHandle - Handle from startItemUpdate
|
|
476
|
+
* @param previewFile - Path to preview image file (must be under 1MB)
|
|
477
|
+
* @returns True if set successfully
|
|
478
|
+
*/
|
|
479
|
+
setItemPreview(updateHandle: UGCUpdateHandle, previewFile: string): boolean;
|
|
480
|
+
/**
|
|
481
|
+
* Submits an item update to Steam Workshop and waits for completion
|
|
482
|
+
*
|
|
483
|
+
* @param updateHandle - Handle from startItemUpdate
|
|
484
|
+
* @param changeNote - Description of changes (shown in update history)
|
|
485
|
+
* @returns True if update was submitted successfully, false otherwise
|
|
486
|
+
*
|
|
487
|
+
* @remarks
|
|
488
|
+
* Use getItemUpdateProgress to track upload progress
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```typescript
|
|
492
|
+
* const updateHandle = steam.workshop.startItemUpdate(480, itemId);
|
|
493
|
+
* steam.workshop.setItemTitle(updateHandle, 'Updated Title');
|
|
494
|
+
* const success = await steam.workshop.submitItemUpdate(updateHandle, 'Fixed bugs');
|
|
495
|
+
*
|
|
496
|
+
* if (success) {
|
|
497
|
+
* console.log('Update submitted successfully!');
|
|
498
|
+
* }
|
|
499
|
+
* ```
|
|
500
|
+
*/
|
|
501
|
+
submitItemUpdate(updateHandle: UGCUpdateHandle, changeNote: string): Promise<boolean>;
|
|
502
|
+
/**
|
|
503
|
+
* Gets the progress of an item update submission
|
|
504
|
+
*
|
|
505
|
+
* @param updateHandle - Handle from startItemUpdate
|
|
506
|
+
* @returns Update progress info
|
|
507
|
+
*
|
|
508
|
+
* @example
|
|
509
|
+
* ```typescript
|
|
510
|
+
* const updateHandle = steam.workshop.startItemUpdate(480, itemId);
|
|
511
|
+
* // ... set properties and submit ...
|
|
512
|
+
*
|
|
513
|
+
* // Poll for progress
|
|
514
|
+
* const progress = steam.workshop.getItemUpdateProgress(updateHandle);
|
|
515
|
+
* console.log(`Status: ${EItemUpdateStatus[progress.status]}`);
|
|
516
|
+
* console.log(`Progress: ${progress.percentComplete.toFixed(1)}%`);
|
|
517
|
+
* ```
|
|
518
|
+
*/
|
|
519
|
+
getItemUpdateProgress(updateHandle: UGCUpdateHandle): ItemUpdateProgress;
|
|
520
|
+
/**
|
|
521
|
+
* Votes on a Workshop item
|
|
522
|
+
*
|
|
523
|
+
* @param publishedFileId - Workshop item ID
|
|
524
|
+
* @param voteUp - True to vote up, false to vote down
|
|
525
|
+
* @returns True if vote was successful, false otherwise
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```typescript
|
|
529
|
+
* const itemId = BigInt('123456789');
|
|
530
|
+
* const success = await steam.workshop.setUserItemVote(itemId, true); // Vote up
|
|
531
|
+
*
|
|
532
|
+
* if (success) {
|
|
533
|
+
* console.log('Vote registered!');
|
|
534
|
+
* }
|
|
535
|
+
* ```
|
|
536
|
+
*/
|
|
537
|
+
setUserItemVote(publishedFileId: PublishedFileId, voteUp: boolean): Promise<boolean>;
|
|
538
|
+
/**
|
|
539
|
+
* Gets the user's vote on a Workshop item
|
|
540
|
+
*
|
|
541
|
+
* @param publishedFileId - Workshop item ID
|
|
542
|
+
* @returns Vote status object, or null if failed
|
|
543
|
+
*
|
|
544
|
+
* @example
|
|
545
|
+
* ```typescript
|
|
546
|
+
* const itemId = BigInt('123456789');
|
|
547
|
+
* const vote = await steam.workshop.getUserItemVote(itemId);
|
|
548
|
+
*
|
|
549
|
+
* if (vote) {
|
|
550
|
+
* if (vote.votedUp) {
|
|
551
|
+
* console.log('You voted up');
|
|
552
|
+
* } else if (vote.votedDown) {
|
|
553
|
+
* console.log('You voted down');
|
|
554
|
+
* } else {
|
|
555
|
+
* console.log('You have not voted');
|
|
556
|
+
* }
|
|
557
|
+
* }
|
|
558
|
+
* ```
|
|
559
|
+
*/
|
|
560
|
+
getUserItemVote(publishedFileId: PublishedFileId): Promise<{
|
|
561
|
+
votedUp: boolean;
|
|
562
|
+
votedDown: boolean;
|
|
563
|
+
voteSkipped: boolean;
|
|
564
|
+
} | null>;
|
|
565
|
+
/**
|
|
566
|
+
* Adds a Workshop item to the user's favorites
|
|
567
|
+
*
|
|
568
|
+
* @param appId - App ID
|
|
569
|
+
* @param publishedFileId - Workshop item ID
|
|
570
|
+
* @returns True if added successfully, false otherwise
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* ```typescript
|
|
574
|
+
* const itemId = BigInt('123456789');
|
|
575
|
+
* const success = await steam.workshop.addItemToFavorites(480, itemId);
|
|
576
|
+
*
|
|
577
|
+
* if (success) {
|
|
578
|
+
* console.log('Added to favorites!');
|
|
579
|
+
* }
|
|
580
|
+
* ```
|
|
581
|
+
*/
|
|
582
|
+
addItemToFavorites(appId: number, publishedFileId: PublishedFileId): Promise<boolean>;
|
|
583
|
+
/**
|
|
584
|
+
* Removes a Workshop item from the user's favorites
|
|
585
|
+
*
|
|
586
|
+
* @param appId - App ID
|
|
587
|
+
* @param publishedFileId - Workshop item ID
|
|
588
|
+
* @returns True if removed successfully, false otherwise
|
|
589
|
+
*
|
|
590
|
+
* @example
|
|
591
|
+
* ```typescript
|
|
592
|
+
* const itemId = BigInt('123456789');
|
|
593
|
+
* const success = await steam.workshop.removeItemFromFavorites(480, itemId);
|
|
594
|
+
*
|
|
595
|
+
* if (success) {
|
|
596
|
+
* console.log('Removed from favorites!');
|
|
597
|
+
* }
|
|
598
|
+
* ```
|
|
599
|
+
*/
|
|
600
|
+
removeItemFromFavorites(appId: number, publishedFileId: PublishedFileId): Promise<boolean>;
|
|
601
|
+
}
|
|
602
|
+
//# sourceMappingURL=SteamWorkshopManager.d.ts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