import TBLClassicUnitController from './TBLClassicUnitController'; import { type TBLExtraProperties, TBLFetchingPolicy, TBLPlacementType } from '../types'; import type { TBLClassicListener } from './TBLClassicListener'; /** * Represents a classic page in the Taboola React Native Plugin. * * The TBLClassicPage class is a core component of the Taboola SDK, responsible for managing * and displaying content recommendations on a specific screen within an application. * * Key Responsibilities: * - **Initialization**: Create an instance for each screen, specifying the `pageUrl` and `pageType` * to identify and categorize the content. * - **Content Management**: Acts as a container for multiple TBLClassicUnit instances, each representing * a specific placement on the screen, such as a widget or a feed. * - **Event Handling**: Works with TBLClassicListener to handle user interactions, allowing developers * to manage events like content clicks. * - **Content Fetching**: Facilitates the dynamic loading and display of content for the units associated * with the page. * * - The `buildUnit()` method is designed to be asynchronous to prevent blocking the UI thread. * - Native TBLClassicUnit creation occurs on the main thread via Turbo Modules, which by default * run on a background thread. * - This approach ensures smooth UI performance during unit initialization and content loading. * * This class provides methods to interact with and manipulate a Taboola page */ declare class TBLClassicPage { /** * The unique identifier for the page. */ pageId: string | undefined; /** * Array to track all created TBLClassicUnitController instances */ private unitControllers; /** * Constructs a new TBLClassicPage instance. * @param pageUrl - The URL of the page E.g. "https://www.example.com/articles?id=123". * @param pageType - The type of the page e.g. "article". */ constructor(pageUrl: string, pageType: string); /** * Builds a new TBLClassicUnit for the page. * @param placement - The placement name. * @param mode - The mode of the placement. * @param placementType - The type of the placement. * @param tblClassicListener * @returns A promise that resolves to a TBLClassicUnit. */ buildUnit(placement: string, mode: string, placementType: TBLPlacementType, tblClassicListener: TBLClassicListener): Promise; /** * Clears all unit controllers and their associated resources. * * This method: * - Removes all units from the page * - Clears event listeners for each unit * - Destroys WebView resources (Android) * - Makes all units unavailable for further use * * @warning After calling this method, all units become permanently unavailable * and cannot be reused. */ clearUnits(): void; /** * Sets extra properties for the page. * @param extraProperties - The extra properties to set. */ setPageExtraProperties(extraProperties: TBLExtraProperties): void; /** * Resets the page and clears all unit controllers */ reset(): void; /** * Refreshes the page. */ refresh(): void; /** * Gets the page view ID. * @returns The page view ID, or undefined if invalid. */ getPageViewId(): string | undefined; /** * Sets the serial fetch timeout for the page. * @param timeoutMillis - The timeout in milliseconds. */ setSerialFetchTimeout(timeoutMillis: number): void; /** * Sets the URL for the page. * @param pageUrl - The new URL for the page. */ setPageUrl(pageUrl: string): void; /** * Sets the target type for the page. * @param targetType - The target type to set. */ setTargetType(targetType: string): void; /** * Sets the type of the page. * @param pageType - The new type for the page. */ setPageType(pageType: string): void; /** * Sets whether the page should auto-resize its height. * @param autoResizeHeight - Whether to enable auto-resize. */ setAutoResizeHeight(autoResizeHeight: boolean): void; /** * Sets a tag for the page. * @param tag - The tag to set. */ setTag(tag: string): void; /** * Sets the user ID for the page. * @param userId - The user ID to set. */ setUserId(userId: string): void; /** * Sets the publisher for the page. * @param publisher - The publisher to set. */ setPublisher(publisher: string): void; /** * Updates the page ID. * @param updatedPageId - The new page ID. */ setPageId(updatedPageId: string): void; /** * Sets the fetching policy for the page. * @param fetchingPolicy - The fetching policy to set. */ setFetchingPolicy(fetchingPolicy: TBLFetchingPolicy): void; /** * Clears all fetch requests for the page. */ clearAllFetchRequests(): void; /** * Fetches all units content for the page. */ fetchAllUnitsContent(): void; } export default TBLClassicPage; //# sourceMappingURL=TBLClassicPage.d.ts.map