mirror of
https://github.com/iconify/iconify.git
synced 2024-12-12 21:57:50 +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
|
||||
*/
|
||||
export function listAPIProviders(): string[] {
|
||||
return Object.keys(configStorage);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import type {
|
||||
IconifyAPIConfig,
|
||||
PartialIconifyAPIConfig,
|
||||
} from './config';
|
||||
import { getAPIConfig, setAPIConfig } from './config';
|
||||
import { getAPIConfig, setAPIConfig, listAPIProviders } from './config';
|
||||
import type {
|
||||
IconifyAPIModule,
|
||||
IconifyAPIQueryParams,
|
||||
@ -83,6 +83,11 @@ export interface IconifyAPIInternalFunctions {
|
||||
setFetch?: (item: typeof fetch) => void;
|
||||
getFetch?: () => typeof fetch | null;
|
||||
|
||||
/**
|
||||
* List all API providers (from config)
|
||||
*/
|
||||
listAPIProviders: () => string[];
|
||||
|
||||
/**
|
||||
* Merge parameters
|
||||
*/
|
||||
@ -93,6 +98,7 @@ export const APIInternalFunctions: IconifyAPIInternalFunctions = {
|
||||
getAPIConfig,
|
||||
setAPIModule,
|
||||
sendAPIQuery,
|
||||
listAPIProviders,
|
||||
mergeParams,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user