advanced-games-library
Version:
Advanced Gaming Library for React Native - Four Complete Games with iOS Compatibility Fixes
72 lines (61 loc) • 1.95 kB
TypeScript
// Global type declarations to resolve React/React Native conflicts
declare module 'react-native' {
import * as React from 'react';
export interface ViewProps {
children?: React.ReactNode;
[key: string]: any;
}
export interface TextProps {
children?: React.ReactNode;
[key: string]: any;
}
export interface TouchableOpacityProps {
children?: React.ReactNode;
[key: string]: any;
}
export interface TextInputProps {
[key: string]: any;
}
export interface FlatListProps<T> {
data: T[];
renderItem: (info: { item: T; index: number }) => React.ReactElement;
keyExtractor?: (item: T, index: number) => string;
[key: string]: any;
}
export interface SwitchProps {
[key: string]: any;
}
export interface ActivityIndicatorProps {
[key: string]: any;
}
export interface AlertStatic {
alert(title: string, message?: string, buttons?: any[]): void;
}
export interface DimensionsStatic {
get(dim: string): { width: number; height: number };
}
export const View: React.ComponentType<ViewProps>;
export const Text: React.ComponentType<TextProps>;
export const TouchableOpacity: React.ComponentType<TouchableOpacityProps>;
export const TextInput: React.ComponentType<TextInputProps>;
export const FlatList: React.ComponentType<FlatListProps<any>>;
export const Switch: React.ComponentType<SwitchProps>;
export const ActivityIndicator: React.ComponentType<ActivityIndicatorProps>;
export const Alert: AlertStatic;
export const Dimensions: DimensionsStatic;
export const StyleSheet: {
create<T>(styles: T): T;
};
}
declare module 'react' {
export type ReactNode =
| string
| number
| boolean
| null
| undefined
| React.ReactElement
| React.ReactFragment
| React.ReactPortal
| Iterable<React.ReactNode>;
}