mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
types: export props types
This commit is contained in:
parent
70eec20d25
commit
a3380f08c0
@ -1,8 +1,9 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _AddressEdit from './AddressEdit';
|
import _AddressEdit, { AddressEditProps } from './AddressEdit';
|
||||||
|
|
||||||
export const AddressEdit = withInstall(_AddressEdit);
|
export const AddressEdit = withInstall(_AddressEdit);
|
||||||
export default AddressEdit;
|
export default AddressEdit;
|
||||||
|
export type { AddressEditProps };
|
||||||
export type {
|
export type {
|
||||||
AddressEditInfo,
|
AddressEditInfo,
|
||||||
AddressEditInstance,
|
AddressEditInstance,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Area from './Area';
|
import _Area, { AreaProps } from './Area';
|
||||||
|
|
||||||
export const Area = withInstall(_Area);
|
export const Area = withInstall(_Area);
|
||||||
export default Area;
|
export default Area;
|
||||||
|
export type { AreaProps };
|
||||||
export type { AreaList, AreaInstance, AreaColumnOption } from './types';
|
export type { AreaList, AreaInstance, AreaColumnOption } from './types';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Calendar from './Calendar';
|
import _Calendar, { CalendarProps } from './Calendar';
|
||||||
|
|
||||||
export const Calendar = withInstall(_Calendar);
|
export const Calendar = withInstall(_Calendar);
|
||||||
export default Calendar;
|
export default Calendar;
|
||||||
|
export type { CalendarProps };
|
||||||
export type {
|
export type {
|
||||||
CalendarType,
|
CalendarType,
|
||||||
CalendarDayItem,
|
CalendarDayItem,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _CheckboxGroup from './CheckboxGroup';
|
import _CheckboxGroup, { CheckboxGroupProps } from './CheckboxGroup';
|
||||||
|
|
||||||
export const CheckboxGroup = withInstall(_CheckboxGroup);
|
export const CheckboxGroup = withInstall(_CheckboxGroup);
|
||||||
export default CheckboxGroup;
|
export default CheckboxGroup;
|
||||||
|
export type { CheckboxGroupProps };
|
||||||
export type {
|
export type {
|
||||||
CheckboxGroupInstance,
|
CheckboxGroupInstance,
|
||||||
CheckboxGroupToggleAllOptions,
|
CheckboxGroupToggleAllOptions,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Checkbox from './Checkbox';
|
import _Checkbox, { CheckboxProps } from './Checkbox';
|
||||||
|
|
||||||
export const Checkbox = withInstall(_Checkbox);
|
export const Checkbox = withInstall(_Checkbox);
|
||||||
export default Checkbox;
|
export default Checkbox;
|
||||||
|
export type { CheckboxProps };
|
||||||
export type { CheckboxInstance } from './types';
|
export type { CheckboxInstance } from './types';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _CollapseItem from './CollapseItem';
|
import _CollapseItem, { CollapseItemProps } from './CollapseItem';
|
||||||
|
|
||||||
export const CollapseItem = withInstall(_CollapseItem);
|
export const CollapseItem = withInstall(_CollapseItem);
|
||||||
export default CollapseItem;
|
export default CollapseItem;
|
||||||
|
export type { CollapseItemProps };
|
||||||
export type { CollapseItemInstance } from './types';
|
export type { CollapseItemInstance } from './types';
|
||||||
|
@ -1,17 +1,11 @@
|
|||||||
import {
|
import { watch, computed, defineComponent, ExtractPropTypes } from 'vue';
|
||||||
watch,
|
|
||||||
computed,
|
|
||||||
defineComponent,
|
|
||||||
ExtractPropTypes,
|
|
||||||
ComponentPublicInstance,
|
|
||||||
} from 'vue';
|
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { truthProp, createNamespace } from '../utils';
|
import { truthProp, createNamespace } from '../utils';
|
||||||
import { parseFormat } from './utils';
|
import { parseFormat } from './utils';
|
||||||
|
|
||||||
// Composables
|
// Composables
|
||||||
import { useCountDown, CurrentTime } from '@vant/use';
|
import { useCountDown } from '@vant/use';
|
||||||
import { useExpose } from '../composables/use-expose';
|
import { useExpose } from '../composables/use-expose';
|
||||||
|
|
||||||
const [name, bem] = createNamespace('count-down');
|
const [name, bem] = createNamespace('count-down');
|
||||||
@ -29,20 +23,7 @@ const props = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type CountDownProps = ExtractPropTypes<typeof props>;
|
export type CountDownProps = ExtractPropTypes<typeof props>;
|
||||||
|
|
||||||
type CountDownExpose = {
|
|
||||||
start: () => void;
|
|
||||||
pause: () => void;
|
|
||||||
reset: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type CountDownInstance = ComponentPublicInstance<
|
|
||||||
CountDownProps,
|
|
||||||
CountDownExpose
|
|
||||||
>;
|
|
||||||
|
|
||||||
export type CountDownCurrentTime = CurrentTime;
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name,
|
name,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _CountDown from './CountDown';
|
import _CountDown, { CountDownProps } from './CountDown';
|
||||||
|
|
||||||
export const CountDown = withInstall(_CountDown);
|
export const CountDown = withInstall(_CountDown);
|
||||||
export default CountDown;
|
export default CountDown;
|
||||||
export type { CountDownInstance, CountDownCurrentTime } from './CountDown';
|
export type { CountDownProps };
|
||||||
|
export type { CountDownInstance, CountDownCurrentTime } from './types';
|
||||||
|
16
packages/vant/src/count-down/types.ts
Normal file
16
packages/vant/src/count-down/types.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import type { ComponentPublicInstance } from 'vue';
|
||||||
|
import type { CurrentTime } from '@vant/use';
|
||||||
|
import type { CountDownProps } from './CountDown';
|
||||||
|
|
||||||
|
type CountDownExpose = {
|
||||||
|
start: () => void;
|
||||||
|
pause: () => void;
|
||||||
|
reset: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type CountDownInstance = ComponentPublicInstance<
|
||||||
|
CountDownProps,
|
||||||
|
CountDownExpose
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type CountDownCurrentTime = CurrentTime;
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _DatetimePicker from './DatetimePicker';
|
import _DatetimePicker, { DatetimePickerProps } from './DatetimePicker';
|
||||||
|
|
||||||
export const DatetimePicker = withInstall(_DatetimePicker);
|
export const DatetimePicker = withInstall(_DatetimePicker);
|
||||||
export default DatetimePicker;
|
export default DatetimePicker;
|
||||||
|
export type { DatetimePickerProps };
|
||||||
export type { DatetimePickerType, DatetimePickerInstance } from './types';
|
export type { DatetimePickerType, DatetimePickerInstance } from './types';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _DropdownItem from './DropdownItem';
|
import _DropdownItem, { DropdownItemProps } from './DropdownItem';
|
||||||
|
|
||||||
export const DropdownItem = withInstall(_DropdownItem);
|
export const DropdownItem = withInstall(_DropdownItem);
|
||||||
export default DropdownItem;
|
export default DropdownItem;
|
||||||
|
export type { DropdownItemProps };
|
||||||
export type { DropdownItemInstance, DropdownItemOption } from './types';
|
export type { DropdownItemInstance, DropdownItemOption } from './types';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _DropdownMenu from './DropdownMenu';
|
import _DropdownMenu, { DropdownMenuProps } from './DropdownMenu';
|
||||||
|
|
||||||
export const DropdownMenu = withInstall(_DropdownMenu);
|
export const DropdownMenu = withInstall(_DropdownMenu);
|
||||||
export default DropdownMenu;
|
export default DropdownMenu;
|
||||||
|
export type { DropdownMenuProps };
|
||||||
export type { DropdownMenuDirection } from './types';
|
export type { DropdownMenuDirection } from './types';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Field from './Field';
|
import _Field, { FieldProps } from './Field';
|
||||||
|
|
||||||
export const Field = withInstall(_Field);
|
export const Field = withInstall(_Field);
|
||||||
export default Field;
|
export default Field;
|
||||||
|
export type { FieldProps };
|
||||||
export type {
|
export type {
|
||||||
FieldType,
|
FieldType,
|
||||||
FieldRule,
|
FieldRule,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Form from './Form';
|
import _Form, { FormProps } from './Form';
|
||||||
|
|
||||||
export const Form = withInstall(_Form);
|
export const Form = withInstall(_Form);
|
||||||
export default Form;
|
export default Form;
|
||||||
|
export type { FormProps };
|
||||||
export type { FormInstance } from './types';
|
export type { FormInstance } from './types';
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { ImagePreview } from './function-call';
|
import { ImagePreview } from './function-call';
|
||||||
|
import type { ImagePreviewProps } from './ImagePreview';
|
||||||
|
|
||||||
export default ImagePreview;
|
export default ImagePreview;
|
||||||
export { ImagePreview };
|
export { ImagePreview };
|
||||||
|
export type { ImagePreviewProps };
|
||||||
export type {
|
export type {
|
||||||
ImagePreviewOptions,
|
ImagePreviewOptions,
|
||||||
ImagePreviewInstance,
|
ImagePreviewInstance,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _IndexBar from './IndexBar';
|
import _IndexBar, { IndexBarProps } from './IndexBar';
|
||||||
|
|
||||||
export const IndexBar = withInstall(_IndexBar);
|
export const IndexBar = withInstall(_IndexBar);
|
||||||
export default IndexBar;
|
export default IndexBar;
|
||||||
|
export type { IndexBarProps };
|
||||||
export type { IndexBarInstance } from './types';
|
export type { IndexBarInstance } from './types';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _List from './List';
|
import _List, { ListProps } from './List';
|
||||||
|
|
||||||
export const List = withInstall(_List);
|
export const List = withInstall(_List);
|
||||||
export default List;
|
export default List;
|
||||||
|
export type { ListProps };
|
||||||
export type { ListInstance, ListDirection } from './types';
|
export type { ListInstance, ListDirection } from './types';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _NoticeBar from './NoticeBar';
|
import _NoticeBar, { NoticeBarProps } from './NoticeBar';
|
||||||
|
|
||||||
export const NoticeBar = withInstall(_NoticeBar);
|
export const NoticeBar = withInstall(_NoticeBar);
|
||||||
export default NoticeBar;
|
export default NoticeBar;
|
||||||
|
export type { NoticeBarProps };
|
||||||
export type { NoticeBarMode, NoticeBarInstance } from './types';
|
export type { NoticeBarMode, NoticeBarInstance } from './types';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Picker from './Picker';
|
import _Picker, { PickerProps } from './Picker';
|
||||||
|
|
||||||
export const Picker = withInstall(_Picker);
|
export const Picker = withInstall(_Picker);
|
||||||
export default Picker;
|
export default Picker;
|
||||||
|
export type { PickerProps };
|
||||||
export type {
|
export type {
|
||||||
PickerColumn,
|
PickerColumn,
|
||||||
PickerOption,
|
PickerOption,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Progress from './Progress';
|
import _Progress, { ProgressProps } from './Progress';
|
||||||
|
|
||||||
export const Progress = withInstall(_Progress);
|
export const Progress = withInstall(_Progress);
|
||||||
export default Progress;
|
export default Progress;
|
||||||
|
export type { ProgressProps };
|
||||||
export type { ProgressInstance } from './types';
|
export type { ProgressInstance } from './types';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Search from './Search';
|
import _Search, { SearchProps } from './Search';
|
||||||
|
|
||||||
export const Search = withInstall(_Search);
|
export const Search = withInstall(_Search);
|
||||||
export default Search;
|
export default Search;
|
||||||
|
export type { SearchProps };
|
||||||
export type { SearchShape, SearchInstance } from './types';
|
export type { SearchShape, SearchInstance } from './types';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _SwipeCell from './SwipeCell';
|
import _SwipeCell, { SwipeCellProps } from './SwipeCell';
|
||||||
|
|
||||||
export const SwipeCell = withInstall(_SwipeCell);
|
export const SwipeCell = withInstall(_SwipeCell);
|
||||||
export default SwipeCell;
|
export default SwipeCell;
|
||||||
|
export type { SwipeCellProps };
|
||||||
export type {
|
export type {
|
||||||
SwipeCellSide,
|
SwipeCellSide,
|
||||||
SwipeCellPosition,
|
SwipeCellPosition,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Swipe from './Swipe';
|
import _Swipe, { SwipeProps } from './Swipe';
|
||||||
|
|
||||||
export const Swipe = withInstall(_Swipe);
|
export const Swipe = withInstall(_Swipe);
|
||||||
export default Swipe;
|
export default Swipe;
|
||||||
|
export type { SwipeProps };
|
||||||
export type { SwipeInstance, SwipeToOptions } from './types';
|
export type { SwipeInstance, SwipeToOptions } from './types';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Tabs from './Tabs';
|
import _Tabs, { TabsProps } from './Tabs';
|
||||||
|
|
||||||
export const Tabs = withInstall(_Tabs);
|
export const Tabs = withInstall(_Tabs);
|
||||||
export default Tabs;
|
export default Tabs;
|
||||||
|
export type { TabsProps };
|
||||||
export type { TabsType, TabsInstance } from './types';
|
export type { TabsType, TabsInstance } from './types';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Uploader from './Uploader';
|
import _Uploader, { UploaderProps } from './Uploader';
|
||||||
|
|
||||||
export const Uploader = withInstall(_Uploader);
|
export const Uploader = withInstall(_Uploader);
|
||||||
export default Uploader;
|
export default Uploader;
|
||||||
|
export type { UploaderProps };
|
||||||
export type {
|
export type {
|
||||||
UploaderInstance,
|
UploaderInstance,
|
||||||
UploaderResultType,
|
UploaderResultType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user