element-vir
Version:
Heroic. Reactive. Declarative. Type safe. Web components without compromise.
25 lines (24 loc) • 1.59 kB
TypeScript
import { type EmptyObject } from 'type-fest';
import { type DirectiveResult } from '../../lit-exports/all-lit-exports.js';
import { type PropertyInitMapBase } from '../properties/element-properties.js';
export type ElementDefinitionWithInputsType<InputsType extends PropertyInitMapBase = PropertyInitMapBase> = {
InputsType: InputsType;
};
/**
* Assign an object matching an element's inputs to its inputs.
*
* @deprecated Instead of using this directive, assign inputs directly on the element's
* interpolation opening tag interpolation.
* @example Html`<${MyElement} ${assign(MyElement, {value: 1})}>...` should be
* html`<${MyElement.assign({value: 1})}>...`
*/
export declare function assign<const SpecificDeclarativeElement extends ElementDefinitionWithInputsType>(declarativeElement: SpecificDeclarativeElement, inputsObject: EmptyObject extends Required<SpecificDeclarativeElement['InputsType']> ? never : SpecificDeclarativeElement['InputsType']): DirectiveResult;
/**
* Assign an object matching an element's inputs to its inputs.
*
* @deprecated Instead of using this directive, assign inputs directly on the element's
* interpolation opening tag interpolation.
* @example Html`<${MyElement} ${assign(MyElement, {value: 1})}>...` should be
* html`<${MyElement.assign({value: 1})}>...`
*/
export declare function assign<const SpecificDeclarativeElement extends ElementDefinitionWithInputsType, const SpecificInput extends SpecificDeclarativeElement['InputsType']>(inputsObject: SpecificInput extends typeof HTMLElement ? never : SpecificInput): DirectiveResult;