Skip to content

Commit

Permalink
fixed IconNode and IconProps types
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Nov 29, 2023
1 parent 350f825 commit 43e322d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/lucide-svelte/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ export default ({ iconName, children }) =>
`\
<script lang="ts">
import Icon from '../Icon.svelte';
import type { IconNode } from '../types';
import type { IconNode, IconProps } from '../types.js';
type $$Props = IconProps;
const iconNode: IconNode = ${JSON.stringify(children)};
</script>
Expand Down
17 changes: 13 additions & 4 deletions packages/lucide-svelte/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/// <reference types="svelte" />
/// <reference types="svelte2tsx/svelte-jsx" />
import type { SVGAttributes, SvelteHTMLElements } from 'svelte/elements';

export type Attrs = svelte.JSX.SVGProps<SVGSVGElement>
export type IconNode = [elementName: keyof svelte.JSX.IntrinsicElements, attrs: Attrs][]
export type IconNode = [
elementName: keyof SvelteHTMLElements,
attrs: SVGAttributes<SVGSVGElement>
][];

export interface IconProps {
color?: string;
size?: number | string;
strokeWidth?: number | string;
absoluteStrokeWidth?: boolean;
class?: string;
}

0 comments on commit 43e322d

Please sign in to comment.