Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
属性不可分配给接口中的字符串索引[重复]
这个问题在这里已经有答案了 我有以下接口 export interface Meta counter number limit number offset number total number export interface Api
typescript
interface
typescript20
“this”隐式具有类型“any”,因为它没有类型注释
当我启用noImplicitThis in tsconfig json 我收到以下代码的错误 this 隐式具有类型 any 因为它没有类型 注解 class Foo implements EventEmitter on name stri
typescript
typescript20
那么属性在 void 类型上不存在,打字稿错误
Code reset let alert this AlertCtrl create buttons ok this userservice passwordreset this email then res any gt if res s
angular
typescript
typescript20
您可以声明一个允许打字稿中未知属性的对象文字类型吗?
本质上 我想确保对象参数包含所有必需的属性 但可以包含它想要的任何其他属性 例如 function foo bar baz number number return bar baz foo baz 1 other 2 但这会导致 Objec
generics
typescript
typescript20
objectliteral
是否可以在打字稿中创建动态 getter/setter?
我是 TypeScript 新手 我正在尝试将我们的应用程序从 es2016 重写为 TypeScript 我的任务是拥有一个具有数据属性的类 并使数据对象中的每个元素可用作类属性 我被这段 JavaScript 代码困住了 for let
class
typescript
Dynamic
typescript20
非类型化 npm 模块的 TypeScript 自定义声明文件
我正在使用一个名为的 React 组件shiitake https github com bsidelinger912 shiitake从 npm 到我使用 TypeScript 的项目 该库没有 TypeScript 声明 所以我想我应该
ReactJS
typescript
ECMAScript6
VisualStudioCode
typescript20
TS2339:联合类型上不存在属性 - 属性字符串 |不明确的
我的联合类型有问题 如下所示 type RepeatForm step repeat false repeat true from undefined repeat true from string by string 我有以下功能 我想获
typescript
types
typescript20
uniontypes
如何将 Knockout 打字文件更新为 TypeScript 2.0 友好?
我已经开始致力于现代化knockout库的 TypeScript 声明文件由DefinitelyTyped项目 声明文件使用了一些已弃用的技术 因此 在 TypeScript 2 0 应用程序中使用它很不方便 当前声明文件包含一个名为的接口
typescript
knockoutjs
typescripttypings
typescript20
使用 TypeScript 在 Angular 管道中使用 MapToIterable
尝试在 Angular 中实现管道 在意识到 ngFor 不适用于地图之后 一些研究让我相信未来的功能将会解决这个问题 但与此同时 mapToIterable 管道就是答案 我有以下代码 import Pipe PipeTransform
angular
typescript
typescript20
angularpipe
自定义类型文件到 Angular 6
我正在尝试以角度方式广告一些自定义类型定义文件 但面临一些错误 在应用程序文件夹中 我有外部文件夹 其中有 external d ts 文件和下面的代码 declare function format input string args s
angular6
typescript20
Typescript:是否有一种简单的方法将一种类型的对象数组转换为另一种类型
所以 我有两节课 Item name string desc string meta string ViewItem name string desc string hidden boolean 我有一个 Item 数组需要转换为 View
Arrays
typescript
typeconversion
typescript20
将数组映射到接口
假设我有一个如下所示的数组 const options name foo type boolean name bar type string name bar should be baz not bar type number 我希望使用这
typescript
typescripttypings
typescript20
tsc
检索函数的返回类型而不调用该函数
假设我在 TypeScript 中有一个这样的函数 export const foo function return a 1 b true c bar 如果我将此函数导入到另一个文件中 import foo from foobar 我的问题
typescript
typescripttypings
typescript20
tsc
使用 TypeScript 2.0 导入 js 文件
Abstract 我正在尝试从外部位置导入 js 文件 即节点模块 我正在尝试使用 commonjs 模块模式来做到这一点 但是import不想使用 js 文件类型 直到我在同一文件夹中的 js 文件附近添加 d ts 文件 但问题是我不想
javascript
nodejs
typescript
typescript20
如何将 core-js Map 导入 angular-cli webpack 生成的应用程序
1 0 0 beta 11 webpack 现在使用 core js 进行 polyfill 我正在尝试导入地图以在我的应用程序中使用 import Map from core js es6 map import Map from core
angular
WEBPACK
angular2forms
Angularcli
typescript20
将 jQuery 与 Typescript 2 结合使用
我是 Typescript 2 的新手 我想做的是将 jQuery 与 Typescript 结合使用 在this https stackoverflow com questions 32050645 how to use jquery w
jQuery
typescript20
Typescript :: 相关通用约束
In React 我有一个像这样的通用界面 interface BaseProps
TS(2352) 声明具有动态属性的对象和一个具有特定类型的属性
我需要创建一个对象 该对象将包含一个名为 state 的属性 该属性将具有通用类型 所有其他属性将是具有覆盖上下文的函数 我不确定这是否可能 因此我决定写在这里 我有一个代码 declare interface ContextModule
typescript
typescripttypings
typescript20
VS2015没有TypeScript模板,不支持TypeScript
我正在研究 Visual Studio 2015 专业版 我已经使用 npm 安装了 TypeScript 安装了 TypeScript 2 0 3 然后我尝试使用右键单击项目的 tsScript 文件夹添加 TypeScript 文件 g
ASPNETMVC
typescript
visualstudio2015
typescript20
如何在 TypeScript 中为类的所有属性赋值?
我有一个具有私有属性的类 class A implements IA private id number private name string constructor obj IA Set here properties from obj
typescript
typescript20
«
1
2
3
»