2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-22 22:58:27 +00:00

Group up exposed internal functions in SVG framework

This commit is contained in:
Vjacheslav Trushkin 2020-06-04 16:45:29 +03:00
parent 4fc2a3727b
commit 6c461f3b92

View File

@ -64,7 +64,6 @@ import { renderIcon } from './render';
// Scan // Scan
import { scanDOM } from './scan'; import { scanDOM } from './scan';
import { Redundancy } from '@iconify/core/node_modules/@cyberalien/redundancy';
/** /**
* Export required types * Export required types
@ -96,6 +95,20 @@ export {
*/ */
export type IconifyCacheType = 'local' | 'session' | 'all'; export type IconifyCacheType = 'local' | 'session' | 'all';
/**
* Exposed internal functions
*
* Used by plug-ins, such as Icon Finder
*
* Important: any changes published in a release must be backwards compatible.
*/
export interface IconifyExposedInternals {
/**
* Get internal API data, used by Icon Finder
*/
getAPI: (provider: string) => IconifyAPIInternalStorage | undefined;
}
/** /**
* Iconify interface * Iconify interface
*/ */
@ -193,13 +206,6 @@ export interface IconifyGlobal {
customConfig: Partial<IconifyAPIConfig> customConfig: Partial<IconifyAPIConfig>
) => void; ) => void;
/**
* Get internal API data, used by Icon Finder
*/
_getInternalAPI: (
provider: string
) => IconifyAPIInternalStorage | undefined;
/* Scan DOM */ /* Scan DOM */
/** /**
* Scan DOM * Scan DOM
@ -215,6 +221,11 @@ export interface IconifyGlobal {
* Toggle local and session storage * Toggle local and session storage
*/ */
enableCache: (storage: IconifyCacheType, value: boolean) => void; enableCache: (storage: IconifyCacheType, value: boolean) => void;
/**
* Expose internal functions
*/
_internal: IconifyExposedInternals;
} }
/** /**
@ -410,9 +421,6 @@ const Iconify: IconifyGlobal = {
// API providers // API providers
addAPIProvider: setAPIConfig, addAPIProvider: setAPIConfig,
// Get API data
_getInternalAPI: getRedundancyCache,
// Scan DOM // Scan DOM
scanDOM: scanDOM, scanDOM: scanDOM,
@ -442,6 +450,12 @@ const Iconify: IconifyGlobal = {
break; break;
} }
}, },
// Exposed internal functions
_internal: {
// Get API data
getAPI: getRedundancyCache,
},
}; };
/** /**