Skip to content

Commit

Permalink
2.3.1 #184
Browse files Browse the repository at this point in the history
  • Loading branch information
iRoachie committed Jul 25, 2018
2 parents 7407729 + 6a29d54 commit bcfbeb1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
@@ -1,4 +1,5 @@
{
"semi": false,
"singleQuote": true
"singleQuote": true,
"trailingComma": "es5"
}
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-tableview",
"version": "2.3.0",
"version": "2.3.1",
"description": "Native iOS TableView wrapper for React Native",
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down
49 changes: 39 additions & 10 deletions src/index.d.ts
Expand Up @@ -4,9 +4,26 @@
// TypeScript Version: 2.6

import * as React from 'react'
import { ViewStyle, Insets, PointPropType, NativeSyntheticEvent, NativeScrollEvent } from 'react-native'

type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 'bold' | 'normal'
import {
ViewStyle,
Insets,
PointPropType,
NativeSyntheticEvent,
NativeScrollEvent,
} from 'react-native'

type FontWeight =
| 100
| 200
| 300
| 400
| 500
| 600
| 700
| 800
| 900
| 'bold'
| 'normal'

type FontStyle = 'italic' | 'normal' | 'oblique'

Expand Down Expand Up @@ -115,6 +132,13 @@ export enum SeparatorStyle {
Line,
}

export enum CellSelectionStyle {
None = 0,
Blue,
Gray,
Default,
}

interface SectionProps {
/**
* Show the DisclosureIndicator accessory type
Expand Down Expand Up @@ -182,7 +206,7 @@ interface ItemProps {
* If cell can be deleted in editing mode
*/
canEdit?: boolean

/**
* Cell selection style
*/
Expand Down Expand Up @@ -216,6 +240,7 @@ interface TableViewProps {
showsHorizontalScrollIndicator?: boolean
showsVerticalScrollIndicator?: boolean
moveWithinSectionOnly?: boolean
reactModuleForCell?: string
/**
* If the tableview can pull to refresh
*/
Expand Down Expand Up @@ -264,30 +289,34 @@ interface TableViewProps {
onRefresh?(): void
onAccessoryPress?(event: AccessoryCallBack): void
onWillDisplayCell?(event: DisplayCallBack): void
onEndDisplayingCell?(event: DisplayCallBack): void,
cellSeparatorInset: Insets,
onEndDisplayingCell?(event: DisplayCallBack): void
cellSeparatorInset: Insets
cellLayoutMargins: Insets
}

declare class TableView extends React.Component<TableViewProps> {
/**
* Scroll to coordinates
*
*
* @param x Horizontal pixels to scroll
* @param y Vertical pixels to scroll
* @param animated With animation or not
*/
scrollTo(x: number, y: number, animated: boolean): void;
scrollTo(x: number, y: number, animated: boolean): void

/**
* Scroll to an index
*
*
* @param params scroll params
* @param params.index index of the cell
* @param params.section index of the section @default 0
* @param params.animated scroll with animation @default true
*/
scrollToIndex(params: { index: number, section?: number, animated?: boolean }): void;
scrollToIndex(params: {
index: number
section?: number
animated?: boolean
}): void
}

declare namespace TableView {
Expand Down

0 comments on commit bcfbeb1

Please sign in to comment.