Skip to content

Commit

Permalink
fix(types): 修复 types 定义
Browse files Browse the repository at this point in the history
  • Loading branch information
focus committed Jan 9, 2019
1 parent 3c90722 commit fefc0fc
Show file tree
Hide file tree
Showing 38 changed files with 243 additions and 253 deletions.
4 changes: 2 additions & 2 deletions @types/accordion.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent, { AtIconBaseProps } from './base'

Expand All @@ -10,7 +10,7 @@ export interface AtAccordionProps extends AtComponent {

icon?: AtIconBaseProps

onClick?: (event: BaseEventFunction) => void
onClick?: CommonEventFunction
}

declare const AtAccordion: ComponentClass<AtAccordionProps>
Expand Down
4 changes: 2 additions & 2 deletions @types/action-sheet-item.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

export interface AtActionSheetItemProps extends AtComponent {

onClick?: (event: BaseEventFunction) => void
onClick?: CommonEventFunction

}

Expand Down
6 changes: 3 additions & 3 deletions @types/action-sheet.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -10,9 +10,9 @@ export interface AtActionSheetProps extends AtComponent {

cancelText?: string

onClose?: (event: BaseEventFunction) => void
onClose?: CommonEventFunction

onCancel?: (event: BaseEventFunction) => void
onCancel?: CommonEventFunction
}

declare const AtActionSheet: ComponentClass<AtActionSheetProps>
Expand Down
1 change: 0 additions & 1 deletion @types/activity-indicator.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand Down
1 change: 0 additions & 1 deletion @types/avatar.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand Down
14 changes: 7 additions & 7 deletions @types/button.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -20,7 +20,7 @@ export interface AtButtonProps extends AtComponent{

customStyle?: object | string

onClick?: (event: BaseEventFunction) => void
onClick?: CommonEventFunction

// start Button props
formType?: 'submit' | 'reset'
Expand All @@ -32,11 +32,11 @@ export interface AtButtonProps extends AtComponent{
sendMessageImg?: string,
showMessageCard?: boolean,
appParameter?: string,
onGetUserInfo?: (event: BaseEventFunction) => void,
onContact?: (event: BaseEventFunction) => void,
onGetPhoneNumber?: (event: BaseEventFunction) => void,
onError?: (event: BaseEventFunction) => void,
onOpenSetting?: (event: BaseEventFunction) => void,
onGetUserInfo?: CommonEventFunction
onContact?: CommonEventFunction
onGetPhoneNumber?: CommonEventFunction
onError?: CommonEventFunction
onOpenSetting?: CommonEventFunction
// end Button props
}

Expand Down
4 changes: 2 additions & 2 deletions @types/card.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -14,7 +14,7 @@ export interface AtCardProps extends AtComponent{

extra?: string

onClick?: BaseEventFunction
onClick?: CommonEventFunction
}

declare const AtCard: ComponentClass<AtCardProps>
Expand Down
4 changes: 2 additions & 2 deletions @types/curtain.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -8,7 +8,7 @@ export interface AtCurtainProps extends AtComponent {

closeBtnPosition?: string

onClose: (event: BaseEventFunction) => void
onClose: CommonEventFunction
}

declare const AtCurtain: ComponentClass<AtCurtainProps>
Expand Down
1 change: 0 additions & 1 deletion @types/drawer.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand Down
10 changes: 5 additions & 5 deletions @types/float-layout.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-restricted-globals */
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -23,13 +23,13 @@ export interface AtFloatLayoutProps extends AtComponent {

scrollWithAnimation?: boolean

onClose?: BaseEventFunction
onClose?: CommonEventFunction

onScroll?: BaseEventFunction
onScroll?: CommonEventFunction

onScrollToUpper?: BaseEventFunction
onScrollToUpper?: CommonEventFunction

onScrollToLower?: BaseEventFunction
onScrollToLower?: CommonEventFunction
}

declare const AtFloatLayout: ComponentClass<AtFloatLayoutProps>
Expand Down
4 changes: 2 additions & 2 deletions @types/form.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEvent } from '@tarojs/components/types/common'
import { CommonEvent } from '@tarojs/components/types/common'

declare type FormFunction = (event: BaseEvent) => void
declare type FormFunction = (event: CommonEvent) => void

import AtComponent from './base'

Expand Down
4 changes: 2 additions & 2 deletions @types/grid.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEvent } from '@tarojs/components/types/common'
import { CommonEvent } from '@tarojs/components/types/common'

import AtComponent, { AtIconBaseProps } from './base'

Expand All @@ -20,7 +20,7 @@ export interface AtGridProps extends AtComponent {

mode?: 'square' | 'rect'

onClick?: (item: Item, index: number, event: BaseEvent) => void
onClick?: (item: Item, index: number, event: CommonEvent) => void
}

declare const AtGrid: ComponentClass<AtGridProps>
Expand Down
4 changes: 2 additions & 2 deletions @types/icon.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent, { AtIconBaseProps } from './base'

export interface AtIconProps extends AtComponent, AtIconBaseProps {
onClick?: (event: BaseEventFunction) => void
onClick?: CommonEventFunction
}

