2022-02-11 13:05:54 +08:00
|
|
|
import type { ComponentClass, ForwardedRef, Component } from 'react';
|
|
|
|
import { PickerProps, RangePickerProps } from '.';
|
2021-09-03 13:24:48 +08:00
|
|
|
|
|
|
|
export interface CommonPickerMethods {
|
|
|
|
focus: () => void;
|
|
|
|
blur: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PickerComponentClass<P = {}, S = unknown> extends ComponentClass<P, S> {
|
|
|
|
new (...args: ConstructorParameters<ComponentClass<P, S>>): InstanceType<ComponentClass<P, S>> &
|
|
|
|
CommonPickerMethods;
|
|
|
|
}
|
2022-02-11 13:05:54 +08:00
|
|
|
|
|
|
|
export type PickerRef<P> = ForwardedRef<Component<P> & CommonPickerMethods>;
|
|
|
|
|
|
|
|
export type DatePickRef<DateType> = PickerRef<PickerProps<DateType>>;
|
|
|
|
|
|
|
|
export type RangePickerRef<DateType> = PickerRef<RangePickerProps<DateType>>;
|