diff --git a/types/address-edit.d.ts b/types/address-edit.d.ts deleted file mode 100644 index b4c20f668..000000000 --- a/types/address-edit.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class AddressEdit extends VanComponent { - setAddressDetail(val: string): void; -} diff --git a/types/area.d.ts b/types/area.d.ts deleted file mode 100644 index 61dfc4aac..000000000 --- a/types/area.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class Area extends VanComponent { - reset(code?: string): void; -} diff --git a/types/calendar.d.ts b/types/calendar.d.ts deleted file mode 100644 index f516e2f06..000000000 --- a/types/calendar.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { VanComponent } from './component'; - -export class Calendar extends VanComponent { - reset(date?: Date | Date[]): void; - - scrollToDate(date: Date): void; -} diff --git a/types/checkbox-group.d.ts b/types/checkbox-group.d.ts deleted file mode 100644 index a27cfe44b..000000000 --- a/types/checkbox-group.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { VanComponent } from './component'; - -export type ToggleAllOptions = { - checked?: boolean; - skipDisabled?: boolean; -}; - -export class CheckboxGroup extends VanComponent { - toggleAll(options?: boolean | ToggleAllOptions): void; -} diff --git a/types/checkbox.d.ts b/types/checkbox.d.ts deleted file mode 100644 index dc7c54b53..000000000 --- a/types/checkbox.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class Checkbox extends VanComponent { - toggle(checked?: boolean): void; -} diff --git a/types/collapse-item.d.ts b/types/collapse-item.d.ts deleted file mode 100644 index 092e80e72..000000000 --- a/types/collapse-item.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class CollapseItem extends VanComponent { - toggle(expanded?: boolean): void; -} diff --git a/types/component.d.ts b/types/component.d.ts deleted file mode 100644 index 73b0b2240..000000000 --- a/types/component.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { App } from 'vue'; - -export class VanComponent { - static name: string; - - static install: (app: App) => any; - - $props: Record; -} diff --git a/types/count-down.d.ts b/types/count-down.d.ts deleted file mode 100644 index 36a6b8e26..000000000 --- a/types/count-down.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { VanComponent } from './component'; - -export class CountDown extends VanComponent { - start(): void; - - pause(): void; - - reset(): void; -} diff --git a/types/datetime-picker.d.ts b/types/datetime-picker.d.ts deleted file mode 100644 index d56047aec..000000000 --- a/types/datetime-picker.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { VanComponent } from './component'; -import { Picker } from './picker'; - -export class DatetimePicker extends VanComponent { - getPicker(): Picker; -} diff --git a/types/dialog.d.ts b/types/dialog.d.ts deleted file mode 100644 index 7fcda2271..000000000 --- a/types/dialog.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { VanComponent } from './component'; -import { TeleportProps } from 'vue'; - -type DialogAction = 'confirm' | 'cancel'; -type DialogDone = (close?: boolean) => void; - -export type DialogOptions = { - title?: string; - width?: string | number; - message?: string; - theme?: string; - overlay?: boolean; - teleport?: TeleportProps['to']; - className?: any; - allowHtml?: boolean; - lockScroll?: boolean; - transition?: string; - messageAlign?: string; - overlayClass?: string; - overlayStyle?: Record; - closeOnPopstate?: boolean; - cancelButtonText?: string; - cancelButtonColor?: string; - confirmButtonText?: string; - confirmButtonColor?: string; - showConfirmButton?: boolean; - showCancelButton?: boolean; - closeOnClickOverlay?: boolean; - beforeClose?: (action: DialogAction, done: DialogDone) => void; -}; - -export interface Dialog { - (options: DialogOptions): Promise; - alert(options: DialogOptions): Promise; - confirm(options: DialogOptions): Promise; - close(): void; - install(): void; - setDefaultOptions(options: DialogOptions): void; - resetDefaultOptions(): void; - Component: typeof VanComponent; -} - -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $dialog: Dialog; - } -} - -export const Dialog: Dialog; diff --git a/types/dropdown-item.d.ts b/types/dropdown-item.d.ts deleted file mode 100644 index 84f21eea8..000000000 --- a/types/dropdown-item.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class DropdownItem extends VanComponent { - toggle(show?: boolean): void; -} diff --git a/types/field.d.ts b/types/field.d.ts deleted file mode 100644 index f648b944b..000000000 --- a/types/field.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { VanComponent } from './component'; - -export class Field extends VanComponent { - focus(): void; - - blur(): void; -} diff --git a/types/form.d.ts b/types/form.d.ts deleted file mode 100644 index 53f5417e0..000000000 --- a/types/form.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { VanComponent } from './component'; - -export class Form extends VanComponent { - submit(): void; - - validate(name?: string | string[]): Promise; - - resetValidation(name?: string | string[]): void; - - scrollToField(name: string, options?: boolean | ScrollIntoViewOptions): void; -} diff --git a/types/image-preview.d.ts b/types/image-preview.d.ts deleted file mode 100644 index e0a9ed734..000000000 --- a/types/image-preview.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { TeleportProps } from 'vue'; -import { VanComponent } from './component'; -import { SwipeToOptions } from './swipe'; - -export type ImagePreviewOptions = - | string[] - | { - loop?: boolean; - images: string[]; - maxZoom?: number; - minZoom?: number; - teleport?: TeleportProps['to']; - className?: any; - showIndex?: boolean; - closeable?: boolean; - closeIcon?: string; - beforeClose?: (active: number) => boolean | Promise; - swipeDuration?: number; - startPosition?: number; - showIndicators?: boolean; - closeOnPopstate?: boolean; - closeIconPosition?: string; - onClose?(): void; - onChange?(index: number): void; - swipeTo?(index: number, options?: SwipeToOptions): void; - }; - -export class VanImagePreview { - images: string[]; - - showIndex: boolean; - - startPosition: number; -} - -export interface ImagePreview { - (options: ImagePreviewOptions, startPosition?: number): VanImagePreview; - install(): void; - Component: typeof VanComponent; -} - -export const ImagePreview: ImagePreview; diff --git a/types/index-bar.d.ts b/types/index-bar.d.ts deleted file mode 100644 index b004c9ccb..000000000 --- a/types/index-bar.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class IndexBar extends VanComponent { - scrollTo(index: number | string): void; -} diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index 3aed6bd5e..000000000 --- a/types/index.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* eslint-disable max-classes-per-file */ -import { App } from 'vue'; -import { VanComponent } from './component'; -import { AddressEdit } from './address-edit'; -import { Area } from './area'; -import { Calendar } from './calendar'; -import { Checkbox } from './checkbox'; -import { CheckboxGroup } from './checkbox-group'; -import { CollapseItem } from './collapse-item'; -import { CountDown } from './count-down'; -import { DatetimePicker } from './datetime-picker'; -import { Dialog } from './dialog'; -import { DropdownItem } from './dropdown-item'; -import { Field } from './field'; -import { Form } from './form'; -import { ImagePreview } from './image-preview'; -import { IndexBar } from './index-bar'; -import { Lazyload } from './lazyload'; -import { List } from './list'; -import { Locale } from './locale'; -import { Notify } from './notify'; -import { Picker } from './picker'; -import { Progress } from './progress'; -import { Search } from './search'; -import { Sku } from './sku'; -import { Swipe } from './swipe'; -import { SwipeCell } from './swipe-cell'; -import { Tabs } from './tabs'; -import { Toast } from './toast'; -import { Uploader } from './uploader'; - -export const version: string; - -export const install: (app: App) => any; - -export class ActionSheet extends VanComponent {} -export class AddressList extends VanComponent {} -export class Badge extends VanComponent {} -export class Button extends VanComponent {} -export class Card extends VanComponent {} -export class Cascader extends VanComponent {} -export class Cell extends VanComponent {} -export class CellGroup extends VanComponent {} -export class Circle extends VanComponent {} -export class Col extends VanComponent {} -export class Collapse extends VanComponent {} -export class ContactCard extends VanComponent {} -export class ContactEdit extends VanComponent {} -export class ContactList extends VanComponent {} -export class CouponCell extends VanComponent {} -export class CouponList extends VanComponent {} -export class Divider extends VanComponent {} -export class DropdownMenu extends VanComponent {} -export class Empty extends VanComponent {} -export class Grid extends VanComponent {} -export class GridItem extends VanComponent {} -export class ActionBar extends VanComponent {} -export class ActionBarIcon extends VanComponent {} -export class ActionBarButton extends VanComponent {} -export class Icon extends VanComponent {} -export class Image extends VanComponent {} -export class IndexAnchor extends VanComponent {} -export class Info extends VanComponent {} -export class Loading extends VanComponent {} -export class NavBar extends VanComponent {} -export class NoticeBar extends VanComponent {} -export class NumberKeyboard extends VanComponent {} -export class Overlay extends VanComponent {} -export class Pagination extends VanComponent {} -export class Panel extends VanComponent {} -export class PasswordInput extends VanComponent {} -export class Popover extends VanComponent {} -export class Popup extends VanComponent {} -export class PullRefresh extends VanComponent {} -export class Radio extends VanComponent {} -export class RadioGroup extends VanComponent {} -export class Rate extends VanComponent {} -export class Row extends VanComponent {} -export class ShareSheet extends VanComponent {} -export class Sidebar extends VanComponent {} -export class SidebarItem extends VanComponent {} -export class Skeleton extends VanComponent {} -export class Slider extends VanComponent {} -export class Step extends VanComponent {} -export class Stepper extends VanComponent {} -export class Steps extends VanComponent {} -export class Sticky extends VanComponent {} -export class SubmitBar extends VanComponent {} -export class SwipeItem extends VanComponent {} -export class Switch extends VanComponent {} -export class SwitchCell extends VanComponent {} -export class Tab extends VanComponent {} -export class Tabbar extends VanComponent {} -export class TabbarItem extends VanComponent {} -export class Tag extends VanComponent {} -export class TreeSelect extends VanComponent {} - -export { - AddressEdit, - Area, - Calendar, - Checkbox, - CheckboxGroup, - CollapseItem, - CountDown, - DatetimePicker, - Dialog, - DropdownItem, - Form, - Field, - ImagePreview, - IndexBar, - Lazyload, - List, - Locale, - Notify, - Picker, - Progress, - Search, - Sku, - Swipe, - SwipeCell, - Tabs, - Toast, - Uploader, -}; diff --git a/types/lazyload.d.ts b/types/lazyload.d.ts deleted file mode 100644 index 0c1c528f1..000000000 --- a/types/lazyload.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Plugin } from 'vue'; - -export type Lazyload = Plugin; - -export const Lazyload: Lazyload; diff --git a/types/list.d.ts b/types/list.d.ts deleted file mode 100644 index 1b4023a4d..000000000 --- a/types/list.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class List extends VanComponent { - check(): void; -} diff --git a/types/locale.d.ts b/types/locale.d.ts deleted file mode 100644 index d32c4e51d..000000000 --- a/types/locale.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface Locale { - install(): void; - use(lang: string, messages: Object): void; - add(messages: Object): void; -} - -export const Locale: Locale; diff --git a/types/notify.d.ts b/types/notify.d.ts deleted file mode 100644 index 4ed23ce3b..000000000 --- a/types/notify.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { VanComponent } from './component'; - -export type NotifyMessage = string | number; - -export type NotifyOptions = { - type?: 'primary' | 'success' | 'danger' | 'warning'; - value?: boolean; - color?: string; - message?: NotifyMessage; - duration?: number; - className?: any; - background?: string; - onClose?: (() => void) | null; - onOpened?: (() => void) | null; - onClick?: ((event: Event) => void) | null; -}; - -export interface VanNotify { - message: NotifyMessage; - color: string; - background: string; - duration: number; -} - -export interface Notify { - (message: NotifyOptions | NotifyMessage): VanNotify; - clear(): void; - install(): void; - currentOptions: NotifyOptions; - defaultOptions: NotifyOptions; - setDefaultOptions(options: NotifyOptions): void; - resetDefaultOptions(): void; - Component: typeof VanComponent; -} - -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $notify: Notify; - } -} - -export const Notify: Notify; diff --git a/types/picker.d.ts b/types/picker.d.ts deleted file mode 100644 index a870a06b7..000000000 --- a/types/picker.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { VanComponent } from './component'; - -export class Picker extends VanComponent { - getValues(): T[]; - - setValues(values: T[]): void; - - getIndexes(): number[]; - - setIndexes(indexes: number[]): void; - - getColumnValue(columnIndex: number): T; - - setColumnValue(columnIndex: number, value: T): void; - - getColumnIndex(columnIndex: number): number; - - setColumnIndex(columnIndex: number, optionIndex: number): void; - - getColumnValues(columnIndex: number): T[]; - - setColumnValues(columnIndex: number, values: T[]): void; - - confirm(): void; -} diff --git a/types/progress.d.ts b/types/progress.d.ts deleted file mode 100644 index e54f734f9..000000000 --- a/types/progress.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VanComponent } from './component'; - -export class Progress extends VanComponent { - resize(): void; -} diff --git a/types/search.d.ts b/types/search.d.ts deleted file mode 100644 index 046abc760..000000000 --- a/types/search.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { VanComponent } from './component'; - -export class Search extends VanComponent { - focus(): void; - - blur(): void; -} diff --git a/types/sku.d.ts b/types/sku.d.ts deleted file mode 100644 index 9d8215ac6..000000000 --- a/types/sku.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { VanComponent } from './component'; - -export type SkuData = { - price: string; - none_sku: boolean; - stock_num: number; - hide_stock: boolean; - collection_id: number; - tree: SkuTreeItemData[]; - list: SkuListItemData[]; - messages: SkuMessageData[]; - properties: SkuPropItemData[]; -}; - -export type SkuTreeItemData = { - k: string; - v: SkuTreeItemValueData[]; - k_s: string; - is_multiple: never; -}; - -export type SkuTreeItemValueData = { - id: string; - name: string; - imgUrl?: string; - img_url?: string; - previewImgUrl?: string; -}; - -export type SkuPropItemData = { - k: string; - v: SkuPropItemValueData[]; - k_id: number; - is_multiple?: boolean; -}; - -export type SkuPropItemValueData = { - id: string; - name: string; - price?: number; -}; - -export type SkuListItemData = { - id: number; - s1: string; - s2: string; - s3: string; - price: number; - stock_num: number; -}; - -export type SkuMessageData = { - name: string; - type: string; - required?: string; - datetime?: string; - multiple?: string; - placeholder?: string; -}; - -export type SkuGoodsData = { - title: string; - picture: string; -}; - -export type SelectedSkuData = Record; - -export class Sku extends VanComponent { - getSkuData(): SkuData; - - resetSelectedSku(): void; -} diff --git a/types/swipe-cell.d.ts b/types/swipe-cell.d.ts deleted file mode 100644 index 14aee20b4..000000000 --- a/types/swipe-cell.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { VanComponent } from './component'; - -export class SwipeCell extends VanComponent { - open(position: 'left' | 'right'): void; - - close(): void; -} diff --git a/types/swipe.d.ts b/types/swipe.d.ts deleted file mode 100644 index 977890cc6..000000000 --- a/types/swipe.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { VanComponent } from './component'; - -export type SwipeToOptions = { - immediate?: boolean; -}; - -export class Swipe extends VanComponent { - prev(): void; - - next(): void; - - swipeTo(index: number, options?: SwipeToOptions): void; - - resize(): void; -} diff --git a/types/tabs.d.ts b/types/tabs.d.ts deleted file mode 100644 index 1b9d9becd..000000000 --- a/types/tabs.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { VanComponent } from './component'; - -export class Tabs extends VanComponent { - resize(): void; - - scrollTo(name: string | number): void; -} diff --git a/types/toast.d.ts b/types/toast.d.ts deleted file mode 100644 index 12ad6b3cf..000000000 --- a/types/toast.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { TeleportProps } from 'vue'; - -type ToastMessage = string | number; -type ToastType = 'text' | 'loading' | 'success' | 'fail' | 'html'; -type ToastPosition = 'top' | 'middle' | 'bottom'; -type ToastLoadingType = 'circular' | 'spinner'; - -export type ToastOptions = { - icon?: string; - type?: ToastType; - mask?: boolean; - message?: ToastMessage; - onClose?: () => void; - onOpened?: () => void; - overlay?: boolean; - duration?: number; - teleport?: TeleportProps['to']; - position?: ToastPosition; - className?: any; - transition?: string; - iconPrefix?: string; - loadingType?: ToastLoadingType; - forbidClick?: boolean; - closeOnClick?: boolean; - overlayClass?: any; - overlayStyle?: Record; - closeOnClickOverlay?: boolean; -}; - -export interface VanToast { - type: ToastType; - position: ToastPosition; - loadingType: ToastLoadingType; - forbidClick: boolean; - message: ToastMessage; - clear(): void; -} - -export interface Toast { - (message: ToastOptions | ToastMessage, options?: ToastOptions): VanToast; - loading(options?: ToastOptions | ToastMessage): VanToast; - success(options?: ToastOptions | ToastMessage): VanToast; - fail(options?: ToastOptions | ToastMessage): VanToast; - clear(all?: boolean): void; - install(): void; - setDefaultOptions( - type: ToastType | ToastOptions, - options?: ToastOptions - ): void; - resetDefaultOptions(options?: string): void; - allowMultiple(allow: boolean): void; -} - -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $toast: Toast; - } -} - -export const Toast: Toast; diff --git a/types/uploader.d.ts b/types/uploader.d.ts deleted file mode 100644 index e518ed97b..000000000 --- a/types/uploader.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { VanComponent } from './component'; - -export class Uploader extends VanComponent { - closeImagePreview(): void; - - chooseFile(): void; -}