UNPKG

element-vir

Version:

Heroic. Reactive. Declarative. Type safe. Web components without compromise.

39 lines (38 loc) 1.49 kB
import { Directive, type PartInfo } from '../../lit-exports/all-lit-exports.js'; /** * Parameters for the callback given to the {@link mutate} directive. * * @category Internal */ export type MutateDirectiveParams<Params extends any[] = []> = { directive: Directive; element: HTMLElement; params: Params; }; /** * A directive that allows arbitrary modifications to be made to the element that it's attached to. * * @category Directives */ export declare const mutate: (callback: (params: Omit<MutateDirectiveParams, "params">) => void) => import("lit-html/directive.js").DirectiveResult<{ new (partInfo: PartInfo): { readonly element: HTMLElement; lastKey: string | undefined; render(callback: (params: Omit<MutateDirectiveParams, "params">) => void): symbol; readonly _$isConnected: boolean; update(_part: import("lit-html").Part, props: Array<unknown>): unknown; }; }>; /** * A helper for making new directives. * * @category Internal */ export declare function createMutateDirective<Params extends any[]>(directiveName: string, callback: (this: void, params: MutateDirectiveParams<Params>) => void): (...values: Params) => import("lit-html/directive.js").DirectiveResult<{ new (partInfo: PartInfo): { readonly element: HTMLElement; render(...params: Params): symbol; readonly _$isConnected: boolean; update(_part: import("lit-html").Part, props: Array<unknown>): unknown; }; }>;