🤖 Merge PR #47738 react-native-vector-icons: Create Icon.getImageSourceSync types by @mrousavy

This commit is contained in:
Marc Rousavy 2020-09-18 08:45:31 +02:00 committed by GitHub
parent 0807fca4d5
commit 4271605394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,7 @@ const CustomIconTabBarItem = CustomIcon.TabBarItem;
const CustomIconTabBarItemIOS = CustomIcon.TabBarItemIOS;
const CustomIconToolbarAndroid = CustomIcon.ToolbarAndroid;
const CustomIcongetImageSource = CustomIcon.getImageSource;
const CustomIcongetImageSourceSync = CustomIcon.getImageSourceSync;
class Example extends React.Component {
handleButton() {

View File

@ -38,6 +38,12 @@ export default class FontAwesome5Icon extends Component<
color?: string,
fa5Style?: ValueOf<typeof FA5Style>
): Promise<ImageSource>;
static getImageSourceSync(
name: string,
size?: number,
color?: string,
fa5Style?: ValueOf<typeof FA5Style>
): ImageSource;
static loadFont(file?: string): Promise<void>;
static hasIcon(name: string): boolean;
static ToolbarAndroid: typeof Icon.ToolbarAndroid;

View File

@ -154,6 +154,11 @@ export class Icon extends React.Component<IconProps, any> {
size?: number,
color?: string,
): Promise<ImageSource>;
static getImageSourceSync(
name: string,
size?: number,
color?: string,
): ImageSource;
static getRawGlyphMap(): { [name: string]: number };
static loadFont(
file?: string

View File

@ -20,6 +20,7 @@ const CustomIconTabBarItem = CustomIcon.TabBarItem;
const CustomIconTabBarItemIOS = CustomIcon.TabBarItemIOS;
const CustomIconToolbarAndroid = CustomIcon.ToolbarAndroid;
const CustomIcongetImageSource = CustomIcon.getImageSource;
const CustomIcongetImageSourceSync = CustomIcon.getImageSourceSync;
class Example extends React.Component {
handleButton() {