mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-24 21:23:09 +02:00
rename
This commit is contained in:
parent
cb0e275db9
commit
81289762bc
1 changed files with 3 additions and 3 deletions
|
@ -1,16 +1,16 @@
|
||||||
import { Endpoints } from './endpoints';
|
import { Endpoints } from './endpoints';
|
||||||
|
|
||||||
export class MisskeyClient {
|
export class APIClient {
|
||||||
public i: { token: string; } | null = null;
|
public i: { token: string; } | null = null;
|
||||||
private apiUrl: string;
|
private apiUrl: string;
|
||||||
|
|
||||||
constructor(opts: {
|
constructor(opts: {
|
||||||
apiUrl: MisskeyClient['apiUrl'];
|
apiUrl: APIClient['apiUrl'];
|
||||||
}) {
|
}) {
|
||||||
this.apiUrl = opts.apiUrl;
|
this.apiUrl = opts.apiUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public api<E extends keyof Endpoints>(
|
public request<E extends keyof Endpoints>(
|
||||||
endpoint: E, data: Endpoints[E]['req'] = {}, token?: string | null | undefined
|
endpoint: E, data: Endpoints[E]['req'] = {}, token?: string | null | undefined
|
||||||
): Promise<Endpoints[E]['res']> {
|
): Promise<Endpoints[E]['res']> {
|
||||||
const promise = new Promise<Endpoints[E]['res']>((resolve, reject) => {
|
const promise = new Promise<Endpoints[E]['res']>((resolve, reject) => {
|
||||||
|
|
Loading…
Reference in a new issue