mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Added missing 'virtualized' and 'bindKeyboard' functions for react-swipeable-views-utils * Revert "Added missing 'virtualized' and 'bindKeyboard' functions for react-swipeable-views-utils" This reverts commit a04ff4db27a444480d78d34fe2434231fc6dc066. * Added missing 'virtualized' and 'bindKeyboard' functions for react-swipeable-views-utils-tests * Added children prop for `virtualize` * Fixed `Bind element 'number' has an 'any' type` error * Fixed `file should end with a newline` error
61 lines
2.1 KiB
TypeScript
61 lines
2.1 KiB
TypeScript
// Type definitions for react-swipeable-views-utils 0.13
|
|
// Project: https://github.com/oliviertassinari/react-swipeable-views#react-swipeable-views
|
|
// Definitions by: Sebastian Silbermann <https://github.com/eps1lon>
|
|
// Robert Nisipeanu <https://github.com/robertnisipeanu>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 3.0
|
|
|
|
import * as React from 'react';
|
|
import { ConsistentWith, Omit, PropInjector } from '@material-ui/types';
|
|
import { OnChangeIndexCallback, OnSwitchingCallback, OnTransitionEndCallback } from 'react-swipeable-views';
|
|
|
|
export interface WithAutoPlay {
|
|
index: number;
|
|
onChangeIndex: OnChangeIndexCallback;
|
|
onSwitching?: OnSwitchingCallback;
|
|
}
|
|
export interface WithAutoPlayProps {
|
|
autoplay?: boolean;
|
|
direction?: 'incremental' | 'decremental';
|
|
index: number;
|
|
interval?: number;
|
|
onChangeIndex: OnChangeIndexCallback;
|
|
slideCount?: number;
|
|
}
|
|
|
|
export interface WithVirtualize {
|
|
index: number;
|
|
onChangeIndex: OnChangeIndexCallback;
|
|
slideRenderer: (render: SlideRendererCallback) => React.ReactNode;
|
|
}
|
|
export interface WithVirtualizeProps {
|
|
index: number;
|
|
onChangeIndex: OnChangeIndexCallback;
|
|
onTransitionEnd?: OnTransitionEndCallback;
|
|
overscanSlideAfter?: number;
|
|
overscanSliedBefore?: number;
|
|
slideCount?: number;
|
|
children?: React.ReactNode;
|
|
slideRenderer: SlideRendererCallback;
|
|
}
|
|
export interface SlideRenderProps {
|
|
index: number;
|
|
key: number;
|
|
}
|
|
|
|
export interface WithBindKeyboard {
|
|
index: number;
|
|
onChangeIndex: OnChangeIndexCallback;
|
|
}
|
|
export interface WithBindKeyboardProps {
|
|
axis?: "x" | "x-reverse" | "y" | "y-reverse";
|
|
index: number;
|
|
onChangeIndex: OnChangeIndexCallback;
|
|
slidecount?: number;
|
|
}
|
|
|
|
export const autoPlay: PropInjector<WithAutoPlay, WithAutoPlayProps>;
|
|
export type SlideRendererCallback = (render: SlideRenderProps) => React.ReactNode;
|
|
export const virtualize: PropInjector<WithVirtualize, WithVirtualizeProps>;
|
|
export const bindKeyboard: PropInjector<WithBindKeyboard, WithBindKeyboardProps>;
|