yzsd
Version:
a niubi UI component
20 lines (19 loc) • 1.2 kB
TypeScript
import type { InputProps as RcInputProps, InputRef } from 'rc-input';
import React from 'react';
export interface InputFocusOptions extends FocusOptions {
cursor?: 'start' | 'end' | 'all';
}
export type { InputRef };
export declare function fixControlledValue<T>(value: T): string;
export declare function resolveOnChange<E extends HTMLInputElement | HTMLTextAreaElement>(target: E, e: React.ChangeEvent<E> | React.MouseEvent<HTMLElement, MouseEvent> | React.CompositionEvent<HTMLElement>, onChange: undefined | ((event: React.ChangeEvent<E>) => void), targerValue?: string): void;
export declare function triggerFocus(element?: HTMLInputElement | HTMLTextAreaElement, option?: InputFocusOptions): void;
export interface InputProps extends Omit<RcInputProps, 'wrapperClassName' | 'groupClassName' | 'inputClassName' | 'affixWrapperClassName'> {
size?: 'small' | 'middle' | 'large';
disabled?: boolean;
status?: '' | 'warning' | 'error';
bordered?: boolean;
[key: `data-${string}`]: string | undefined;
}
type CompoundedComponent = React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
declare const Input: CompoundedComponent;
export default Input;