UNPKG

@thiskyhan/bark.js

Version:

A simple JavaScript library for Bark.

37 lines (36 loc) 1.12 kB
import type { BarkOptions, BarkResponse, BarkPushPayload } from './index'; /** * A client for interacting with the Bark push notification API. */ export declare class BarkClient { private baseUrl; private key; private client; private validatePayload; /** * Creates an instance of BarkClient. * @param options - Configuration options for the client */ constructor(options: BarkOptions); /** * Sends a push notification via the Bark API. * @param payload - The notification payload to send * @returns The response from the Bark API */ pushMessage(payload: BarkPushPayload): Promise<BarkResponse>; /** * Sets the base URL for the client. * * This method updates both the local `baseUrl` property and the default base URL for * all HTTP requests made by the client. * * @param baseUrl - The new base URL to use. */ setBaseUrl(baseUrl: string): void; /** * Sets the API key for the client. * * @param key - The API key that will be used for authentication. */ setKey(key: string): void; }