Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mafredri/phoenix-typings
TypeScript typings for Phoenix (kasper/phoenix)
https://github.com/mafredri/phoenix-typings
phoenix phoenix-typings typescript typings
Last synced: 24 days ago
JSON representation
TypeScript typings for Phoenix (kasper/phoenix)
- Host: GitHub
- URL: https://github.com/mafredri/phoenix-typings
- Owner: mafredri
- License: mit
- Created: 2016-05-01T16:12:18.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2022-05-07T11:10:08.000Z (about 2 years ago)
- Last Synced: 2024-02-27T07:33:42.626Z (4 months ago)
- Topics: phoenix, phoenix-typings, typescript, typings
- Homepage:
- Size: 185 KB
- Stars: 29
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-stars - mafredri/phoenix-typings - TypeScript typings for Phoenix (kasper/phoenix) (Others)
- awesome-stars - mafredri/phoenix-typings - TypeScript typings for Phoenix (kasper/phoenix) (Others)
README
# Typed Phoenix Typings
[`phoenix-typings`](https://github.com/mafredri/phoenix-typings) is the type definition for [Phoenix](https://github.com/kasper/phoenix).
## Installing
```
# Inside project
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`:
```json
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"baseUrl": "src",
"outDir": "out",
"target": "ES2021",
"strict": true,
"types": ["phoenix"],
"typeRoots": ["node_modules/@types"],
"lib": ["ES2021"]
},
"exclude": [
"node_modules"
]
}
```**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](https://github.com/mafredri/phoenix-config) with it's [`webpack.common.js`](https://github.com/mafredri/phoenix-config/blob/a4e36c1bdc2fa6c9e3f12e26e2f88073780ba8ec/webpack.common.js), [`webpack.prod.js`])(https://github.com/mafredri/phoenix-config/blob/a4e36c1bdc2fa6c9e3f12e26e2f88073780ba8ec/webpack.prod.js) and [`tsconfig.json`](https://github.com/mafredri/phoenix-config/blob/a4e36c1bdc2fa6c9e3f12e26e2f88073780ba8ec/tsconfig.json). Requires `webpack` and `ts-loader`.