declare const AtIcon: ComponentClass<AtIconProps>
Expand Down
4 changes: 2 additions & 2 deletions @types/input-number.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -24,7 +24,7 @@ export interface AtInputNumberProps extends AtComponent{

onChange: (value: number) => void

onBlur: BaseEventFunction
onBlur: CommonEventFunction
}

declare const AtInputNumber: ComponentClass<AtInputNumberProps>
Expand Down
6 changes: 3 additions & 3 deletions @types/input.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction, BaseEvent } from '@tarojs/components/types/common'
import { CommonEventFunction, CommonEvent } from '@tarojs/components/types/common'

declare type InputProp = string | number
declare type InputFunction = (value: string | number, event: BaseEvent) => void
declare type InputFunction = (value: string | number, event: CommonEvent) => void

import AtComponent from './base'

Expand Down Expand Up @@ -61,7 +61,7 @@ export interface AtInputProps extends AtComponent{

onClick?: InputFunction

onErrorClick?: BaseEventFunction
onErrorClick?: CommonEventFunction
}

declare const AtInput: ComponentClass<AtInputProps>
Expand Down
6 changes: 3 additions & 3 deletions @types/list.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent, { AtIconBaseProps } from './base'

Expand Down Expand Up @@ -32,9 +32,9 @@ export interface AtListItemProps extends AtComponent {

arrow?: 'up' | 'down' | 'right'

onClick?: BaseEventFunction
onClick?: CommonEventFunction

onSwitchChange?: BaseEventFunction
onSwitchChange?: CommonEventFunction
}

export const AtList: ComponentClass<AtListProps>
Expand Down
4 changes: 2 additions & 2 deletions @types/load-more.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -16,7 +16,7 @@ export interface AtLoadMoreProps extends AtComponent{

noMoreText?: string

onClick?: BaseEventFunction
onClick?: CommonEventFunction
}

declare const AtLoadMore: ComponentClass<AtLoadMoreProps>
Expand Down
1 change: 0 additions & 1 deletion @types/message.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand Down
8 changes: 4 additions & 4 deletions @types/modal.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from "react"
import { BaseEventFunction } from "@tarojs/components/types/common"
import { CommonEventFunction } from "@tarojs/components/types/common"

import AtComponent from "./base"

Expand All @@ -16,11 +16,11 @@ export interface AtModalProps extends AtComponent {

confirmText?: string

onClose?: BaseEventFunction
onClose?: CommonEventFunction

onCancel?: BaseEventFunction
onCancel?: CommonEventFunction

onConfirm?: BaseEventFunction
onConfirm?: CommonEventFunction
}

declare const AtModal: ComponentClass<AtModalProps>
Expand Down
8 changes: 4 additions & 4 deletions @types/nav-bar.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -20,11 +20,11 @@ export interface AtNavBarProps extends AtComponent{

rightSecondIconType?: string

onClickLeftIcon?: BaseEventFunction
onClickLeftIcon?: CommonEventFunction

onClickRgIconSt?: BaseEventFunction
onClickRgIconSt?: CommonEventFunction

onClickRgIconNd?: BaseEventFunction
onClickRgIconNd?: CommonEventFunction
}

declare const AtNavBar: ComponentClass<AtNavBarProps>
Expand Down
6 changes: 3 additions & 3 deletions @types/noticebar.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -22,9 +22,9 @@ export interface AtNoticeBarProps extends AtComponent{

customStyle?: object | string

onClose?: (event: BaseEventFunction) => void
onClose?: (event: CommonEventFunction) => void

onGotoMore?: (event: BaseEventFunction) => void
onGotoMore?: (event: CommonEventFunction) => void
}

declare const AtNoticeBar: ComponentClass<AtNoticeBarProps>
Expand Down
1 change: 0 additions & 1 deletion @types/pagination.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand Down
1 change: 0 additions & 1 deletion @types/progress.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand Down
4 changes: 2 additions & 2 deletions @types/radio.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction, BaseEvent } from '@tarojs/components/types/common'
import { CommonEvent } from "@tarojs/components/types/common";

import AtComponent from './base'

Expand All @@ -15,7 +15,7 @@ export interface AtRadioProps<T> {

options: Array<Option<T>>

onClick: (vaule: T, event: BaseEvent) => void
onClick: (vaule: T, event: CommonEvent) => void
}

declare const AtRadio: ComponentClass<AtRadioProps<any>>
Expand Down
4 changes: 2 additions & 2 deletions @types/rate.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseEvent, ComponentClass } from 'react'
import { BaseEventFunction, BaseEvent } from '@tarojs/components/types/common'
import { CommonEventFunction } from '@tarojs/components/types/common'

import AtComponent from './base'

Expand All @@ -12,7 +12,7 @@ export interface AtRateProps extends AtComponent{

margin?: number

onChange?: BaseEventFunction
onChange?: CommonEventFunction
}

declare const AtRate: ComponentClass<AtRateProps>
Expand Down
Loading

0 comments on commit fefc0fc

Please sign in to comment.