import * as tph from './telegraph.d' export interface Telegraph { token: string callService (method: string, payload: object): Promise createAccount (shortName: string, name?: string, url?: string): Promise createPage (title: string, content: Array, authorName?: string, authorUrl?: string, returnContent?: boolean): Promise editAccountInfo (shortName?: string, name?: string, url?: string): Promise editPage (path: string, title: string, content: Array, authorName?: string, authorUrl?: string, returnContent?: boolean): Promise getPage (path: string, returnContent?: boolean): Promise getViews (path: string, year: number, month: number, day: number, hour?: number): Promise getPageList (offset?: number, limit?: number): Promise revokeAccessToken (): Promise } export interface TelegraphConstructor { /** * Initialize new Telegraph app. * @param token Access token * @param opts options * @example * new Telegraph(token, opts) */ new (token: string, options?: TelegraphOptions): Telegraph } export interface TelegraphOptions { token?: string apiRoot?: string } export const Telegraph: TelegraphConstructor export default Telegraph