@tempots/dom
Version:
Fully-typed frontend framework alternative to React and Angular
46 lines (45 loc) • 1.89 kB
TypeScript
import { Prop } from '@tempots/core';
import { Renderable } from '../types/domain';
import { HTMLEvents } from '../types/html-events';
/**
* Binds a `Date` property to an input element. The binding is two-way.
* Changes to the input element will update the property but will only be
* affected by day changes and ignore time changes.
* @param prop - The `Date` property to bind.
* @param handler - The event handler to use (default: 'input').
* @returns A Renderable.
* @public
*/
export declare const BindDate: (prop: Prop<Date>, handler?: keyof HTMLEvents) => Renderable;
/**
* Binds a `Date` property to an input element. The binding is two-way.
* @param prop - The `Date` property to bind.
* @param handler - The event handler to use (default: 'input').
* @returns A Renderable.
* @public
*/
export declare const BindDateTime: (prop: Prop<Date>, handler?: keyof HTMLEvents) => Renderable;
/**
* Binds a `number` property to an input element. The binding is two-way.
* @param prop - The `number` property to bind.
* @param handler - The event handler to use (default: 'input').
* @returns A Renderable.
* @public
*/
export declare const BindNumber: (prop: Prop<number>, handler?: keyof HTMLEvents) => Renderable;
/**
* Binds a `string` property to an input element. The binding is two-way.
* @param prop - The `string` property to bind.
* @param handler - The event handler to use (default: 'input').
* @returns A Renderable.
* @public
*/
export declare const BindText: (prop: Prop<string>, handler?: keyof HTMLEvents) => Renderable;
/**
* Binds a `boolean` property to the checked value of an input element. The binding is two-way.
* @param prop - The `boolean` property to bind.
* @param handler - The event handler to use (default: 'input').
* @returns A Renderable.
* @public
*/
export declare const BindChecked: (prop: Prop<boolean>) => Renderable;