import { Context, Event, Page, PageRenderer } from './types'; import { LitElement, PropertyDeclarations, TemplateResult } from 'lit-element'; import { State } from 'xstate'; declare const Base: typeof LitElement & import("lit-element").Constructor & { inferredProperties: string[]; } & import("lit-element").Constructor; /** * Renders an element for each page in a collection. * * @fires NucleonElement#update - Instance of `NucleonElement.UpdateEvent`. Dispatched on an element whenever it changes its state. * @fires NucleonElement#fetch - Instance of `NucleonElement.API.FetchEvent`. Emitted before each API request. * * @element foxy-collection-pages * @since 1.1.0 */ export declare class CollectionPages extends Base { /** @readonly */ static get properties(): PropertyDeclarations; /** Spread directive argument from `@open-wc/lit-helpers` (properties, event listeners and attributes you'd like to pass to the page element). */ props: Record; /** Optional ISO 639-1 code describing the language element content is written in. */ lang: string; ns: string; private __renderPage; private __page; private __group; private __stopTrackingRumour; private __fetchEventHandler; private __service; constructor(); /** * Custom element tag or a render function to use for displaying collection pages. * Generated custom elements will have the following attributes: * * - `group` – same as `foxy-collection-pages[group]`; * - `href` – collection page's `_links.self.href` value; * - `lang` – same as `foxy-collection-pages[lang]`; * - `item` – will contain `item-tag` when provided with a string value formatted as `page-tag item-tag`. * * Render function will receive `PageRenderer` in the first argument. * Uses `foxy-collection-page` by default. */ get page(): string | PageRenderer; set page(value: string | PageRenderer); /** URL of the first page in a collection. */ get first(): string; set first(data: string); /** Array of all currently loaded pages in a collection. */ get pages(): TPage[]; set pages(data: TPage[]); /** Rumour group. Elements in different groups will not share updates. Empty by default. */ get group(): string; set group(value: string); /** If false, will load pages on scroll. If true, will display a button triggering the process. */ get manual(): boolean; set manual(data: boolean); /** * Checks if this element is in the given state. Available states: * * - `busy` when loading a page; * - `fail` when page load fails; * - `idle` when not loading anything for one of the reasons below: * - `paused` if waiting for user to scroll further; * - `manual` when next page load will be triggered by clicking a button; * - `auto` when next page load will be triggered by scrolling to the observer target; * - `empty` if collection is empty; * - `end` if there are no more items in a collection. * * @example element.in({ idle: 'empty' }) */ in(stateValue: State['value']): boolean; /** @readonly */ createRenderRoot(): CollectionPages; /** @readonly */ connectedCallback(): void; /** @readonly */ render(): TemplateResult; /** @readonly */ updated(changes: Map): void; /** @readonly */ disconnectedCallback(): void; private __trackRumour; private __createService; private __handleFetchEvent; private __respondIfPossible; private __stallRequest; private __failRequest; } export {};