@types/tusk-mastodon
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Installation

npm install --save @types/tusk-mastodon

Summary

This package contains type definitions for tusk-mastodon (https://skullzarmy.github.io/Tusk/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tusk-mastodon.

index.d.ts

declare class TuskMastodonInstance {
    constructor(options: TuskMastodonOptions);

    put(path: string, params?: GeneralObject): Promise<GeneralObject>;
    get(path: string, params?: GeneralObject): Promise<GeneralObject>;
    post(path: string, params?: GeneralObject): Promise<GeneralObject>;
    patch(path: string, params?: GeneralObject): Promise<GeneralObject>;
    delete(path: string, params?: GeneralObject): Promise<GeneralObject>;

    request(method: ValidHTTPMethod, path: string, params?: GeneralObject): Promise<GeneralObject>;

    getAuth(): { "access_token": string };
    setAuth(auth: { "access_token": string }): void;

    formEncodeParams(params: GeneralObject): string;
}

interface TuskMastodonOptions {
    "access_token": string;
    /**
     * The base URL of the Mastodon instance to connect to. Defaults to `https://mastodon.social/api/v1/`.
     */
    "api_url"?: string;
    "timeout_ms"?: number;
}

interface GeneralObject {
    [key: string]: any;
}
type ValidHTTPMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";

export = TuskMastodonInstance;

Additional Details

  • Last updated: Tue, 28 Nov 2023 20:35:45 GMT
  • Dependencies: none

Credits

These definitions were written by Charlie Fish.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/tusk-mastodon

Weekly Downloads

7

Version

2.0.0

License

MIT

Unpacked Size

4.75 kB

Total Files

5

Last publish

Collaborators

  • types