typescript-typings

    0熱度

    1回答

    如何使用元素的UI與Vue公司+打字稿 有沒有類型元素的UI,所以當我導入 import Vue from 'vue'; import Element from 'element-ui' 我得到一個錯誤 Could not find a declaration file for module 'element-ui'. '/home/andres/Code/cdr/frontend/node

    0熱度

    1回答

    我想改進安裝在node_modules/@ types處的程序包,但我不想在那裏編輯它,因爲node_modules可以被刪除和/或更新。當我將文件夾移出node_modules/@ types時,vscode中的intellisense不再有效。我編輯了tsconfig中的文件,路徑,包含和typeRoots字段,以便無需運氣就能匹配新位置。有沒有人知道如何設置vscode和/或tsconfig

    0熱度

    1回答

    我試圖弄清楚什麼是適當的類型爲Ramda食譜方法mapKeys它不會發生錯誤沒有transpile。 問題 錯誤是fn:類型的 參數 '{}' 不是分配給類型的參數 '(一個: 字符串)=>字符串'。類型「{}」不提供符合簽名'(a: 字符串):string'。 我可以從R.adjust的分型看,它使用泛型,我試圖(a: string) => string基於錯誤,這應該是正確的分型,和其他一些變

    3熱度

    1回答

    我開始了一個新項目,我想使用TypeScript而不是純Javascript。我正在努力將Bluebird與第三方庫結合使用。 請看下面的例子: import * as Promise from 'bluebird' private requestPlayerProfile(playerTag:string):Promise<IPlayerProfile> { const r

    0熱度

    1回答

    大圖:我的組織有幾個用TypeScript編寫的Angular應用程序,每個應用程序都包含大量重複的代碼。我們已經開始將我們可重複使用的TypeScript代碼打包爲NPM包並將它們發佈到TFS 2017中的私有NPM註冊表中。我們使用Gulp將可重用TypeScript代碼編譯爲JavaScript(使用gulp-typescript)並使用「聲明「tsconfig.json中的屬性強制產生一個

    6熱度

    1回答

    我有一個使用JavaScript編寫的外部SDK。其中一個模塊Blob是新功能,但也暴露了枚舉FooEnum(成員Bar和Baz)。 JavaScript中使用該SDK代碼是像這樣: const blobInstance = new Sdk.Blob(); const fooType = Sdk.Blob.FooEnum.Baz; 我現在想寫,我可以爲了給我一些類型的安全施放此SDK給的接口

    0熱度

    1回答

    我正在嘗試在我的Angular項目中實現第三方.js庫(gridstack.js)。但是我對使用/導入類型文件(.d.ts)的方式感到困惑。 所以我到目前爲止的做法是通過npm安裝gridstack以及它的類型。然後我嘗試在我的component.ts中導入它。 (import * as gridstack from 'gridstack'),但index.d.ts不被識別爲模塊。我猜這是有道理的

    0熱度

    1回答

    React.createElement參數類型爲[string, { [prop: any]: string }, [string | [string, {[prop: any]: string}, ...repeatedHere] 的問題是我如何提取這個參數型號? 我試圖至今: type VNode = [string, { [props: string]: string }, (string

    1熱度

    3回答

    只要看看這個打字稿代碼: lib.ts interface Human { name: string; age: number; } export default class HumanFactory { getHuman(): Human { return { name: "John", age: 22, }

    0熱度

    1回答

    我構建了@ masala/parser的類型系統,因此我可以根據需要編輯index.d.ts。 作爲一個用戶,我可以這樣做: import masala from '@masala/parser' let {C, Stream, F} = masala; ,但我不能做什麼是ES2015的常見方式: import {C, Stream, F} from '@masala/parser' T