angular-twitter-timeline
Version:
Angular Public Twitter Timeline Widget
112 lines (106 loc) • 4.01 kB
TypeScript
import { Observable } from 'rxjs';
import * as i0 from '@angular/core';
declare class AngularTwitterTimelineService {
private readonly TWITTER_SCRIPT_ID;
private readonly TWITTER_WIDGET_URL;
loadScript(): Observable<any>;
private startScriptLoad;
static ɵfac: i0.ɵɵFactoryDeclaration<AngularTwitterTimelineService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<AngularTwitterTimelineService>;
}
/**
* Updated interface for X (Twitter) Embedded Timeline options
* Based on the latest X platform changes (November 2024)
* Reference: https://twittercommunity.com/t/embedded-timelines-update-parameters-support/177112
*
* DEPRECATED PARAMETERS (no longer supported):
* - tweetLimit (removed)
* - chrome (removed)
* - ariaPolite (removed)
* - borderColor (removed)
*/
declare class AngularTwitterTimelineOptionsInterface {
/**
* Set a fixed height of the embedded widget
* Positive integer (in pixels)
* Recommended range: 200-2000
*/
height?: number;
/**
* Set a fixed width of the embedded widget
* Positive integer (in pixels)
* Note: Timeline will be responsive if not specified
*/
width?: number;
/**
* Sets the theme of the widget. Default = 'light'.
* Supported values: 'light' or 'dark'
*/
theme?: 'light' | 'dark';
/**
* Language code for the rendered timeline
* BCP 47 language code (e.g., 'en', 'es', 'fr', 'de', 'ja')
* Default: User's browser language
*/
lang?: string;
/**
* @deprecated This parameter is no longer supported by X (Twitter)
* Previously used to limit the number of tweets displayed
*/
tweetLimit?: number;
/**
* @deprecated This parameter is no longer supported by X (Twitter)
* Previously used to adjust border colors
*/
borderColor?: string;
/**
* @deprecated This parameter is no longer supported by X (Twitter)
* Previously used to toggle display elements (noheader, nofooter, etc.)
*/
chrome?: string[];
/**
* @deprecated This parameter is no longer supported by X (Twitter)
* Previously used for aria-polite behavior
*/
ariaPolite?: string[];
}
/**
* Interface for X (Twitter) Embedded Timeline data configuration
* Updated for X platform changes (November 2024)
*/
declare class AngularTwitterTimelineDataInterface {
/**
* Type of timeline to embed
* 'profile' - User profile timeline
* 'url' - Timeline from a specific URL (profile, likes, list, or collection)
*/
sourceType: 'profile' | 'url';
/**
* Valid X (Twitter) username (without @ symbol)
* Used when sourceType is 'profile'
* Example: 'mustafaer_dev'
*/
screenName?: string;
/**
* Absolute URL of an X (Twitter) profile, likes, list, or collection
* Used when sourceType is 'url'
* Example: 'https://twitter.com/angular' or 'https://x.com/angular'
*/
url?: string;
}
declare class AngularTwitterTimelineComponent {
data: i0.InputSignal<AngularTwitterTimelineDataInterface | undefined>;
/**
* A hash of additional options to configure the widget
*/
opts: i0.InputSignal<AngularTwitterTimelineOptionsInterface | undefined>;
private element;
private twitterTimelineService;
defaultOpts: AngularTwitterTimelineOptionsInterface;
defaultData: AngularTwitterTimelineDataInterface;
constructor();
loadTwitterWidget(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<AngularTwitterTimelineComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AngularTwitterTimelineComponent, "angular-twitter-timeline", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "opts": { "alias": "opts"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
export { AngularTwitterTimelineComponent, AngularTwitterTimelineDataInterface, AngularTwitterTimelineOptionsInterface, AngularTwitterTimelineService };