Skip to content

Commit

Permalink
fix(types): expose the type for iconify collection names, closes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Sep 23, 2023
1 parent 7c43fc3 commit 9055588
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion gen-types.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const collections = req("@iconify/json/collections.json")

fs.writeFileSync(
"types.ts",
`export type CollectionNames = ${Object.keys(collections)
`/** All the available icon collections when you have \`@iconify/json\` installed */\nexport type CollectionNames = ${Object.keys(
collections,
)
.map((v) => JSON.stringify(v))
.join("|")}`,
)
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { IconifyJSON } from "@iconify/types"
import plugin from "tailwindcss/plugin.js"
import { parseIconSet } from "@iconify/utils"
import { generateIconComponent, getIconCollections } from "./core"
import { CollectionNames } from "../types"

export { getIconCollections }
export { getIconCollections, type CollectionNames }

export const iconsPlugin = ({
collections,
Expand Down

0 comments on commit 9055588

Please sign in to comment.