UNPKG

@instawork/design-system

Version:

The design system for Instawork's web apps

32 lines (31 loc) 1.17 kB
import { CustomComponent } from './custom-component'; export interface GetIwControllerFn { <TComponent extends CustomComponent<TElement>, TElement extends HTMLElement = HTMLElement>(): TComponent; } export declare type JQueryPluginExtras = { [key: string]: any; }; /** * A function that is called before initializing a component plugin. * * Can be used, for example, to check compatibility of specific browser features. */ export interface JQueryPluginPreInitFn<TElement extends HTMLElement = HTMLElement> { (this: JQuery<TElement>): void; } export interface JQueryPluginFn<TElement extends HTMLElement = HTMLElement> { (this: JQuery<TElement>): JQuery<TElement>; readonly COMPONENT_SELECTOR: string; readonly CUSTOM_COMPONENT_ATTR: string; readonly CUSTOM_COMPONENT_SELECTOR: string; } /** * Defines a custom component that requires an explicit method call to extend jQuery as a plugin. */ export interface JQueryComponentPlugin { loadPlugin(): void; } /** * Returns `true` if obj is a {@link JQueryComponentPlugin}; otherwise `false`. */ export declare function isJQueryComponentPlugin(obj: any): obj is JQueryComponentPlugin;