Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty-trim committed Jan 7, 2024
1 parent 877f8f2 commit 620a10b
Show file tree
Hide file tree
Showing 22 changed files with 4,026 additions and 4,152 deletions.
427 changes: 0 additions & 427 deletions api-extractor.json

This file was deleted.

1,803 changes: 0 additions & 1,803 deletions docs/docs.api.json

This file was deleted.

11 changes: 0 additions & 11 deletions docs/index.html

This file was deleted.

128 changes: 124 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": "https://github.com/StrafeChat/strafe.js",
"main": "dist/index",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "tsc -p . && typedoc --json website/docs.json"
},
"keywords": [],
"author": "StrafeChat <docs.strafe.chat>",
Expand All @@ -16,7 +16,8 @@
},
"devDependencies": {
"@types/node": "^20.10.6",
"@types/ws": "^8.5.10"
"@types/ws": "^8.5.10",
"typedoc": "^0.25.6"
},
"files": [
"dist"
Expand Down
7 changes: 7 additions & 0 deletions src/client/Client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { ClientUser } from "../structure/ClientUser";
import { WebsocketClient } from "./WebsocketClient";

/**
* The main hub for interacting with strafe.
*/
export class Client {

public token: string | null = null;
Expand All @@ -11,6 +14,10 @@ export class Client {
this.ws = new WebsocketClient(this);
}

/**
* Logs the client in, establishing a WebSocket connection to strafe.
* @param token The bot token
*/
public async login(token: string) {
this.token = token;
this.ws.connect();
Expand Down
14 changes: 14 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
export const API = process.env.STRAFE_API ?? "https://equinox.strafe.chat/v1"
export const GATEWAY = API + "/gateway";

/**
* List of opcodes used for interacting with strafe.
*/
export enum OpCodes {
/**
* Op code used for sending an identify payload to Strafe.
*/
IDENTIFY = 0,

/**
* Op code used for receiving the hello event from Strafe.
*/
HELLO = 1,

/**
* Op code used for sending heartbeats to Strafe.
*/
HEARTBEAT = 2,
}
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./client/Client";
export * from "./client/WebsocketClient";
export * from "./config";
export * from "./structure/ClientUser";
export * from "./structure/User";
export * from "./types";
export * from "./types";
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
"removeComments": false, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
Expand Down
5 changes: 5 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://typedoc.org/schema.json",
"includeVersion": true,
"entryPoints": ["./src/index.ts"],
}
Loading

0 comments on commit 620a10b

Please sign in to comment.