2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-08 15:54:09 +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. * Important: any changes published in a release must be backwards compatible.
*/ */
export interface IconifyExposedInternals { 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 * Get internal API data, used by Icon Finder
*/ */
@ -167,15 +176,6 @@ export interface IconifyGlobal {
*/ */
replaceIDs: (body: string) => string; 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 icons */
/** /**
* Add icon to storage * Add icon to storage
@ -396,9 +396,6 @@ const Iconify: IconifyGlobal = {
// Replace IDs in body // Replace IDs in body
replaceIDs: replaceIDs, replaceIDs: replaceIDs,
// Calculate size
calculateSize: calcSize,
// Add icon // Add icon
addIcon: (name, data) => { addIcon: (name, data) => {
const icon = getIconName(name); const icon = getIconName(name);
@ -453,6 +450,9 @@ const Iconify: IconifyGlobal = {
// Exposed internal functions // Exposed internal functions
_internal: { _internal: {
// Calculate size
calculateSize: calcSize,
// Get API data // Get API data
getAPI: getRedundancyCache, getAPI: getRedundancyCache,
}, },