import { AttributeError, AttributeInvalidError, AttributeRequiredError } from './attribute-error'; import { GetIwControllerFn, JQueryPluginExtras, JQueryPluginFn, JQueryPluginPreInitFn } from './custom-component-types'; declare global { interface JQuery { getIwController, TElement extends HTMLElement = HTMLElement>(): TComponent; } } export interface CustomComponent { constructor: typeof CustomComponent; } /** * A base class that handles shared functionality for custom components */ export declare class CustomComponent { readonly $el: JQuery; static readonly CUSTOM_COMPONENT_ATTR: string; /** * Returns a selector string that can be used to find elements bound to a {@link CustomComponent} instance. * * The iw-component attribute is automatically added to any component using {@link CustomComponent} so they * can be easily identified. */ static readonly CUSTOM_COMPONENT_SELECTOR: string; /** * Extend jQuery with the component's jQuery plugin function. */ static loadPlugin(): void; /** * Overridden to return a CSS selector for the host element of the component. * * @abstract */ static COMPONENT_SELECTOR: string; static get ID_PREFIX(): string; protected static getIdPrefix(): string; protected static readonly TEMPLATE: string; static getController, TElement extends HTMLElement = HTMLElement>($el: JQuery): TComponent; static bind, TElement extends HTMLElement = HTMLElement>($el: JQuery): TComponent; static jQueryPlugin(controllerName: string, extras?: TExtras, preInit?: JQueryPluginPreInitFn): JQueryPluginFn & TExtras; /** * Returns a function that can act as an initializer for the component */ protected static jQueryInitFn(preInit?: JQueryPluginPreInitFn): (this: JQuery) => JQuery; static jQueryComponentControllerFn(): GetIwControllerFn; readonly el: TElement; readonly id: string; protected readonly idPrefix: string; constructor($el: JQuery); /** * Returns a CSS selector style string with the tag name and ID representing the component host element. * * Example: iw-component#some-id--1 */ getDebugIdentifier(): string; protected getDebugIdentifierById(): string; protected attributeError(attributeName: string, message: string, required?: boolean): AttributeError; protected attributeInvalidError(attributeName: string, reason: string, value: any): AttributeInvalidError; protected requiredAttributeError(attributeName: string): AttributeRequiredError; }