import { BaseArchive } from "../reading/StreamArchive"; import { UserPersonalization, ScreenNameChange, GDPRProtectedHistory, UserFullAgeInfo, ConnectedApplication, UserEmailAddressChange, IpAudit, PushDevice, MessagingDevice } from "../types/GDPRUserInformations"; import { TwitterUserDetails } from "../types/ClassicTweets"; export interface UserLoadObject { phone_number?: string; verified?: boolean; personalization?: UserPersonalization; screen_name_history?: ScreenNameChange[]; protected_history?: GDPRProtectedHistory[]; age_info?: UserFullAgeInfo; timezone?: string; applications?: ConnectedApplication[]; email_address_changes?: UserEmailAddressChange[]; login_ips?: IpAudit[]; summary?: TwitterUserDetails; } export declare class UserData { protected archive: BaseArchive; protected _sn_history: ScreenNameChange[]; protected _lock_history: GDPRProtectedHistory[]; protected _age: UserFullAgeInfo; protected _creation_ip: string; protected _timezone: string; protected _apps: ConnectedApplication[]; protected _email_addresses: UserEmailAddressChange[]; protected _login_ips: IpAudit[]; protected _registred_devices: { push_devices: PushDevice[]; messaging_devices: MessagingDevice[]; }; protected _verified: boolean; protected _phone_nb: string | undefined; protected _p13n: UserPersonalization; protected _basic_info: TwitterUserDetails; /** * **For internal module use only.** * * Can **ONLY** be used with GDPR archives. * * For loading basic user info, you must use `.loadPart()`. */ __init(archive: BaseArchive): Promise; /** -------------- */ /** INIT FUNCTIONS */ /** -------------- */ protected initPersonalization(): Promise; protected initAgeInfo(): Promise; protected initScreenNameHistory(): Promise; protected initProtectedHistory(): Promise; protected initCreationIp(): Promise; protected initTimezone(): Promise; protected initConnectedApps(): Promise; protected initEmailAddresses(): Promise; protected initIpAudit(): Promise; protected initNiDevices(): Promise; protected initVerified(): Promise; protected initPhoneNumber(): Promise; /** ------ */ /** LOADER */ /** ----- */ /** * Load a part of CollectedUserData archive. * * Should be used to build from hand this object. */ loadPart({ phone_number, verified, personalization, protected_history, screen_name_history, age_info, email_address_changes, login_ips, timezone, applications, summary }?: UserLoadObject): void; /** Get all data stored in this instance, in an object loadable by `.loadPart()` */ dump(): { phone_number: string; verified: boolean; personalization: UserPersonalization; protected_history: GDPRProtectedHistory[]; screen_name_history: ScreenNameChange[]; age_info: UserFullAgeInfo; email_address_changes: UserEmailAddressChange[]; login_ips: IpAudit[]; timezone: string; applications: ConnectedApplication[]; summary: TwitterUserDetails; }; /** --------- */ /** ACCESSORS */ /** --------- */ /** History of screen names used, and when it has changed. */ get screen_name_history(): ScreenNameChange[]; /** History of a user protecting and unprotecting their Tweets, * within the 6 months prior to the date the archive was created */ get protected_history(): GDPRProtectedHistory[]; /** History of e-mail addresses used on the account. */ get email_address_history(): UserEmailAddressChange[]; /** "Guessed" things by Twitter about archive owner. * * ```ts * const p13n = archive.user.personalization; * // "Speaked" languages (this is VERY approximative) * p13n.demographics.languages // => string[] * // Archive owner assigned gender * p13n.demographics.gender // => string * // Subjects of interest * p13n.interests.names // => string[] * // Shows that owner might watched * p13n.interests.shows // => string[] * ``` */ get personalization(): UserPersonalization; /** Age information from Twitter. * If Twitter has tried to guess your age, it is in `age.inferred`. * * Age information can be number or a tuple of 2 numbers, * Twitter can sometimes guess a interval of your age (like 13-54). */ get age(): UserFullAgeInfo; /** Owner IP address when he created his account. */ get account_creation_ip(): string; /** Timezone, but in a strange format. * If your timezone is `Europe/Paris`, here, you will find `Paris`. */ get timezone(): string; /** A list of accepted OAuth application on owner's account. * * This might be incomplete compared to reality, Twitter doesn't seem to include every application. */ get authorized_applications(): ConnectedApplication[]; /** * Contains IP dumps of your last activity on Twitter (using mobile or desktop devices). * * Seems limited up to 7 days from archive creation. */ get last_logins(): IpAudit[]; /** Registred mobile devices that get push notifications, or registred to Twitter's 2FA. */ get devices(): { push_devices: PushDevice[]; messaging_devices: MessagingDevice[]; }; /** `true` if archive owner is verified on Twitter. */ get verified(): boolean; /** * Archive owner phone number (if he registred one), `undefined` otherwise. * Begin by `+` */ get phone_number(): string; /** Current owner email address. */ get email_address(): string; /** User summary (screen name, name, account creation date...) */ get summary(): TwitterUserDetails; /** User screen name (also called Twitter @). */ get screen_name(): string; /** User ID. */ get id(): string; /** Archive owner profile biography. */ get bio(): string; /** Account creation date. */ get created_at(): string; /** Twitter name (also called TN). */ get name(): string; /** Archive owner profile location. */ get location(): string; /** Account profile image (defined only if `archive.is_gdpr === true`). */ get profile_img_url(): string; /** Profile banner. Available if `archive.is_gpdr === true` and if archive owner had a banner. */ get profile_banner_url(): string; /** URL registered on profile. Available if `archive.is_gpdr === true`. */ get url(): string; protected static parseAge(age: string[]): number | [number, number]; } export default UserData;