Package-level declarations

Types

Link copied to clipboard
external interface AnalyseSVGStructureOptions

Options for analyseSVGStructure.

Link copied to clipboard
external interface AnalyseSVGStructureResult
Link copied to clipboard
external interface APICacheOptions

API response cache options.

Link copied to clipboard
external interface APIQueryParams

API query parameters.

Link copied to clipboard
external interface CheckThemeResult

Result of checking which icons belong to each theme.

Link copied to clipboard
external interface CleanupSVGOptions

Options for SVG cleanup.

Link copied to clipboard
external interface CommonIconProps

Properties shared by icons and aliases.

Link copied to clipboard
external interface CompareDirectoriesOptions

Options for compareDirectories.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external interface DownloadSourceMixin

Download source type: "git", "github", "gitlab" or "npm".

Link copied to clipboard
external interface ExecResult

Result of running a shell command.

Link copied to clipboard
external interface ExportOptionsWithCustomFiles

Options to write custom files during export.

Link copied to clipboard
external interface ExportTargetOptions

Common options for exporting to a directory.

Link copied to clipboard
Link copied to clipboard
external interface FigmaIconNode

Icon node from a Figma document.

Link copied to clipboard
external interface FigmaImportOptions

Options for importFromFigma.

Link copied to clipboard
external interface FigmaImportResult

Result of importFromFigma.

Link copied to clipboard
external interface FindColorsResult
Link copied to clipboard
external interface GetNPMVersionResult

NPM version information.

Link copied to clipboard
external interface GitHubAPIOptions

GitHub API options.

Link copied to clipboard
external interface GitLabAPIOptions

GitLab API options.

Link copied to clipboard
external interface IconCategory

Icon category.

Link copied to clipboard
external class IconSet

Editable icon set.

Link copied to clipboard
external interface IconViewBox

SVG viewBox: left, top, width and height.

Link copied to clipboard
Link copied to clipboard
external interface NPMPackageOptions

NPM package options.

Link copied to clipboard
Link copied to clipboard
external interface ParseSVGCallbackItem

Item passed to the parseSVG callback.

Link copied to clipboard
external interface ResolvedIconifyIcon : IconifyIcon

Fully resolved icon.

Link copied to clipboard
external class SVG

SVG document used to manipulate icon content.

Link copied to clipboard
external interface SVGOptions

Options for runSVGO.

Properties

Link copied to clipboard
external val axiosConfig: dynamic

Extra options passed to every fetch call, such as proxy settings.

Link copied to clipboard
external val defaultQueueParams: dynamic

Default concurrency limit (limit: 5) and retry count (retries: 3) for runConcurrentQueries.

Link copied to clipboard
external val fetchCallbacks: dynamic

Logging callbacks called around API queries: onStart, onSuccess and onError. By default onStart logs the URL.

Functions

Link copied to clipboard
external fun addTagsToIconSet(iconSet: IconSet, customTags: Array<String>? = definedExternally): Array<String>

Add palette and size tags to an icon set.

Link copied to clipboard
external fun analyseSVGStructure(svg: SVG, options: AnalyseSVGStructureOptions? = definedExternally): AnalyseSVGStructureResult

Find IDs, links and palette usage in an SVG.

Link copied to clipboard
external fun blankIconSet(prefix: String): IconSet

Create a blank icon set with the given prefix.

Link copied to clipboard
external fun bumpVersion(version: String): String

Bump a version string, for example 1.2.3 to 1.2.4.

Link copied to clipboard
external fun checkBadTags(svg: SVG, options: CleanupSVGOptions? = definedExternally)

Check for tags that should not be in an icon. Throws on failure.

Link copied to clipboard
external fun cleanupGlobalStyle(svg: SVG)

Expand global styles, removing @font-face, @media and similar rules.

Link copied to clipboard
external fun cleanupIconKeyword(keyword: String, convertCamelCase: Boolean = definedExternally): String

Clean up an icon keyword.

Link copied to clipboard
external fun cleanupInlineStyle(svg: SVG)

Expand inline style attributes.

Link copied to clipboard
external fun cleanupRootStyle(svg: SVG): dynamic

Clean up the root <style>. Returns removed animations and at-rules.

Link copied to clipboard
external fun cleanupSVG(svg: SVG, options: CleanupSVGOptions? = definedExternally)

Clean up an SVG before parsing or optimising it.

Link copied to clipboard
external fun cleanupSVGRoot(svg: SVG)

Clean up the root <svg> element.

Link copied to clipboard
external fun compareDirectories(dir1: String, dir2: String, options: CompareDirectoriesOptions? = definedExternally): Promise<Boolean>

Compare directories, returning true when all files are identical.

Link copied to clipboard
external fun convertStyleToAttrs(svg: SVG)

Convert CSS rules to attributes using SVGO.

Link copied to clipboard
external fun convertSVGToMask(svg: SVG, options: dynamic = definedExternally): Boolean

Convert an SVG to a mask, fixing icons that use white where they should be transparent.

Link copied to clipboard
external fun deOptimisePaths(svg: SVG)

Expand compressed paths for software that does not support them.

Link copied to clipboard
external fun detectIconSetPalette(iconSet: IconSet): Boolean?

Detect whether an icon set is monotone (false), palette (true) or mixed (null).

Link copied to clipboard
external fun downloadFile(query: APIQueryParams, target: String): Promise<Unit>

Download a file to target. Throws when the response status is not 200.

Link copied to clipboard
external fun downloadGitHubRepo(options: DownloadGitHubRepoOptions): Promise<dynamic>

Download a GitHub repository using the API.

Link copied to clipboard
external fun downloadGitLabRepo(options: DownloadGitLabRepoOptions): Promise<dynamic>

