import { type JSX, type Accessor } from "solid-js";
import { type FalsyValue } from "@solid-primitives/utils";
declare module "solid-js" {
namespace JSX {
interface Directives {
autofocus: boolean;
}
}
}
/**
* Directive to autofocus the element on render. Uses the native `autofocus` attribute to decided whether to focus.
*
* @param element - Element to focus.
* @param autofocus - Should this directive be enabled. defaults to false.
*
* @example
* ```ts
* ;
*
* // or with ref
* ;
* ```
*/
export declare const autofocus: (element: HTMLElement, autofocus?: Accessor) => void;
/**
* Creates a new reactive primitive for autofocusing the element on render.
*
* @param ref - Element to focus.
* @param autofocus - Whether the element should be autofocused. defaults to true.
*
* @example
* ```ts
* let ref!: HTMLButtonElement;
*
* createAutofocus(() => ref); // Or using a signal accessor.
*
* ;
* ```
*/
export declare const createAutofocus: (ref: Accessor) => void;
export type E = JSX.Element;