@j4ckofalltrades/steam-webapi-ts
Version:
Isomorphic Steam WebAPI wrapper in TypeScript
71 lines (70 loc) • 2.05 kB
TypeScript
import { WebApiClient } from "../core/webApiClient";
import { WebApiKey } from "../core/steamWebApi";
export declare const GET_SERVER_INFO = "/ISteamWebAPIUtil/GetServerInfo/v1";
export declare const GET_SUPPORTED_API_LIST = "/ISteamWebAPIUtil/GetSupportedAPIList/v1";
/**
* @property servertime Unix timestamp of WebAPI server.
* @property servertimestring Time string of WebAPI server.
*/
export type ServerInfo = {
servertime: number;
servertimestring: string;
};
/**
* @property name Name of parameter.
* @property type Expected type of value.
* @property optional Is input optional for the method.
* @property description API Documentation of parameter.
*/
type ApiParam = {
name: string;
type: string;
optional: boolean;
description: string;
};
/**
* @property name Name of method.
* @property version Version of method.
* @property httpmethod Allowed HTTP method for method (GET, POST).
*/
type ApiMethod = {
name: string;
version: number;
httpmethod: string;
parameters: ApiParam[];
};
/**
* @property apilist List of supported APIs.
* @property apilist.interfaces.name Name of interface.
* @property apilist.interfaces.methods Methods with-in the interface.
*/
export type SupportedAPI = {
apilist: {
interfaces: {
name: string;
methods: ApiMethod[];
}[];
}[];
};
/**
* Provides miscellaneous Web API related functionality through utility methods.
*/
export declare class ISteamWebAPIUtilWrapper {
private readonly webApiClient;
/**
* @param http HTTP client.
*/
constructor(http?: WebApiClient);
/**
* Returns WebAPI server time & checks server status.
*/
getServerInfo(): Promise<ServerInfo>;
/**
* Lists all available WebAPI interfaces.
*
* @param apiKey (Optional) Presence of a Steam WebAPI key will display all available methods & interfaces allowed
* for that key.
*/
getSupportedAPIList(apiKey?: WebApiKey): Promise<SupportedAPI>;
}
export {};