Iconify types

All Iconify libraries share common object structures. They are described as types in @iconify/types NPM package.

TypeScript

All types are described with TypeScript.

If you are not familiar with TypeScript, but are familiar with JavaScript, it should not be hard to understand this documentation because it is mostly just basic types.

Few things that you need to know to understand types:

object

Some Iconify code is written in PHP, yet refers to this documentation for description of types.

Object in JavaScript is the same as associative array in PHP. That is every entry has unique key and value.

Record

Type Record<string, number> is an object, where key is string, value is number.

For PHP developers it is an associative array.

unknown

Type unknown means value can be any type.

extends

interface Foo extends Bar, Baz {}

This means one type extends another type. In the example above, type Foo has all properties of types Bar and Baz.

Main types

There are two main types that are used in Iconify ecosystem:

Type IconifyIcon is used for representing one icon.

Type IconifyJSON is used for representing an entire icon set. It stores icons, aliases and various metadata.

Additional types

Type IconifyAlias is used for icon aliases.