UNPKG

x-api-sdk-ts

Version:

TypeScript Library for the X (ex-twitter) API V2

51 lines (50 loc) 1.83 kB
import { IDeletePostResponse } from '../../types/x-api/posts/delete_post_response'; import { IGetPostResponse, IGetPostsResponse } from '../../types/x-api/posts/get_posts_response'; import { ICreatePostResponse } from '../../types/x-api/posts/create_post_response'; import { AbstractApi } from './IApiConstructor'; import { RCResponse } from '../IRequestClient'; export interface IPostOptions { card_uri?: string; community_id?: string; direct_message_deep_link?: string; for_super_followers_only?: boolean; geo?: { place_id: string; }; media?: { media_ids: string[]; tagged_user_ids?: string[]; }; nullcast?: boolean; poll?: { duration_minutes: number; options: string[]; reply_settings?: 'following' | 'mentionedUsers'; }; quote_tweet_id?: string; reply?: { in_reply_to_tweet_id: string; exclude_reply_user_ids?: string[]; }; reply_settings?: 'following' | 'mentionedUsers' | 'subscribers'; } export declare abstract class AbstractPosts extends AbstractApi { abstract create(text: string, options?: IPostOptions): Promise<RCResponse<ICreatePostResponse>>; abstract get(id: string, options?: { tweetFields?: string[]; expansions?: string[]; mediaFields?: string[]; pollFields?: string[]; userFields?: string[]; placeFields?: string[]; }): Promise<RCResponse<IGetPostResponse>>; abstract getMultiple(ids: string[], options?: { tweetFields?: string[]; expansions?: string[]; mediaFields?: string[]; pollFields?: string[]; userFields?: string[]; placeFields?: string[]; }): Promise<RCResponse<IGetPostsResponse>>; abstract delete(id: string): Promise<RCResponse<IDeletePostResponse>>; }