mirror of
https://github.com/iconify/iconify.git
synced 2024-11-10 07:11:00 +00:00
Add function to list all API providers
This commit is contained in:
parent
00e71c20dd
commit
6c2eb2392c
@ -133,3 +133,6 @@ export function getAPIConfig(provider: string): IconifyAPIConfig | undefined {
|
|||||||
/**
|
/**
|
||||||
* List API providers
|
* List API providers
|
||||||
*/
|
*/
|
||||||
|
export function listAPIProviders(): string[] {
|
||||||
|
return Object.keys(configStorage);
|
||||||
|
}
|
||||||
|
@ -10,7 +10,7 @@ import type {
|
|||||||
IconifyAPIConfig,
|
IconifyAPIConfig,
|
||||||
PartialIconifyAPIConfig,
|
PartialIconifyAPIConfig,
|
||||||
} from './config';
|
} from './config';
|
||||||
import { getAPIConfig, setAPIConfig } from './config';
|
import { getAPIConfig, setAPIConfig, listAPIProviders } from './config';
|
||||||
import type {
|
import type {
|
||||||
IconifyAPIModule,
|
IconifyAPIModule,
|
||||||
IconifyAPIQueryParams,
|
IconifyAPIQueryParams,
|
||||||
@ -83,6 +83,11 @@ export interface IconifyAPIInternalFunctions {
|
|||||||
setFetch?: (item: typeof fetch) => void;
|
setFetch?: (item: typeof fetch) => void;
|
||||||
getFetch?: () => typeof fetch | null;
|
getFetch?: () => typeof fetch | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List all API providers (from config)
|
||||||
|
*/
|
||||||
|
listAPIProviders: () => string[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge parameters
|
* Merge parameters
|
||||||
*/
|
*/
|
||||||
@ -93,6 +98,7 @@ export const APIInternalFunctions: IconifyAPIInternalFunctions = {
|
|||||||
getAPIConfig,
|
getAPIConfig,
|
||||||
setAPIModule,
|
setAPIModule,
|
||||||
sendAPIQuery,
|
sendAPIQuery,
|
||||||
|
listAPIProviders,
|
||||||
mergeParams,
|
mergeParams,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user