shrpne / vue-inline-svg

Dynamically loads an SVG source and inline <svg> element so you can manipulate the style of it
MIT License
175 stars 21 forks source link

Add typescript types #32

Closed shrpne closed 2 years ago

shrpne commented 3 years ago

Not tested. Need review.

PeeJeeDR commented 2 years ago

Any updates on this?

shrpne commented 2 years ago

@PeeJeeDR I have lack of time to fully test it, so waiting for review from typescript users.

If you want to try it, you can install it like this:

npm i github:shrpne/vue-inline-svg#pull/32/head
yarn add shrpne/vue-inline-svg#32/head
dimeloper commented 2 years ago

hello @shrpne tried to test this one, receiving 2 errors on compilation:

node_modules/vue-inline-svg/types/index.d.ts:7:10 - error TS2305: Module '"vue"' has no exported member 'VueConstructor'.

7 import { VueConstructor } from 'vue';
           ~~~~~~~~~~~~~~

node_modules/vue-inline-svg/types/index.d.ts:12:23 - error TS7051: Parameter has a name but no type. Did you mean 'arg0: string'?

12     transformSource: (string) => string;
shrpne commented 2 years ago

Types added in aeacd342ba7f616e783247875c32b59183e2018a for vue3 and 32b306ae49adb9e3483a4425ccc3362ce084d7f2 for vue2