Workspaces refactor #86

Merged
norm merged 189 commits from refactor/workspaces into main 2022-08-28 14:46:45 +00:00
Showing only changes of commit 81289762bc - Show all commits

View file

@ -1,16 +1,16 @@
import { Endpoints } from './endpoints';
export class MisskeyClient {
export class APIClient {
public i: { token: string; } | null = null;
private apiUrl: string;
constructor(opts: {
apiUrl: MisskeyClient['apiUrl'];
apiUrl: APIClient['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
): Promise<Endpoints[E]['res']> {
const promise = new Promise<Endpoints[E]['res']>((resolve, reject) => {