mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 17:07:07 +08:00
Typings for steam-client
This commit is contained in:
3390
types/steam-client/index.d.ts
vendored
Normal file
3390
types/steam-client/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
38
types/steam-client/steam-client-tests.ts
Normal file
38
types/steam-client/steam-client-tests.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import Steam = require("steam-client");
|
||||
|
||||
const steamClient = new Steam.CMClient(Steam.EConnectionProtocol.TCP);
|
||||
|
||||
steamClient.connect();
|
||||
steamClient.connect(Steam.servers[0]);
|
||||
steamClient.connect(Steam.servers[0], true);
|
||||
|
||||
steamClient.disconnect();
|
||||
|
||||
steamClient.on<'connected'>('connected', (serverLoad) => {
|
||||
steamClient.logOn({
|
||||
account_name: serverLoad,
|
||||
password: "password"
|
||||
});
|
||||
});
|
||||
|
||||
Steam.servers.forEach((server) => server.host);
|
||||
|
||||
steamClient.on<'logOnResponse'>('logOnResponse', (details) => {
|
||||
return details.eresult + details.webapi_authenticate_user_nonce;
|
||||
});
|
||||
|
||||
steamClient.send({
|
||||
msg: Steam.EMsg.ClientGetFinalPrice,
|
||||
proto: {
|
||||
eresult: Steam.EResult.AdministratorOK
|
||||
}
|
||||
}, new Buffer("lol"), (header, body) => {
|
||||
return header.msg + body.reverse().toString();
|
||||
});
|
||||
|
||||
steamClient.bind("127.0.0.1", 80);
|
||||
|
||||
if (steamClient.loggedOn) {
|
||||
console.log(steamClient.steamID);
|
||||
console.log(steamClient.remoteAddress);
|
||||
}
|
||||
22
types/steam-client/tsconfig.json
Normal file
22
types/steam-client/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"steam-client-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/steam-client/tslint.json
Normal file
1
types/steam-client/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user