mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-15 12:09:40 +08:00
Updated to Onsen UI 2.8. Fixed typos. Added missing component PullHook. Added missing attributes to existing components. (#22791)
This commit is contained in:
36
types/react-onsenui/index.d.ts
vendored
36
types/react-onsenui/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for React OnSenui (react-onsenui) 2.7
|
||||
// Type definitions for React Onsen UI (react-onsenui) 2.8
|
||||
// Project: https://onsen.io/v2/docs/guide/react/
|
||||
// Definitions by: Ozytis <https://ozytis.fr>
|
||||
// Definitions by: Ozytis <https://ozytis.fr>, Salim <https://github.com/salim7>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -23,6 +23,10 @@ export interface AnimationOptions {
|
||||
timing?: string;
|
||||
}
|
||||
|
||||
export interface PullHookChangeEvent {
|
||||
state: "initial" | "preaction" | "action";
|
||||
}
|
||||
|
||||
/*** splitter ***/
|
||||
export class SplitterSide extends Component<{
|
||||
side?: "left" | "right",
|
||||
@@ -33,13 +37,14 @@ export class SplitterSide extends Component<{
|
||||
onPreClose?(e?: Event): void,
|
||||
onModeChange?(e?: Event): void,
|
||||
onClose?(e?: Event): void,
|
||||
isSwipeable?: boolean,
|
||||
swipeable?: boolean,
|
||||
swipeTargetWidth?: number,
|
||||
width?: number,
|
||||
animation?: "overlay" | "default"
|
||||
animationOptions?: AnimationOptions,
|
||||
openThreshold?: number,
|
||||
mode?: "collapse" | "split"
|
||||
mode?: "collapse" | "split",
|
||||
className?: string
|
||||
}, any> { }
|
||||
|
||||
export class SplitterContent extends Component { }
|
||||
@@ -89,11 +94,15 @@ export class Page extends Component<{
|
||||
/*** Grid ***/
|
||||
export class Col extends Component<{
|
||||
verticalAlign?: "top" | "bottom" | "center",
|
||||
width?: string
|
||||
width?: string,
|
||||
className?: string,
|
||||
style?: React.CSSProperties,
|
||||
}, any> {}
|
||||
|
||||
export class Row extends Component<{
|
||||
verticalAlign?: "top" | "bottom" | "center",
|
||||
className?: string,
|
||||
style?: React.CSSProperties,
|
||||
}, any> {}
|
||||
|
||||
/*** Navigation ***/
|
||||
@@ -234,7 +243,7 @@ export class ProgressCircular extends Component<{
|
||||
modifier?: string,
|
||||
value?: number,
|
||||
secondaryValue?: boolean,
|
||||
intermediate?: boolean,
|
||||
indeterminate?: boolean,
|
||||
}, any> {}
|
||||
|
||||
export class Ripple extends Component<{
|
||||
@@ -358,4 +367,17 @@ export class ListItem extends Component<{
|
||||
onClick?: React.MouseEventHandler<any>,
|
||||
}, any> {}
|
||||
|
||||
export class Card extends Component { }
|
||||
export class Card extends Component<{
|
||||
modifier?: string,
|
||||
}, any> {}
|
||||
|
||||
/** Pull-to-refresh hook. */
|
||||
export class PullHook extends Component<{
|
||||
onChange?(e: PullHookChangeEvent): void,
|
||||
onLoad?(done: () => void): void,
|
||||
onPull?(): void,
|
||||
disabled?: boolean,
|
||||
height?: number,
|
||||
thresholdHeight?: number,
|
||||
fixedContent?: boolean,
|
||||
}, any> {}
|
||||
|
||||
@@ -28,14 +28,15 @@ export class App extends React.Component<AppProps, AppState> {
|
||||
return (
|
||||
<Splitter>
|
||||
<SplitterSide
|
||||
className='left'
|
||||
side='left'
|
||||
collapse={true}
|
||||
isOpen={this.state.isOpen}
|
||||
onClose={() => this.hide()}
|
||||
isSwipeable={true}>
|
||||
swipeable>
|
||||
<Page>
|
||||
Menu content
|
||||
</Page>
|
||||
</Page>
|
||||
</SplitterSide>
|
||||
<SplitterContent>
|
||||
<Page>
|
||||
|
||||
Reference in New Issue
Block a user