SVG的Typescript库 [英] Typescript library for SVG

查看:509
本文介绍了SVG的Typescript库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在将Raphael与Angular 4应用程序结合使用,并且还尝试切换到Snap.这些支持打字稿都不是很好(完全吗?).

I've been using Raphael with an Angular 4 app and also tried to switch to Snap. Neither of these support typescript very well (at all?).

有人知道包含完整打字稿类型并且不需要博士才能使其与Angular2/4/5一起使用的库吗?

Does anyone know of a library that includes full typescript types and doesn't require a PhD to get it working with Angular2/4/5?

如果没有,我想我将创建一个纯的打字稿库,但这需要很多工作.

If not, I'm thinking I will create a pure typescript library but that's a lot of work.

推荐答案

只需为Raphael安装@types软件包.

Just install the @types package for Raphael.

它由TypeScript社区维护.这些人喜欢自己,用TypeScript编写应用程序并使用Raphael.

It is maintained by the TypeScript community. These are people who like yourself, write apps in TypeScript and use Raphael.

如果发现声明不完善,则可以在 https:上打开一个问题(或请求请求)://github.com/DefinitelyTyped/DefinitelyTyped

If you find that the declarations are imperfect, you can open an issue (or a pull request) on https://github.com/DefinitelyTyped/DefinitelyTyped

安装:

使用NPM:

$ npm install --save @types/raphael

使用JSPM:

$ jspm install npm:@types/raphael

使用纱线:

$ yarn add @types/raphael

用法:

import Raphael from 'raphael';

snapsvg也是如此

The same applies to snapsvg

这篇关于SVG的Typescript库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