amotify
Version:
UI Component for React,NextJS,esbuild
82 lines (81 loc) • 2.79 kB
TypeScript
/// <reference types="react" />
import { ReactElement } from '../../../@declares';
import { InputTypes } from '..';
export declare namespace TimeTypes {
type Era = 'clock' | 'year' | 'meiji' | 'taisho' | 'shouwa' | 'heisei' | 'reiwa';
type Restrict = 'clock' | 'date' | 'week' | 'month' | 'year' | 'period.clock' | 'period.date' | 'period.month' | 'locale.jp.warekiDate';
type Range = {
type: 'hour' | 'minute' | 'date' | 'month' | 'year' | 'week' | 'locale.jp.warekiDate';
from: number;
length: number;
region?: number;
};
type Focus = {
active: boolean;
index: number;
prevIndex: number;
};
}
declare namespace Time {
type Methods = {
Clock(props: Input): React.JSX.Element;
Date(props: Input): React.JSX.Element;
Week(props: Input): React.JSX.Element;
Month(props: Input): React.JSX.Element;
Year(props: Input): React.JSX.Element;
Locale: {
JP: {
WarekiDate(props: DateJPEra): React.JSX.Element;
};
};
Periods: {
Clock(props: Period): React.JSX.Element;
Date(props: Period): React.JSX.Element;
Month(props: Period): React.JSX.Element;
};
};
type Era = TimeTypes.Era;
type Restrict = TimeTypes.Restrict;
type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
label?: ReactElement;
tone?: InputTypes.BoxTone;
tabIndex?: number;
id?: string;
disabled?: boolean;
value?: string | [string, string];
min?: string;
max?: string;
periodPresets?: TimeSelector.Input['periodPresets'];
leftIndicator?: ReactElement | false;
rightIndicator?: ReactElement | false;
leftIcon?: ReactElement | false;
rightIcon?: ReactElement | false;
};
type Origin = Input & {
restrict: Restrict;
era?: Era;
};
type DateJPEra = Input & {
value?: string;
defaultEra?: 'year' | 'wareki';
};
type Period = Omit<Input, 'value'> & {
value?: [string, string];
};
type Range = TimeTypes.Range;
type WrapperStates = {
rootStates: Origin;
val_status: InputTypes.Status.Time;
set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Time>>;
val_era: Era;
set_era: React.Dispatch<React.SetStateAction<Era>>;
val_focus: TimeTypes.Focus;
set_focus: React.Dispatch<React.SetStateAction<TimeTypes.Focus>>;
};
}
import { TimeSelector } from './Selector';
export { TimeSelector };
declare const Time: Time.Methods & {
Origin: (props: Time.Origin) => React.JSX.Element;
};
export { Time, Time as default };