Skip to content

Commit

Permalink
Meta format update
Browse files Browse the repository at this point in the history
  • Loading branch information
man90es committed May 12, 2022
1 parent 52f5201 commit 063fe7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bakaso/fkclient",
"version": "1.1.2",
"version": "1.2.0",
"description": "A wrapper library for Foxtan API.",
"keywords": [
"foxtan",
Expand Down
10 changes: 8 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export type OutMessage = {
data?: object
}

type Meta = {
engine?: string
res?: { path: string }
thumb?: { path: string, format: string, width: number, height: number }
}

function formDataToObject(formData: FormData) {
const obj: {[key:string]: any} = {}

Expand All @@ -47,7 +53,7 @@ export default class Client {
#APIServerURI: URL
#WSGate?: WebSocket
#ready: boolean = false
#meta: { engine?: string, res?: string, thumb?: string } = {}
#meta: Meta = {}
#messageHandlers: Listener[] = []
#reconnectDelay: number
#reconnectInterval?: number
Expand Down Expand Up @@ -102,7 +108,7 @@ export default class Client {
return this.#ready
}

get meta(): { engine?: string, res?: string, thumb?: string } {
get meta(): Meta {
return this.#meta
}

Expand Down
4 changes: 2 additions & 2 deletions src/FKClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ export default class FKClient {
return this.#client?.meta?.engine || null
}

get resPath(): string | null {
get res(): { path: string } | null {
return this.#client?.meta?.res || null
}

get thumbPath(): string | null {
get thumb(): { path: string, format: string, width: number, height: number } | null {
return this.#client?.meta?.thumb || null
}

Expand Down

0 comments on commit 063fe7c

Please sign in to comment.