Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Type definition for node-modern-rcon. #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modern-rcon",
"version": "1.0.3",
"version": "1.0.4",
"description": "A modern RCON client implementation written in ES2015",
"keywords": [
"rcon",
Expand All @@ -9,6 +9,7 @@
"es6"
],
"main": "rcon.js",
"typings": "rcon.d.ts",
"repository": "levrik/node-modern-rcon",
"author": "Levin Ricket <[email protected]>",
"license": "MIT",
Expand Down
23 changes: 23 additions & 0 deletions rcon.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/// <reference types="node" />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't these reference comments removed from TypeScript?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know they still work. Might be deprecated.
It depends on your module structure.

export declare class RconError extends Error {
constructor(message: string);
}

declare class Rcon {

constructor(host: string, password: string, timeout?: number);
constructor(host: string, port: number, password: string, timeout?: number);

host: string;
port: number;
password: string;
timeout: number;

connect(): Promise<void>;

disconnect(): Promise<void>;

send(data: string): Promise<string>;
}

exports = Rcon;