UNPKG

chen-facebook

Version:
59 lines (58 loc) 1.38 kB
import { HttpClient, HttpClientResponse } from 'chen/web'; import { KeyValuePair } from 'chen/core'; /** * FacebookApiResponse interface */ export declare class FacebookApiResponse extends HttpClientResponse { } /** * FacebookApi class */ export declare class FacebookApi extends HttpClient { private token; /** * API host * @type {string} */ static BASE_URL: string; /** * API version base url * @type {string} */ private apiVersionUrl; /** * API version * @type {string} */ private version; /** * FacebookApi constructor * @param {string} version * @param {string} private token */ constructor(version: string, token: string); /** * Get version * @return {string} */ getVersion(): string; /** * Get access token * @return {string} */ getAccessToken(): string; /** * Make a GET Request * @param {string} url * @param {KeyValuePair} params * @return {Promise<FacebookApiResponse>} */ get(endpoint: string, params?: KeyValuePair): Promise<FacebookApiResponse>; /** * Make a POST Request * @param {string} url * @param {KeyValuePair} params * @return {Promise<FacebookApiResponse>} */ post(endpoint: string, params?: KeyValuePair): Promise<FacebookApiResponse>; }