-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to support typescript? #50
Comments
my way:
|
This is the definition file I created in my project ( under declare type RNComponent<P = {}, S = {}, SS = any> = import('react').Component<P, S, SS>;
declare type RNConstructor<T> = import('react-native').Constructor<T>;
declare type RNViewProps = import('react-native').ViewProps;
declare type RNViewStyle = import('react-native').ViewStyle;
declare module 'react-native-shadow' {
interface BoxShadowType {
width: number,
height: number,
color: string,
border: number,
radius: number,
opacity: number,
x: number,
y: number,
style?: RNViewStyle,
}
interface BorderShadowType {
width: number,
color: string,
border: number,
opacity: number,
style?: RNViewStyle,
side: 'top' | 'bottom' | 'left' | 'right',
inset: boolean,
}
export const BoxShadow : RNConstructor<RNComponent<RNViewProps & {setting?: BoxShadowType}>>;
export const BorderShadow : RNConstructor<RNComponent<RNViewProps & {setting?: BorderShadowType}>>;
} |
very thank you |
Tnx, bro, saved me <3 |
My https://github.com/SrBrahma/react-native-shadow-2 have TS support :) |
i am try yarn add @types/react-native-shadow, but is not found !
The text was updated successfully, but these errors were encountered: