tgui-angular
Version:
🚀 Angular UI library for Telegram Web Apps with modern components and theming support | 💼 Author is open to work opportunities | 📧 Contact: a.blagovestnov@gmail.com | 💬 Telegram: @ablagovestnov
45 lines (44 loc) • 1.3 kB
TypeScript
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
interface ThemeParams {
bg_color?: string;
text_color?: string;
hint_color?: string;
link_color?: string;
button_color?: string;
button_text_color?: string;
secondary_bg_color?: string;
header_bg_color?: string;
accent_text_color?: string;
section_bg_color?: string;
section_header_text_color?: string;
subtitle_text_color?: string;
destructive_text_color?: string;
}
interface WebApp {
colorScheme: 'light' | 'dark';
themeParams: ThemeParams;
onEvent(eventName: string, eventHandler: () => void): void;
offEvent(eventName: string, eventHandler: () => void): void;
}
declare global {
interface Window {
Telegram?: {
WebApp?: WebApp;
};
}
}
export declare class TelegramService {
private ready;
private initializationTimeout;
constructor();
private get canUseDOM();
getTelegramData(): WebApp | undefined;
private waitForTelegramWebApp;
get isReady$(): Observable<boolean>;
get isReady(): boolean;
hexToRGB(hex: string): [number, number, number];
static ɵfac: i0.ɵɵFactoryDeclaration<TelegramService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TelegramService>;
}
export {};