react-native-gradient-shimmer
Version:
⚛ A pure JavaScript, performant, typed shimmer component for Android and iOS.
75 lines (74 loc) • 2.08 kB
TypeScript
import React from 'react';
import { StyleProp, ViewStyle } from 'react-native';
import { GradientShimmerPropsType } from './GradientShimmer';
declare type CommonLayoutType = {
/**
* Styles passed to the internal component
*/
style?: StyleProp<ViewStyle>;
/**
* Margin left applied to style
*/
marginLeft?: ViewStyle['marginLeft'];
/**
* Margin right applied to style
*/
marginRight?: ViewStyle['marginRight'];
/**
* Margin top applied to style
*/
marginTop?: ViewStyle['marginTop'];
/**
* Margin bottom applied to style
*/
marginBottom?: ViewStyle['marginBottom'];
};
export declare type ShimmerLayoutItemType = CommonLayoutType & {
/**
* Component `width` in DPI
*/
width: number;
/**
* Component `height` in DPI
*/
height: number;
};
export declare type ShimmerLayoutContainerType = CommonLayoutType & {
/**
* FlexBox flexDirection
*/
flexDirection?: ViewStyle['flexDirection'];
/**
* FlexBox alignItems
*/
alignItems?: ViewStyle['alignItems'];
/**
* FlexBox justifyContent
*/
justifyContent?: ViewStyle['justifyContent'];
/**
* Set the gaps (gutters) between rows and columns
*/
gap?: ViewStyle['gap'];
/**
* Set the size of the gap (gutter) between an element's rows
*/
rowGap?: ViewStyle['rowGap'];
/**
* Set the size of the gap (gutter) between an element's columns.
*/
columnGap?: ViewStyle['columnGap'];
/**
* Children content layout
*/
content: Array<ShimmerLayoutItemType | ShimmerLayoutContainerType>;
};
export declare type ShimmerLayoutPropsType = Omit<GradientShimmerPropsType, 'width' | 'height' | 'style'> & {
/**
* Layout config tree
*/
layout: ShimmerLayoutContainerType;
defaultShimmerProps?: Omit<Partial<GradientShimmerPropsType>, 'LinearGradientComponent'>;
};
declare const _default: React.MemoExoticComponent<(props: ShimmerLayoutPropsType) => JSX.Element>;
export default _default;