diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..752b72c --- /dev/null +++ b/index.d.ts @@ -0,0 +1,37 @@ +/// + +import { SvelteComponentTyped } from "svelte"; + +declare module SvgIcon { + export interface SvgIconProps { + /** + * Required. An SVG path to render as an icon + */ + path: string; + /** + * This sets the size and viewbox to match the recommended size for the icon pack specified. + */ + type?: "mdi" | "simple-icons" | "default"; + /** + * The width and height of the SVG element + */ + size?: string | number; + /** + * The `viewBox` of the SVG element + */ + viewbox?: string; + /** + * One of "none", "horizontal", "vertical", or "both". Flips the icon in the specified direction(s). + */ + flip?: "none" | "horizontal" | "vertical" | "both"; + /** + * Rotates the icon by the specified value. Can be any valid [CSS angle](https://developer.mozilla.org/en-US/docs/Web/CSS/angle) value. + */ + rotate?: string | number; + } +} + +type Props = SvgIcon.SvgIconProps & { [attribute: string]: any }; + +declare class SvgIcon extends SvelteComponentTyped {} +export = SvgIcon; diff --git a/package.json b/package.json index fd4a8d4..eef11ce 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,10 @@ "version": "0.1.1", "description": "Icon component for Svelte", "main": "lib/svg-icon.svelte", + "exports": { + "types": "./index.d.ts", + "svelte": "./lib/svg-icon.svelte" + }, "directories": { "lib": "lib", "test": "tests"