2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-19 16:59:02 +00:00

Move calculateSize function to internals in SVG framework

This commit is contained in:
Vjacheslav Trushkin 2020-06-06 10:13:56 +03:00
parent ce5fade7ae
commit 375863d9bb

View File

@ -103,6 +103,15 @@ export type IconifyCacheType = 'local' | 'session' | 'all';
* Important: any changes published in a release must be backwards compatible.
*/
export interface IconifyExposedInternals {
/**
* Calculate width knowing height and width/height ratio (or vice versa)
*/
calculateSize: (
size: IconifyIconSize,
ratio: number,
precision?: number
) => IconifyIconSize;
/**
* Get internal API data, used by Icon Finder
*/
@ -167,15 +176,6 @@ export interface IconifyGlobal {
*/
replaceIDs: (body: string) => string;
/**
* Calculate width knowing height and width/height ratio (or vice versa)
*/
calculateSize: (
size: IconifyIconSize,
ratio: number,
precision?: number
) => IconifyIconSize;
/* Add icons */
/**
* Add icon to storage
@ -396,9 +396,6 @@ const Iconify: IconifyGlobal = {
// Replace IDs in body
replaceIDs: replaceIDs,
// Calculate size
calculateSize: calcSize,
// Add icon
addIcon: (name, data) => {
const icon = getIconName(name);
@ -453,6 +450,9 @@ const Iconify: IconifyGlobal = {
// Exposed internal functions
_internal: {
// Calculate size
calculateSize: calcSize,
// Get API data
getAPI: getRedundancyCache,
},