mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
feat(react-native-elements): add utility exports
This commit is contained in:
+40
@@ -2206,3 +2206,43 @@ export interface TileProps {
|
||||
* @see https://react-native-training.github.io/react-native-elements/API/tile/
|
||||
*/
|
||||
export class Tile extends React.Component<TileProps, any> {}
|
||||
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
|
||||
export interface Colors {
|
||||
readonly primary: string;
|
||||
readonly primary1: string;
|
||||
readonly primary2: string;
|
||||
readonly secondary: string;
|
||||
readonly secondary2: string;
|
||||
readonly secondary3: string;
|
||||
readonly grey0: string;
|
||||
readonly grey1: string;
|
||||
readonly grey2: string;
|
||||
readonly grey3: string;
|
||||
readonly grey4: string;
|
||||
readonly grey5: string;
|
||||
readonly dkGreyBg: string;
|
||||
readonly greyOutline: string;
|
||||
readonly searchBg: string;
|
||||
readonly disabled: string;
|
||||
readonly white: string;
|
||||
readonly error: string;
|
||||
readonly [key: string]: string;
|
||||
}
|
||||
|
||||
export const colors: Colors;
|
||||
|
||||
/* Utility Functions */
|
||||
|
||||
/**
|
||||
* TODO make the Icon Type an export of the react-native-vector-icons type definitions.
|
||||
*/
|
||||
export function getIconType(type: IconType): any;
|
||||
|
||||
/**
|
||||
* Method to normalize size of fonts across devices
|
||||
*/
|
||||
export function normalize(size: number): number;
|
||||
|
||||
@@ -34,7 +34,10 @@ import {
|
||||
SwipeDeck,
|
||||
Tabs,
|
||||
Tab,
|
||||
Tile
|
||||
Tile,
|
||||
colors,
|
||||
getIconType,
|
||||
normalize
|
||||
} from 'react-native-elements';
|
||||
|
||||
const { width, height } = Dimensions.get('window');
|
||||
@@ -967,3 +970,7 @@ const TileTest: React.StatelessComponent = () => (
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
||||
const CustomIcon = getIconType('material');
|
||||
const fontSize = normalize(20);
|
||||
const white = colors.white;
|
||||
|
||||
Reference in New Issue
Block a user