[Improvement] update type definition (#1294)

This commit is contained in:
neverland 2018-06-16 10:27:21 +08:00 committed by GitHub
parent 90609bf30e
commit b479c1daa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 0 deletions

View File

@ -1,4 +1,5 @@
## DatetimePicker ## DatetimePicker
The DatetimePicker component is usually used with [Popup](#/en-US/popup) Component.
### Install ### Install
``` javascript ``` javascript

View File

@ -1,4 +1,5 @@
## DatetimePicker 时间选择 ## DatetimePicker 时间选择
时间选择组件通常与 [弹出层](#/zh-CN/popup) 组件配合使用
### 使用指南 ### 使用指南
``` javascript ``` javascript

View File

@ -1,3 +1,4 @@
export class VanComponent { export class VanComponent {
static name: string; static name: string;
install(): void;
} }

3
types/dialog.d.ts vendored
View File

@ -16,6 +16,9 @@ export interface Dialog {
alert(options: DialogOptions): Promise<any>; alert(options: DialogOptions): Promise<any>;
confirm(options: DialogOptions): Promise<any>; confirm(options: DialogOptions): Promise<any>;
close(): void; close(): void;
install(): void;
setDefaultOptions(options: DialogOptions): void;
resetDefaultOptions(): void;
} }
declare module 'vue/types/vue' { declare module 'vue/types/vue' {

View File

@ -7,6 +7,7 @@ export class VanImagePreview extends VanPopupMixin {
export interface ImagePreview { export interface ImagePreview {
(images: string[], startPosition?: number): VanImagePreview; (images: string[], startPosition?: number): VanImagePreview;
install(): void;
} }
export const ImagePreview: ImagePreview; export const ImagePreview: ImagePreview;

5
types/index.d.ts vendored
View File

@ -2,6 +2,7 @@ import Vue from 'vue';
import { VanComponent } from './component'; import { VanComponent } from './component';
import { Toast } from './toast'; import { Toast } from './toast';
import { Dialog } from './dialog'; import { Dialog } from './dialog';
import { Locale } from './locale';
import { Lazyload } from './lazyload'; import { Lazyload } from './lazyload';
import { Waterfall } from './waterfall'; import { Waterfall } from './waterfall';
import { ImagePreview } from './image-preview'; import { ImagePreview } from './image-preview';
@ -21,6 +22,7 @@ export class CellGroup extends VanComponent {}
export class CellSwipe extends VanComponent {} export class CellSwipe extends VanComponent {}
export class Checkbox extends VanComponent {} export class Checkbox extends VanComponent {}
export class CheckboxGroup extends VanComponent {} export class CheckboxGroup extends VanComponent {}
export class Circle extends VanComponent {}
export class Col extends VanComponent {} export class Col extends VanComponent {}
export class Collapse extends VanComponent {} export class Collapse extends VanComponent {}
export class CollapseItem extends VanComponent {} export class CollapseItem extends VanComponent {}
@ -49,9 +51,11 @@ export class Progress extends VanComponent {}
export class PullRefresh extends VanComponent {} export class PullRefresh extends VanComponent {}
export class Radio extends VanComponent {} export class Radio extends VanComponent {}
export class RadioGroup extends VanComponent {} export class RadioGroup extends VanComponent {}
export class Rate extends VanComponent {}
export class Row extends VanComponent {} export class Row extends VanComponent {}
export class Search extends VanComponent {} export class Search extends VanComponent {}
export class Sku extends VanComponent {} export class Sku extends VanComponent {}
export class Slider extends VanComponent {}
export class Step extends VanComponent {} export class Step extends VanComponent {}
export class Stepper extends VanComponent {} export class Stepper extends VanComponent {}
export class Steps extends VanComponent {} export class Steps extends VanComponent {}
@ -70,6 +74,7 @@ export class Uploader extends VanComponent {}
export { export {
Toast, Toast,
Dialog, Dialog,
Locale,
Lazyload, Lazyload,
Waterfall, Waterfall,
ImagePreview ImagePreview

7
types/locale.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
export interface Locale {
install(): void;
use(lang: string, messages: Object): void;
add(messages: Object): void;
}
export const Locale: Locale;

4
types/toast.d.ts vendored
View File

@ -13,6 +13,10 @@ export interface Toast {
success(options?: ToastOptions): void; success(options?: ToastOptions): void;
fail(options?: ToastOptions): void; fail(options?: ToastOptions): void;
clear(): void; clear(): void;
install(): void;
setDefaultOptions(options: ToastOptions): void;
resetDefaultOptions(): void;
allowMultiple(allow: boolean): void
} }
declare module 'vue/types/vue' { declare module 'vue/types/vue' {