Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exports Icon type #1762

Merged
merged 2 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/lucide-svelte/src/defaultAttributes.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
1 change: 1 addition & 0 deletions packages/lucide-svelte/src/lucide-svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
17 changes: 14 additions & 3 deletions packages/lucide-svelte/src/types.ts
Original file line number Diff line number Diff line change
@@ -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>;