index.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { PathLike } from 'fs';
  2. import { IconifyInfo, IconifyJSON } from '@iconify/types';
  3. /**
  4. * This file is part of the iconify.design libraries.
  5. *
  6. * (c) Vjacheslav Trushkin <cyberalien@gmail.com>
  7. *
  8. * @license MIT
  9. *
  10. * For the full copyright and license information, please view the license.txt
  11. * file that is available in this file's directory.
  12. */
  13. /**
  14. * Collection info map
  15. */
  16. type IconifyMetaDataCollection = {
  17. [prefix: string]: IconifyInfo;
  18. };
  19. /**
  20. * Locate JSON file
  21. *
  22. * @param {string} name Collection name
  23. * @returns {string} Path to collection json file
  24. */
  25. declare const locate: (name: string) => PathLike;
  26. /**
  27. * Loads a collection.
  28. *
  29. * @param {PathLike} path The path to locate the `json` collection file.
  30. * @return {Promise<IconifyJSON>}
  31. */
  32. declare const loadCollection: (path: PathLike) => Promise<IconifyJSON>;
  33. /**
  34. * Get a collection.
  35. *
  36. * @param {string} name The name of the collection
  37. * @return {Promise<IconifyJSON>}
  38. */
  39. declare const lookupCollection: (name: string) => Promise<IconifyJSON>;
  40. /**
  41. * Get list of collections info.
  42. *
  43. * @return {Promise<IconifyMetaDataCollection>}
  44. */
  45. declare const lookupCollections: () => Promise<IconifyMetaDataCollection>;
  46. export { IconifyMetaDataCollection, loadCollection, locate, lookupCollection, lookupCollections };