fix: Exports Icon type (#1762)

* fixed import path

* export Icon type
This commit is contained in:
CokaKoala
2023-12-28 14:26:15 +01:00
committed by GitHub
parent e19a9cc43a
commit d9d7e245a3
3 changed files with 16 additions and 4 deletions
@@ -1,4 +1,4 @@
import type { Attrs } from "./types";
import type { Attrs } from './types.js';
const defaultAttributes: Attrs = {
xmlns: 'http://www.w3.org/2000/svg',
@@ -2,3 +2,4 @@ export * from './icons/index.js';
export * as icons from './icons/index.js';
export * from './aliases.js';
export { default as defaultAttributes } from './defaultAttributes.js';
export type { Icon } from './types.js';
+14 -3
View File
@@ -1,13 +1,24 @@
import type { SvelteComponent } from 'svelte';
import type { SVGAttributes, SvelteHTMLElements } from 'svelte/elements';
type SVGAttrs = SVGAttributes<SVGSVGElement>;
export type Attrs = SVGAttributes<SVGSVGElement>;
export type IconNode = [elementName: keyof SvelteHTMLElements, attrs: SVGAttrs][];
export type IconNode = [elementName: keyof SvelteHTMLElements, attrs: Attrs][];
export interface IconProps extends SVGAttrs {
export interface IconProps extends Attrs {
color?: string;
size?: number | string;
strokeWidth?: number | string;
absoluteStrokeWidth?: boolean;
class?: string;
}
type IconEvents = {
[evt: string]: CustomEvent<any>;
};
type IconSlots = {
default: {};
};
export type Icon = SvelteComponent<IconProps, IconEvents, IconSlots>;