aboutsummaryrefslogtreecommitdiff
path: root/core/http/client.ts
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-06-29 23:25:01 +0200
committerlonkaars <loek@pipeframe.xyz>2023-06-29 23:25:01 +0200
commitcc5689eaf4f7cfa158e31107906434da9aed62bf (patch)
treef02bb5f0887a48de32b9b06b6500c158043f0c52 /core/http/client.ts
parentccd4760cc28082c2d7d9bbebd1a60fe7da65d121 (diff)
WIP examples + change `.prepare()` to `await .ready`
Diffstat (limited to 'core/http/client.ts')
-rw-r--r--core/http/client.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/http/client.ts b/core/http/client.ts
index a77b616..365aa76 100644
--- a/core/http/client.ts
+++ b/core/http/client.ts
@@ -1,6 +1,5 @@
import "../../util/array.ts";
-import { ParseResult } from "../../language/types.ts";
import API from "../api.ts";
import { ConnectionProps, ConnectionPropsDefault } from "./props.ts";
import { APIRequest, APIRequestParseSentence, APIResponseParseSentence } from "./types.ts";
@@ -13,13 +12,12 @@ import { APIRequest, APIRequestParseSentence, APIResponseParseSentence } from ".
*/
export default class YomikunRemoteAPIClient implements API {
private props: ConnectionProps;
+ ready: Promise<void> = Promise.resolve();
constructor(options?: ConnectionProps) {
this.props = { ...ConnectionPropsDefault, ...options };
}
- async prepare() { }
-
private async request(details: APIRequest) {
var response = await fetch(`http://${this.props.host}:${this.props.port}`, {
method: "POST",