offline.d.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import type { AllowedComponentProps } from 'vue';
  2. import type { ComponentCustomProps } from 'vue';
  3. import type { ComponentOptionsMixin } from 'vue';
  4. import type { DefineComponent } from 'vue';
  5. import type { IconifyIcon } from '@iconify/types';
  6. import type { IconifyJSON } from '@iconify/types';
  7. import { IconifyTransformations } from '@iconify/types';
  8. import type { VNodeProps } from 'vue';
  9. /**
  10. * Add collection to storage, allowing to call icons by name
  11. *
  12. * @param data Icon set
  13. * @param prefix Optional prefix to add to icon names, true (default) if prefix from icon set should be used.
  14. */
  15. export declare function addCollection(data: IconifyJSON, prefix?: string | boolean): void;
  16. /**
  17. * Add icon to storage, allowing to call it by name
  18. *
  19. * @param name
  20. * @param data
  21. */
  22. export declare function addIcon(name: string, data: IconifyIcon): void;
  23. /**
  24. * Component
  25. */
  26. export declare const Icon: DefineComponent<IconProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<IconProps>, {}>;
  27. /**
  28. * Properties for element that are mentioned in render.ts
  29. */
  30. declare interface IconifyElementProps {
  31. id?: string;
  32. style?: unknown;
  33. onLoad?: IconifyIconOnLoad;
  34. }
  35. export { IconifyIcon }
  36. /**
  37. * Icon customisations
  38. */
  39. export declare type IconifyIconCustomisations = IconifyIconCustomisations_2 & {
  40. rotate?: string | number;
  41. inline?: boolean;
  42. };
  43. /**
  44. * Icon customisations
  45. */
  46. declare interface IconifyIconCustomisations_2 extends IconifyTransformations, IconifyIconSizeCustomisations {
  47. }
  48. /**
  49. * Callback for when icon has been loaded (only triggered for icons loaded from API)
  50. */
  51. declare type IconifyIconOnLoad = (name: string) => void;
  52. /**
  53. * Icon properties
  54. */
  55. export declare interface IconifyIconProps extends IconifyIconCustomisations {
  56. icon: IconifyIcon | string;
  57. mode?: IconifyRenderMode;
  58. color?: string;
  59. flip?: string;
  60. }
  61. /**
  62. * Icon size
  63. */
  64. export declare type IconifyIconSize = null | string | number;
  65. /**
  66. * Dimensions
  67. */
  68. declare interface IconifyIconSizeCustomisations {
  69. width?: IconifyIconSize;
  70. height?: IconifyIconSize;
  71. }
  72. export { IconifyJSON }
  73. /**
  74. * Icon render mode
  75. *
  76. * 'style' = 'bg' or 'mask', depending on icon content
  77. * 'bg' = <span> with style using `background`
  78. * 'mask' = <span> with style using `mask`
  79. * 'svg' = <svg>
  80. */
  81. export declare type IconifyRenderMode = 'style' | 'bg' | 'mask' | 'svg';
  82. /**
  83. * Mix of icon properties and HTMLElement properties
  84. */
  85. export declare type IconProps = IconifyElementProps & IconifyIconProps;
  86. export { }