UNPKG

@goaltime/timescape

Version:

A flexible, headless date and time input library for JavaScript. Provides tools for building fully customizable date and time input fields, with support for libraries like React, Preact, Vue, Svelte and Solid.

49 lines (46 loc) 1.71 kB
import * as signals from '@preact/signals'; import { MutableRef } from 'preact/hooks'; import TimescapeManager, { Options, DateType, RangeOptions } from './index.cjs'; export { $NOW } from './index.cjs'; declare const useTimescape: (options?: Options) => { readonly _manager: TimescapeManager; readonly getInputProps: (type: DateType, opts?: { ref?: MutableRef<HTMLInputElement | null>; autofocus?: boolean; }) => { ref: (element: HTMLInputElement | null) => void; }; readonly getSelectProps: (type: DateType, opts?: { ref?: MutableRef<HTMLSelectElement | null>; }) => { ref: (element: HTMLSelectElement | null) => void; }; readonly getRootProps: () => { ref: (element: HTMLElement | null) => void | null; }; readonly options: signals.Signal<Options>; }; declare const useTimescapeRange: (options?: RangeOptions) => { readonly getRootProps: () => { ref: (element: HTMLElement | null) => void; }; readonly from: { readonly getInputProps: (type: DateType, opts?: { ref?: MutableRef<HTMLInputElement | null>; autofocus?: boolean; }) => { ref: (element: HTMLInputElement | null) => void; }; readonly options: signals.Signal<Options>; }; readonly to: { readonly getInputProps: (type: DateType, opts?: { ref?: MutableRef<HTMLInputElement | null>; autofocus?: boolean; }) => { ref: (element: HTMLInputElement | null) => void; }; readonly options: signals.Signal<Options>; }; }; export { DateType, Options, RangeOptions, useTimescape, useTimescapeRange };