import { Component } from '../component'; import { Phase } from '../symbols'; export interface Hooks { state: T[]; callbacks: Array<{ type: Phase; callback: () => void; }>; } export interface Hook { onUpdate?: (element: Component, hooks: Hooks, index: number) => void; onDidLoad?: (element: Component, hooks: Hooks, index: number) => T; onDidUnload?: (element: Component, hooks: Hooks, index: number) => void; } export declare const clear: () => void; /** * Sets the current element * @param element */ export declare const setCurrentElement: (element: Component) => Component; /** * Returns the current active element * @returns { Component } */ export declare const getCurrentElement: () => Component | null; /** * Returns the current phase of the component. * @returns { phaseSymbol } */ export declare const getCurrentElementPhase: () => Phase | null; /** * Creates a hook and updates the current hook index. * @export * @template T * @param {Hooks} config * @returns {T} */ export declare function createHook(config: Hook): T; //# sourceMappingURL=hook.d.ts.map