Download a GitLab repository using the API.

Link copied to clipboard
external fun downloadGitRepo(options: DownloadGitRepoOptions): Promise<dynamic>

Clone or update a git repository.

Link copied to clipboard
external fun downloadNPMPackage(options: DownloadNPMPackageOptions): Promise<dynamic>

Download an npm package. Returns "not_modified" when ifModifiedSince matches.

Link copied to clipboard
external fun downloadPackage(options: dynamic): Promise<dynamic>

Download a package from git, GitHub, GitLab or npm, depending on downloadType.

Link copied to clipboard
external fun execAsync(cmd: String, options: dynamic = definedExternally): Promise<ExecResult>

Run a shell command. Resolves with { stdout, stderr } and rejects when the command fails. A relative cwd in options is resolved to an absolute path.

Link copied to clipboard

Export an icon set as an @iconify-icons/{prefix} style package.

Link copied to clipboard

Export an icon set as an @iconify-json/{prefix} style package.

Link copied to clipboard

Export an icon set as one SVG file per icon.

Link copied to clipboard

Get the latest commit SHA of a GitHub branch using the API.

Link copied to clipboard

Get the latest commit SHA of a GitLab branch using the API.

Link copied to clipboard
external fun getGitRepoBranch(options: ExportTargetOptions, checkout: String = definedExternally): Promise<String>

Get the current branch of a cloned repository, optionally checking out checkout first.

Link copied to clipboard

Get the current commit hash (git rev-parse HEAD) of a cloned repository.

Link copied to clipboard

Get the version of an npm package from the registry.

Link copied to clipboard
external fun getPackageVersion(target: String): Promise<String>

Get the version of a package from its package.json, where target is the package directory.

Link copied to clipboard
external fun importDirectory(path: String, options: ImportDirectoryOptions? = definedExternally): Promise<IconSet>

Import all SVG files from a directory.

Link copied to clipboard
external fun importDirectorySync(path: String, options: ImportDirectoryOptions? = definedExternally): IconSet

Synchronous version of importDirectory.

Link copied to clipboard
external fun importFromFigma(options: FigmaImportOptions): Promise<dynamic>

Import an icon set from Figma.

Link copied to clipboard
external fun isEmptyColor(color: Color): Boolean

Check if a color is empty, such as none or transparent.

Link copied to clipboard
external fun mergeIconSets(oldIcons: IconSet, newIcons: IconSet): IconSet

Merge two icon sets. Icons from newIcons take precedence.

Link copied to clipboard
external fun parseColors(svg: SVG, options: ParseColorsOptions? = definedExternally): FindColorsResult

Find and optionally replace colors in an SVG.

Link copied to clipboard
external fun parseSVG(svg: SVG, callback: (ParseSVGCallbackItem) -> Unit)

Find all elements in an SVG and invoke the callback for each element.

Link copied to clipboard
external fun parseSVGStyle(svg: SVG, callback: (dynamic) -> dynamic)

Parse CSS in an SVG. Return undefined from the callback to remove a rule.

Link copied to clipboard

Normalise and prepare an export directory.

Link copied to clipboard
external fun removeBadAttributes(svg: SVG)

Remove useless attributes from all elements.

Link copied to clipboard

Remove the clip path added by Figma and Penpot to icons with overflowing elements.

Link copied to clipboard
external fun resetGitRepoContents(target: String): Promise<Unit>

Reset the contents of a cloned repository, discarding local changes.

Link copied to clipboard
external fun resetSVGOrigin(svg: SVG)

Reset the SVG origin to 0 0.

Link copied to clipboard
external fun runConcurrentQueries(params: dynamic): Promise<dynamic>

Run asynchronous operations with concurrency and retry limits.

Link copied to clipboard
external fun runSVGO(svg: SVG, options: SVGOptions? = definedExternally)

Optimise an SVG with SVGO.

Link copied to clipboard
external fun scaleSVG(svg: SVG, scale: Double)

Scale an SVG by scale, resetting the origin first and optimising the result.

Link copied to clipboard
external fun scanDirectory(path: String, callback: (String, String, String, String, dynamic) -> dynamic? = definedExternally, subdirs: Boolean = definedExternally): Promise<Array<String>>

Find files in a directory. The callback can return a custom value per file.

Link copied to clipboard
external fun scanDirectorySync(path: String, callback: (String, String, String, String, dynamic) -> dynamic? = definedExternally, subdirs: Boolean = definedExternally): Array<String>

Synchronous version of scanDirectory.

Link copied to clipboard
external fun sendAPIQuery(query: APIQueryParams, cache: APICacheOptions? = definedExternally): Promise<dynamic>

Send an API query and return the response body as text.

Link copied to clipboard
external fun setFetch(fetchFunction: dynamic)

Replace the fetch implementation used for API queries and file downloads.

Link copied to clipboard
external fun sortThemeKeys(keys: Array<String>): Array<String>

Sort theme keys, longest first. Modifies and returns the list.

Link copied to clipboard
external fun untar(file: String, path: String): Promise<Unit>

Unpack a .tgz archive.

Link copied to clipboard
external fun unzip(source: String, path: String, filter: (String) -> Boolean? = definedExternally): Promise<Unit>

Unpack a .zip archive into path.

Link copied to clipboard
external fun validateColors(svg: SVG, expectMonotone: Boolean, options: ParseColorsOptions? = definedExternally): FindColorsResult

Validate colors in an SVG. Throws on error.

Link copied to clipboard
external fun writeJSONFile(filename: String, data: dynamic): Promise<Unit>

Write JSON to a file, using tab indentation and a trailing newline.