@flaresocial/api
Version:
API wrapper for the Flare Social API
19 lines • 1.02 kB
TypeScript
import { UsersEndpoint } from './users';
import { PostsEndpoint } from './posts';
export type { IdHolder, PaginatedResponse } from './endpoint';
export type { User, UserUpdate } from './users';
export { UserEntity } from './users';
export type { Post, PostCreate, QuoteCreate } from './posts';
export { PostEntity } from './posts';
type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
export default class FlareApi {
static getToken: () => string;
private readonly baseUrl;
readonly users: UsersEndpoint;
readonly posts: PostsEndpoint;
constructor(getToken: () => string, baseUrl?: string);
request<T>(method: RequestMethod, path: string, headers?: Record<string, string>, init?: RequestInit): Promise<T>;
static register(username: string, email: string, password: string, displayName?: string, baseUrl?: string, invite_code?: string): Promise<string>;
static login(login: string, password: string, baseUrl?: string): Promise<string>;
}
//# sourceMappingURL=index.d.ts.map