diff --git a/lib/initIcon.js b/lib/initIcon.tsx similarity index 73% rename from lib/initIcon.js rename to lib/initIcon.tsx index fd74a08..ad49ea2 100644 --- a/lib/initIcon.js +++ b/lib/initIcon.tsx @@ -1,7 +1,8 @@ import React from "react"; import { Ionicons, AntDesign } from "@expo/vector-icons"; - -export const initIcon = (name, type) => { +type name = keyof typeof Ionicons.glyphMap & keyof typeof AntDesign.glyphMap; +type type = "Ionicons" | "AntDesign"; +export const initIcon = (name: name, type:type) => { switch (type) { case "Ionicons": return ({ focused, color, size }) => (