UNPKG

@vitalwall/client

Version:

VitalWall client library for vanilla JavaScript applications

33 lines (32 loc) 917 B
export interface VitalWallConfig { apiKey: string; debug?: boolean; wallId?: string; domain?: string; } export interface WallItem { content: string; isHtml?: boolean; wallId?: string; } export interface VitalWallClient { init(config: VitalWallConfig): Promise<void>; addItem(item: WallItem): Promise<string | undefined>; addTextItem(content: string, wallId?: string): Promise<string | undefined>; addHtmlItem(content: string, wallId?: string): Promise<string | undefined>; setCurrentWall(wallId: string): void; getCurrentWall(): string | null; isInitialized(): boolean; cleanup(): void; onReady(callback: () => void): void; } export interface WallElement extends HTMLElement { _cleanup?: () => void; } export interface TokenData { accessToken: string; refreshToken: string; expiryTime: number; domain: string; wallId?: string; }