From 8ce54f3812f4b047c01b9cf4b1e11ad21335953f Mon Sep 17 00:00:00 2001 From: duguyihou Date: Sat, 11 May 2024 07:51:44 +1000 Subject: [PATCH] chore(example): update (#172) --- example/src/components/Card.tsx | 34 +++++---------------------------- src/index.tsx | 9 ++++++++- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/example/src/components/Card.tsx b/example/src/components/Card.tsx index 2aee951..c411053 100644 --- a/example/src/components/Card.tsx +++ b/example/src/components/Card.tsx @@ -1,41 +1,17 @@ -import { - StyleSheet, - Text, - View, - type ColorValue, - type NativeSyntheticEvent, -} from 'react-native'; +import { StyleSheet, Text, View } from 'react-native'; import React from 'react'; -import TurboImage, { - type CachePolicy, - type Failure, - type Success, - type Start, -} from 'react-native-turbo-image'; +import TurboImage, { type TurboImageProps } from 'react-native-turbo-image'; -type Props = { +interface Props extends Omit { size: number[]; title?: string; - src: string; - cachePolicy?: CachePolicy; - priority?: number; - rounded?: boolean; - monochrome?: number | ColorValue; - borderRadius?: number; - blur?: number; - blurhash?: string; - resize?: number[]; - showActivityIndicator?: boolean; - onStart?: (result: NativeSyntheticEvent) => void; - onSuccess?: (result: NativeSyntheticEvent) => void; - onFailure?: (result: NativeSyntheticEvent) => void; -}; +} const Card = ({ title, size, ...props }: Props) => { return ( {title && {title}} diff --git a/src/index.tsx b/src/index.tsx index b17dd9c..bf3af20 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,3 +1,10 @@ import TurboImage from './TurboImage'; -export type { CachePolicy, Start, Success, Failure, ResizeMode } from './types'; +export type { + CachePolicy, + Start, + Success, + Failure, + ResizeMode, + TurboImageProps, +} from './types'; export default TurboImage;