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

Support for TypeScript #3

Open
acim opened this issue Sep 12, 2020 · 1 comment · May be fixed by #5
Open

Support for TypeScript #3

acim opened this issue Sep 12, 2020 · 1 comment · May be fixed by #5

Comments

@acim
Copy link

acim commented Sep 12, 2020

It would be nice to have TypeScript declaration file .d.ts containing declare module 'mdi-svelte';.

@ethanjli
Copy link

I don't really know how to write .d.ts files, but I threw together the following one and it seemed to work for my project:

declare module 'mdi-svelte' {
  import { SvelteComponentTyped } from 'svelte';

  export interface IconProps {
    path: string;
    size?: number | string;
    color?: string;
    flip?: boolean | string;
    rotate?: number;
    spin?: number | boolean;
    title?: string;
  }
  export default class Icon extends SvelteComponentTyped<IconProps> {}
}

@jhechtf jhechtf linked a pull request Jul 5, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants