import type { Component } from '@endorphinjs/template-runtime'; /** * Helper functions, used in templates and component definitions. * The fist argument of every helper *must* be a component! */ /** * Dispatches bubbling `type` event on given `elem` element */ export declare function emit(elem: T, type: string, detail?: {}): T; /** * Same as `emit` but doesn’t bubble up event. A convenience for notifying component * subscribers only. */ export declare function notify(elem: T, type: string, detail?: {}): T; /** * Subscribes on given `type` event on `elem` element */ export declare function on(elem: T, type: string, callback: (this: T, ev: Event) => any, options?: AddEventListenerOptions | boolean): T; /** * Unsubscribes from given `type` event on `elem` element */ export declare function off(elem: T, type: string, callback: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): T; /** * Returns amount of elements in given collection. For non-collections returns * `0` for `null` and `undefined, `1` for all other types */ export declare function count(component: Component, obj: any): number; /** * Check if given `value` exists in `collection` */ export declare function contains(component: Component, collection: any, value: any): boolean; /** * Returns index of given `value` in collection */ export declare function indexOf(component: Component, data: string | any[], value: any): number; /** * Replaces given `pattern` in string with `value` */ export declare function replace(component: Component, str: string, pattern: string | RegExp, value: string): string; /** * Returns lowercase version of given string */ export declare function lowercase(component: Component, str: string): string; /** * Returns uppercase version of given string */ export declare function uppercase(component: Component, str: string): string; /** * Returns slice of given string or array */ export declare function slice(component: Component, data: T[], start?: number, end?: number): T; export declare function slice(component: Component, data: string, start?: number, end?: number): string; /** * Logs given data */ export declare function log(component: Component, ...args: any[]): void; /** * Returns slot container with given name */ export declare function getSlot(component: Component, name: string): Element | void;