awesome-typescript-loader
全部标签 声明x=$('#msgBox_'+scope.boxId).position().left;生成一个errorTS2304:Cannotfindname'$'尽管jquery和@types安装在node_modules文件夹中。我的tsconfig.json看起来像这样:{"compilerOptions":{"module":"commonjs","target":"es5","sourceMap":true,"moduleResolution":"node","declaration":true},"exclude":["node_modules"]}我该如何解决?
当我尝试使用Jest运行测试时出现此错误:FAILsrc/__tests__/jokeGenerator.test.tsx●TestsuitefailedtorunTypeError:environment.teardownisnotafunctionatnode_modules/jest-runner/build/run_test.js:230:25我在这里遇到了一个可能的解决方案:HowtosolveTypeError:environment.teardownisnotafunction但在按照建议进行操作后:删除我的yarn.lock文件、node_modules文件夹、从我的p
这个问题在这里已经有了答案:Howtoaccessthecorrect`this`insideacallback(13个答案)关闭6年前。一旦调用回调,我试图将在类开头声明的变量(bool值)设置为true,但我不断收到TypeScript错误。这里是错误:TypeError:Cannotsetproperty'nonReceived'ofundefined这是我的代码:finalizeToken(){braintree.setup(JSON.parse(this.finalToken),'dropin',{container:'dropin-container',defaultFir
我正在尝试使用thisSOanswer中的代码.它使用反射。这是一个副本:exportfunctionCustomComponent(annotation:any){returnfunction(target:Function){varparentTarget=Object.getPrototypeOf(target.prototype).constructor;varparentAnnotations=Reflect.getMetadata('annotations',parentTarget);varparentAnnotation=parentAnnotations[0];Obj
我想在我的Typescript项目中使用socket.io,但我只找到了服务器端typescript的.d.ts文件。这是一个很好的例子:https://github.com/soywiz/typescript-node-definitions/blob/master/socket.io.d.ts它展示了如何将TypeScript与Socket.io结合使用。但是在客户端它使用JavaScript。我需要的是用于客户端TypeScript的.d.ts文件,它可以解决此行的错误消息:varsocket=io.connect("localhost");Thename"io"doesnote
我在尝试转换为使用TypeScript的项目中使用fabricjs,但我不知道如何使用它。以前我会通过执行以下操作来创建自己的自定义对象:my.namespace.Control=fabric.util.createClass(fabric.Object,{id:"",type:'Control',color:"#000000",...});在我的新项目中,我安装了来自here的TypeDefinition文件。但我不知道我应该如何使用它?查看.d.ts文件,fabric.Object似乎不是函数,因此不允许传递给createClass,并且createClass本身返回void,因此
我正在使用NightWatch进行端到端测试,并希望转向ES6编写测试的方式。我可以用Babel来做,而且效果很好,但我想使用typescript。我找不到太多关于NightWatchwithTypeScript的文档。找到了一些github存储库:https://github.com/rkavalap/NightWatchTesthttps://github.com/DonPage/Nightwatch-Typescript-examplehttps://github.com/remojansen/TypeScriptTestingExamples但是这些不包含任何关于typescr
我使用带有ts-loader的webpack来转换和捆绑各种TypeScript文件。这是我的配置:tsconfig.json{"compileOnSave":false,"compilerOptions":{"noImplicitAny":true,"noEmitOnError":true,"removeComments":false,"sourceMap":true,"target":"es5","module":"es2015","lib":["dom","es2015","es2016"],"allowSyntheticDefaultImports":true,"moduleR
我正在开发Angular2/TypeScript项目并使用jasmine进行单元测试。如何使用jasmine.js测试用常量调用的函数。例如。Logo.tsexportconstRADIUS:number=10;exportclassLogo{...protecteddrawCircle(x:number,y:number,r:number){...}protecteddrawLogo(){this.drawCircle(RADIUS,RADIUS,RADIUS);}...}Logo.spec.tsdescribe('drawLogo',function(){beforeEach(()
目前我正在尝试在我的项目中使用d3-dragv4类型。正在使用Ts1.8.10,尚未准备好迁移到TS2测试版。d3-v4类型库位于此处:https://github.com/tomwanzek/d3-v4-definitelytyped我尝试使用以下方式安装类型:typingsinstalld3-drag=github:tomwanzek/d3-v4-definitelytyped/src/d3-drag/index.d.ts#4d09073c046b6444859c66ff441f1e7691777d0f--save但我收到以下错误:typingsERR!causedby/tomwa