@stack.thefennec.dev/telegram-export-parser
Version:
TypeScript library for parsing Telegram Desktop's data export with full type safety
94 lines • 2.53 kB
TypeScript
import type { TextEntityType } from './text-entities';
export interface RawTextEntity {
type: TextEntityType;
text: string;
language?: string;
href?: string;
user_id?: number;
document_id?: string;
collapsed?: boolean;
}
import type { CallDiscardReason, EventAction, ReactionType } from './index';
export interface RawReaction {
type: ReactionType;
count: number;
emoji?: string;
document_id?: string;
recent?: Array<{
from?: string;
from_id: number;
date: string;
}>;
}
import type { ContactInfo, InlineButton, InvoiceInfo, LocationInfo, Poll } from './shared';
export interface RawTelegramMessage {
id: number;
type: string;
date: string;
date_unixtime: string;
from?: string;
from_id?: string;
text?: string | (string | RawTextEntity)[];
text_entities?: RawTextEntity[];
author?: string;
file?: string;
file_name?: string;
file_size?: number;
media_type?: string;
mime_type?: string;
height?: number;
width?: number;
duration_seconds?: number;
thumbnail?: string;
thumbnail_file_size?: number;
sticker_emoji?: string;
performer?: string;
title?: string;
photo?: string;
photo_file_size?: number;
media_spoiler?: boolean;
forwarded_from?: string;
saved_from?: string;
reply_to_message_id?: number;
reply_to_peer_id?: string;
reactions?: RawReaction[];
inline_bot_buttons?: InlineButton[][];
via_bot?: string;
edited?: boolean;
edited_unixtime?: number;
location_information?: LocationInfo;
address?: string;
place_name?: string;
live_location_period_seconds?: number;
contact_information?: ContactInfo;
contact_vcard?: string;
contact_vcard_file_size?: number;
poll?: Poll;
game_title?: string;
game_description?: string;
game_link?: string;
invoice_information?: InvoiceInfo;
action?: EventAction;
actor?: string;
actor_id?: string;
members?: string[];
message_id?: number;
discard_reason?: CallDiscardReason;
cost?: number;
months?: number;
score?: number;
game_message_id?: number;
inviter?: string;
schedule_date?: string;
messages_count?: number;
stars_count?: number;
duration?: number;
self_destruct_period_seconds?: number;
}
export interface RawTelegramChatExport {
id: number;
type: string;
name: string;
messages: RawTelegramMessage[];
}
//# sourceMappingURL=raw-export.d.ts.map