Cweili / svelte-fa

Tiny FontAwesome component for Svelte

Home Page:https://cweili.github.io/svelte-fa/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type of flip prop

Daellhin opened this issue · comments

First of all thanks for creating and maintaining this library, it is my favorite when it comes to using icons in Svelte.

I do have an minor isue with the type of the flip prop when used in typescript projects.
Currently the type of the component prop flip in fa.svelte is a boolean because of the default value false. This causes type errors in VS Code when using the component with flip set to flip="horizontal"

Current

// fa.svelte
<script>
  export let flip = false;
</script>

Proposed

// fa.svelte
<script lang="ts">
  export let flip : boolean|"horizontal"|"vertical" = false;
</script>

Issue
image

Nevermind I was using the wrong import for TypeScript to properly recognise the types

For others interested:

Old import

<script lang="ts">
  import Fa from "svelte-fa/src/fa.svelte";
</script>

Propper import

<script lang="ts">
  import Fa from "svelte-fa";
</script>