项目作者: mafredri

项目描述 :
TypeScript typings for Phoenix (kasper/phoenix)
高级语言:
项目地址: git://github.com/mafredri/phoenix-typings.git
创建时间: 2016-05-01T16:12:18Z
项目社区:https://github.com/mafredri/phoenix-typings

开源协议:MIT License

下载


Typed Phoenix Typings

phoenix-typings is the type definition for Phoenix.

Installing

  1. # Inside project
  2. yarn add 'github:mafredri/phoenix-typings#main'

Using

Once phoenix-typings has been installed they are ready to be used with a correctly configured tsconfig.json. Care should be taken not to enable the TypeScript DOM library.

Here’s a simple example tsconfig.json:

  1. {
  2. "compilerOptions": {
  3. "module": "ESNext",
  4. "moduleResolution": "Node",
  5. "baseUrl": "src",
  6. "outDir": "out",
  7. "target": "ES2021",
  8. "strict": true,
  9. "types": ["phoenix"],
  10. "typeRoots": ["node_modules/@types"],
  11. "lib": ["ES2021"]
  12. },
  13. "exclude": [
  14. "node_modules"
  15. ]
  16. }

NOTE: Phoenix does not support CommonJS type of require. In order to use require or ES2015 style import, webpack is highly recommended. For an example on how to set up webpack, see mafredri/phoenix-config with it’s webpack.common.js, [webpack.prod.js])(https://github.com/mafredri/phoenix-config/blob/a4e36c1bdc2fa6c9e3f12e26e2f88073780ba8ec/webpack.prod.js) and tsconfig.json. Requires webpack and ts-loader.