import { LitElement } from 'lit'; import { LisCancelPromiseController } from './controllers'; /** * A single result of a linkout performed by the * {@link LisLinkoutElement | `LisLinkoutElement`} class. */ export type LinkoutResult = { href: string; text: string; }; /** * The type of object the {@link LisLinkoutElement | `LisLinkoutElement`} expects back * from the linkout function. */ export type LinkoutResults = { results: LinkoutResult[]; }; /** * Optional parameters that may be given to the linkout function. The * {@link !AbortSignal | `AbortSignal`} instance will emit if a linkout is performed * before the current linkout completes. This signal should be used to cancel in-flight * requests if the linkout API supports it. */ export type LinkoutOptions = { abortSignal?: AbortSignal; }; /** * The signature of the function of the * {@link LisLinkoutElement | `LisLinkoutElement`} class required for * performing a linkout. * * @typeParam LinkoutData - The type of the linkout function `linkoutData` parameter. * * @param linkoutData The data to give to the linkout function. * @param options Optional parameters that aren't required to perform a linkout but may * be useful. * * @returns A {@link !Promise | `Promise`} that resolves to a * {@link LinkoutResults | `LinkoutResults`} object. */ export type LinkoutFunction = (linkoutData: LinkoutData, options: LinkoutOptions) => Promise; /** * @htmlElement `` * * A Web Component that provides an interface for performing linkout queries against an * a linkout service. * The returned links are displayed in a table. * * @example * {@link !HTMLElement | `HTMLElement`} properties can only be set via * JavaScript. This means the {@link linkoutFunction | `LinkoutFunction`} property * must be set on a `` tag's instance of the * {@link LisLinkoutElement | `LisLinkoutElement`} class. For example: * ```html * * * * * ``` */ export declare class LisLinkoutElement extends LitElement { protected cancelPromiseController: LisCancelPromiseController; /** @ignore */ static styles: import("lit").CSSResult; /** @ignore */ createRenderRoot(): this; linkoutFunction: LinkoutFunction; private _table; private _loadingRef; /** * Gets linkouts for the given data. * * @typeParam LinkoutData - Should match the type of the linkout function `linkoutData` * parameter. * * @param data - The data to get linkouts for. */ getLinkouts(data: LinkoutData): void; /** @ignore */ private _linkoutSuccess; /** @ignore */ render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'lis-linkout-element': LisLinkoutElement; } } //# sourceMappingURL=lis-linkout-element.d.ts.map