/** * Telegraph API Type Definitions * Based on https://telegra.ph/api */ /** * Telegraph Account object */ export interface Account { /** Account name, helps users with several accounts remember which they are currently using */ short_name: string; /** Default author name used when creating new articles */ author_name?: string; /** Profile link, opened when users click on the author's name below the title */ author_url?: string; /** Access token of the Telegraph account (only returned by createAccount and revokeAccessToken) */ access_token?: string; /** URL to authorize a browser on telegra.ph (only returned by revokeAccessToken) */ auth_url?: string; /** Number of pages belonging to the Telegraph account (only returned when requested) */ page_count?: number; } /** * Telegraph Page object */ export interface Page { /** Path to the page */ path: string; /** URL of the page */ url: string; /** Title of the page */ title: string; /** Description of the page */ description: string; /** Name of the author, displayed below the title */ author_name?: string; /** Profile link, opened when users click on the author's name below the title */ author_url?: string; /** Image URL of the page */ image_url?: string; /** Content of the page (array of Node objects, only returned if return_content is true) */ content?: Node[]; /** Number of page views for the page */ views: number; /** True if the target Telegraph account can edit the page */ can_edit?: boolean; } /** * Telegraph PageList object */ export interface PageList { /** Total number of pages belonging to the target Telegraph account */ total_count: number; /** Requested pages of the target Telegraph account */ pages: Page[]; } /** * Telegraph PageViews object */ export interface PageViews { /** Number of page views for the target page */ views: number; } /** * Telegraph Node - represents a DOM element or text * Can be either a string (text content) or a NodeElement */ export type Node = string | NodeElement; /** * Telegraph NodeElement - represents a DOM element */ export interface NodeElement { /** Name of the DOM element tag */ tag: string; /** Attributes of the DOM element (href for , src for ,