Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
从枚举参数推断 Typescript 函数返回类型
我想创建一个加载服务 为枚举中定义的 ID 返回正确类型的数据 我所做的看起来像这样 enum IdentifierEnum ID1 ID1 ID2 ID2 interface DataType IdentifierEnum ID1 num
typescript
typescripttypings
如何使用 Typescript 的 socket.IO 客户端类型定义?
我已经使用 SocketIO 客户端安装了 Typescript 定义 npm install types socket io client 但在 VS Code 中我仍然遇到类型错误 let socket SocketIOClientSt
typescript
socketio
typescripttypings
如何包装内在组件,保留大部分 Props?
我想用我自己的 React 功能组件包装一个标准按钮 但我希望新组件的用户能够设置 几乎所有底层按钮的道具 当然 我想保持正确的打字 所以如果 WrappedButton 包含一个button then
ReactJS
typescript
typescripttypings
没有导出的成员/节点模块
我刚刚开始使用 5 分钟快速入门找到的 Angular 2 Typescripthere https angular io docs ts latest quickstart html 我遇到了一个看起来很常见的问题 但可能有点不同 我遇到
angularJS
nodejs
angular
typescript
typescripttypings
在 TypeScript 中推断函数参数
我正在尝试创建一个类型安全的映射函数 不是下面的函数 但我坚持让函数参数正确推断 export type Mapper u mapped Mapped u export type Unmapped name string args any
typescript
typescripttypings
Typescript 通用联盟
所以我有通用对象数组 想要迭代但打字稿不允许我 这是一些示例代码 有关如何解决此问题的任何建议 type someGeneric
typescript
typescripttypings
typescriptgenerics
使用 Typings 安装 React 相关类型定义时出现问题
每当我尝试安装任何与 React 相关的包类型定义时 例如react boostrap fixed data table or react router尝试构建时出现以下类型的错误tsc Typings globals react boot
ReactJS
typescript
typescripttypings
TypeORM 在存储库类型上抛出“类型实例化过深且可能无限。ts(2589)”错误
更新后至VSCode 2019 年 8 月 版本 1 38 和 Typescript 3 6 https code visualstudio com updates v1 38 typescript 36我得到了很多Type instant
typescript
typescripttypings
TypeORM
typescript36
使用类型作为参数 Typescript
如何在 Typescript 中使用类型作为参数 type myType const passingType t Type gt const x t passingType myType 我收到 TS 错误 t 指的是一个值 但在这里被用作
typescript
typescripttypings
更窄的类型不能分配给其他类型
有两种类型 type ExcludeString
typescript
typescripttypings
typescriptgenerics
类型“Request
”上不存在属性“”
当试图延长Request包中的接口express要添加一些自定义属性 我收到以下打字稿错误 TS2339 Property does not exist on type Request
javascript
typescript
Express
typescripttypings
在 TypeScript 中,如何引用属于联合类型一部分的类型?
我在 TypeScript 中为操作定义了一个联合类型 type Action type reset type add payload number type minus payload number 在某些函数中 我想引用联合类型的一部分
typescript
typescripttypings
TypeScript:在对象上强制使用单个动态键
有没有办法为具有以下属性的对象编写接口single动态命名的键 我能够编写一个接受任意数量的动态命名键的接口 但我想将其限制为只有一个 让我们从一些基础知识开始 然后逐步解决我的问题 在下面的接口中 对象只能有一个键 并且它被命名为 id
typescript
typescripttypings
重新声明第 3 方库中不正确的打字稿类型
我正在使用带有 types winston 类型的winston 3 0 这些类型尚未完全兼容 并且我遇到了类型中的错误 我不知道如何纠正 这是我的代码 记录器 ts export function middleware express H
typescript
npm
typescripttypings
TypeScript:如何建模 json 对象
我想输入一个变量 该变量应该是能够使用 JSON stringify 序列化的对象 我找到了这个定义 https github com Microsoft TypeScript issues 15225 issuecomment 29471
json
typescript
typescripttypings
如何使用@types/express-session?
当我写这个时 import Request from express serve static core router post req Request res next gt req session user user tsc给我一个错误
typescript
typescripttypings
typescript20
expresssession
TypeScript D3 v4 导入不起作用
我正在尝试在 D3 之上构建一个小型 JS 库来绘制折线图 我对整个场景相当陌生 但我认为跳入 深渊 是最好的学习方式 这是我的内容package json name d3play02 version 1 0 0 description m
javascript
d3js
typescript
typescripttypings
TypeScript 编译器参数“skipLibCheck”的用法
我一直在研究进一步的解释跳过库检查TypeScript 编译器参数来确定将此设置为的安全性true 我找到的最深入的解释如下 新 skipLibCheck TypeScript 2 0 添加了一个新的 skipLibCheck 编译器选项
typescript
typescripttypings
typescript20
使用 React、Typescript 和 Webpack 显示静态图像
我正在尝试使用 webpack 和 webpack dev server 在 React 组件中显示图像 作为项目的一部分 到目前为止我已经完成了以下步骤 使用 npm 安装文件加载器 更新了 webpack config js 以添加图像
ReactJS
WEBPACK
typescripttypings
webpackfileloader
Typescript 为具有动态和静态键的对象创建接口
我正在尝试学习打字稿 但在界面方面遇到了障碍 我有一个想要保存的对象token和一个route如下 const obj token thisismytoken path to somewhere 我在这里遇到的问题是 如何生成该对象的接口
typescript
interface
typescripttypings
1
2
3
4
5
6
7
»