Skip to content

Commit

Permalink
feat: Improved type definition for Accordion.d.ts (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
guptaamol authored and iRoachie committed Oct 30, 2018
1 parent 567434e commit c6ac0d5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Accordion.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@ import * as React from 'react';
import { StyleProp, ViewStyle } from 'react-native';
import { EasingMode } from './index';

export interface AccordionProps {
export interface AccordionProps<T> {
/**
* An array of sections passed to the render methods
*/
sections: any[];
sections: T[];

/**
* A function that should return a renderable representing the header
*/
renderHeader(
content: any,
content: T,
index: number,
isActive: boolean,
sections: any[]
sections: T[]
): React.ReactElement<{}>;

/**
* A function that should return a renderable representing the section title above the touchable
*/
renderSectionTitle?(
content: any,
content: T,
index: number,
isActive: boolean,
sections: any[]
sections: T[]
): React.ReactElement<{}>;

/**
* A function that should return a renderable representing the content
*/
renderContent(
content: any,
content: T,
index: number,
isActive: boolean,
sections: any[]
sections: T[]
): React.ReactElement<{}>;

/**
Expand Down Expand Up @@ -108,4 +108,4 @@ export interface AccordionProps {
sectionContainerStyle?: StyleProp<ViewStyle>;
}

export default class Accordion extends React.Component<AccordionProps> {}
export default class Accordion<T> extends React.Component<AccordionProps<T>> {}

0 comments on commit c6ac0d5

Please sign in to comment.