import { TweetRepliesSortType } from '../../enums/Tweet'; import { CursoredData } from '../../models/data/CursoredData'; import { Tweet } from '../../models/data/Tweet'; import { User } from '../../models/data/User'; import { ITweetFilter } from '../../types/args/FetchArgs'; import { INewTweet } from '../../types/args/PostArgs'; import { BrowserFetcherService } from './BrowserFetcherService'; import { BrowserRettiwtConfig } from '../config/BrowserRettiwtConfig'; /** * Browser media type - accepts Blob, File, or ArrayBuffer. */ export type BrowserMedia = Blob | File | ArrayBuffer; /** * Browser-compatible tweet service. * Handles interacting with resources related to tweets. * Uses Blob/File API instead of fs for media uploads. * * @public */ export declare class BrowserTweetService extends BrowserFetcherService { /** * @param config - The browser config object for configuring the Rettiwt instance. */ constructor(config: BrowserRettiwtConfig); /** * Bookmark a tweet. * * @param id - The ID of the tweet to be bookmarked. * @returns Whether bookmarking was successful or not. */ bookmark(id: string): Promise; /** * Get the details of a tweet. * * @param id - The ID of the target tweet. * @returns The details of the tweet with the given ID. */ details(id: string): Promise; /** * Get the details of multiple tweets. * * @param ids - The IDs of the target tweets. * @returns The list of tweet details. */ details(ids: string[]): Promise; /** * Like a tweet. * * @param id - The ID of the tweet to be liked. * @returns Whether liking was successful or not. */ like(id: string): Promise; /** * Get the list of users who liked a tweet. * * @param id - The ID of the target tweet. * @param count - The number of likers to fetch, must be <= 100. * @param cursor - The cursor to the batch of likers to fetch. * @returns The list of users who liked the target tweet. */ likers(id: string, count?: number, cursor?: string): Promise>; /** * Post a new tweet. * * @param tweet - The tweet to be posted. * @returns The ID of the posted tweet, or undefined if posting failed. */ post(tweet: INewTweet): Promise; /** * Get the replies to a tweet. * * @param id - The ID of the target tweet. * @param cursor - The cursor to the batch of replies to fetch. * @param sortBy - The type of sorting for the replies. * @returns The list of replies to the target tweet. */ replies(id: string, cursor?: string, sortBy?: TweetRepliesSortType): Promise>; /** * Retweet a tweet. * * @param id - The ID of the tweet to be retweeted. * @returns Whether retweeting was successful or not. */ retweet(id: string): Promise; /** * Get the list of users who retweeted a tweet. * * @param id - The ID of the target tweet. * @param count - The number of retweeters to fetch, must be <= 100. * @param cursor - The cursor to the batch of retweeters to fetch. * @returns The list of users who retweeted the target tweet. */ retweeters(id: string, count?: number, cursor?: string): Promise>; /** * Search for tweets. * * @param filter - The filter for searching tweets. * @param count - The number of tweets to fetch, must be <= 100. * @param cursor - The cursor to the batch of tweets to fetch. * @returns The list of tweets matching the given filter. */ search(filter: ITweetFilter, count?: number, cursor?: string): Promise>; /** * Unbookmark a tweet. * * @param id - The ID of the tweet to be unbookmarked. * @returns Whether unbookmarking was successful or not. */ unbookmark(id: string): Promise; /** * Unlike a tweet. * * @param id - The ID of the tweet to be unliked. * @returns Whether unliking was successful or not. */ unlike(id: string): Promise; /** * Unpost (delete) a tweet. * * @param id - The ID of the tweet to be unposted. * @returns Whether unposting was successful or not. */ unpost(id: string): Promise; /** * Unretweet a tweet. * * @param id - The ID of the tweet to be unretweeted. * @returns Whether unretweeting was successful or not. */ unretweet(id: string): Promise; /** * Upload media for use in tweets. * Uses browser-native Blob/File API instead of fs. * * @param media - The media to upload (Blob, File, or ArrayBuffer). * @returns The media ID string for use in tweet posts. */ upload(media: BrowserMedia): Promise; }