import { Components } from "../component"; import type { DOMElementComponent, DOMElementTagNameMap } from "../dom"; /** * A nullable reference to an object. * * Commonly used to reference a component. * * **Note**: The `current` property of the `Ref` object can be `null`, * which is the biggest difference to a model. */ export interface Ref { /** * The referenced object. */ current: T | null; } /** * Create a `Ref` object. * * **Note**: If type of the referenced object is not specified, * it defaults to something that has a `main` element. * * @param current The initial value of the `current` property. * @returns The `Ref` object. */ export declare function ref(current?: T | null): Ref; /** * A `Ref` object that merges multiple `Ref` objects. */ export interface MergedRef extends Ref { mergedCurrent: T | null; } /** * Create a `Ref` object that merges multiple `Ref` objects. * * @param refs The `Ref` objects to merge. * @returns The merged `Ref` object. */ export declare function mergeRefs(...refs: Ref[]): MergedRef; /** * Something that has a primary element. */ type PrimaryElOwner = { readonly $primaryEl: T | undefined; }; /** * A reference to a something that has a primary element. */ export type PrimaryElRef = Ref>; /** * A reference to a DOM element. */ export type ElementRef = Ref>; /** * Create a `Ref` object refs to a DOM element component. * * @param current The initial value of the `current` property. * @returns The `Ref` object. */ export declare function elementRef(current?: DOMElementComponent | null): Ref>; /** * A reference to a component. */ export type ComponentRef = Ref; /** * Create a `Ref` object refs to a component. * * @param current The initial value of the `current` property. * @returns The `Ref` object. */ export declare function componentRef(current?: Components[N] | null): ComponentRef; export {}; //# sourceMappingURL=ref.d.ts.map