forked from ceifa/steamworks.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.d.ts
129 lines (129 loc) · 4.71 KB
/
client.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
export function init(appId: number): void
export function runCallbacks(): void
export namespace achievement {
export function activate(achievement: string): boolean
export function isActivated(achievement: string): boolean
}
export namespace auth {
/** @param timeoutSeconds - The number of seconds to wait for the ticket to be validated. Default value is 10 seconds. */
export function getSessionTicket(timeoutSeconds?: number | undefined | null): Promise<Ticket>
export class Ticket {
cancel(): void
getBytes(): Buffer
}
}
export namespace cloud {
export function isEnabledForAccount(): boolean
export function isEnabledForApp(): boolean
export function readFile(name: string): string
export function writeFile(name: string, content: string): boolean
export function deleteFile(name: string): boolean
}
export namespace input {
export interface AnalogActionVector {
x: number
y: number
}
export function init(): void
export function getControllers(): Array<Controller>
export function getActionSet(actionSetName: string): bigint
export function getDigitalAction(actionName: string): bigint
export function getAnalogAction(actionName: string): bigint
export function shutdown(): void
export class Controller {
activateActionSet(actionSetHandle: bigint): void
isDigitalActionPressed(actionHandle: bigint): boolean
getAnalogActionVector(actionHandle: bigint): AnalogActionVector
}
}
export namespace localplayer {
export interface LocalSteamId {
steamId64: string
steamId32: string
accountId: number
}
export function getSteamId(): LocalSteamId
export function getName(): string
export function getLevel(): number
/** @returns the 2 digit ISO 3166-1-alpha-2 format country code which client is running in, e.g. "US" or "UK". */
export function getIpCountry(): string
export function setRichPresence(key: string, value?: string | undefined | null): void
}
export namespace stats {
export function getInt(name: string): number | null
export function setInt(name: string, value: number): boolean
export function store(): boolean
export function resetAll(achievementsToo: boolean): boolean
}
export namespace workshop {
export interface UgcResult {
itemId: bigint
needsToAcceptAgreement: boolean
}
export interface UgcUpdate {
title?: string
description?: string
changeNote?: string
previewPath?: string
contentPath?: string
tags?: Array<string>
}
export interface InstallInfo {
folder: string
sizeOnDisk: bigint
timestamp: number
}
export interface DownloadInfo {
current: bigint
total: bigint
}
export function createItem(): Promise<UgcResult>
export function updateItem(itemId: bigint, updateDetails: UgcUpdate): Promise<UgcResult>
/**
* Subscribe to a workshop item. It will be downloaded and installed as soon as possible.
*
* {@link https://partner.steamgames.com/doc/api/ISteamUGC#SubscribeItem}
*/
export function subscribe(itemId: bigint): Promise<void>
/**
* Unsubscribe from a workshop item. This will result in the item being removed after the game quits.
*
* {@link https://partner.steamgames.com/doc/api/ISteamUGC#UnsubscribeItem}
*/
export function unsubscribe(itemId: bigint): Promise<void>
/**
* Gets the current state of a workshop item on this client. States can be combined.
*
* @returns a number with the current item state, e.g. 9
* 9 = 1 (The current user is subscribed to this item) + 8 (The item needs an update)
*
* {@link https://partner.steamgames.com/doc/api/ISteamUGC#GetItemState}
* {@link https://partner.steamgames.com/doc/api/ISteamUGC#EItemState}
*/
export function state(itemId: bigint): number
/**
* Gets info about currently installed content on the disc for workshop item.
*
* @returns an object with the the properties {folder, size_on_disk, timestamp}
*
* {@link https://partner.steamgames.com/doc/api/ISteamUGC#GetItemInstallInfo}
*/
export function installInfo(itemId: bigint): InstallInfo | null
/**
* Get info about a pending download of a workshop item.
*
* @returns an object with the properties {current, total}
*
* {@link https://partner.steamgames.com/doc/api/ISteamUGC#GetItemDownloadInfo}
*/
export function downloadInfo(itemId: bigint): DownloadInfo | null
/**
* Download or update a workshop item.
*
* @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.
* @returns true or false
*
* {@link https://partner.steamgames.com/doc/api/ISteamUGC#DownloadItem}
*/
export function download(itemId: bigint, highPriority: boolean): boolean
}