Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Angular Template Angular Template
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • IzeniIzeni
  • Angular TemplateAngular Template
  • Wiki
  • typescript

typescript · Changes

Page history
small clarification authored Sep 28, 2016 by Mikkel Davis's avatar Mikkel Davis
Hide whitespace changes
Inline Side-by-side
typescript.md
View page @ 614fa1ff
......@@ -9,7 +9,7 @@ You want type enforcement in your javascript? Cuz this is how you get type enfor
- _if_ this is not feasible for some reason, go ahead and use the `any` type, sparingly
#### Typings
Most any library has typings available, which will make the typescript compiler (tsc, webpack ts-loader, atom-typescript, etc) aware of necessary types. For example, defining types for global variables, like `setTimeout` or `_`
Most any library has typings available, which will make the typescript compiler (tsc, webpack ts-loader, atom-typescript, etc) aware of necessary types for objects imported from those libraries; i.e. the `_`object or `window`object
* these are kept in `<repo>/typings/` and listed in `typings.json`, so that when the npm postinstall script runs (see package.json), the `typings install` command has something to go off of, similar to the dependencies list in package.json
* to install a new typing and save it to typings.json at the same time, it looks like this: `typings install --save --global dt~lodash` (where lodash is the name of the particular typings package, in this case lodash. `global` doesn't mean the same thing it does with npm modules; you'll usually want the global flag when installing)
* the `declare` ts keyword is available for a variety of uses, including when there are issues with global variables
......
Clone repository
  • angular
  • cookbook forms
  • cookbook routing
  • data store
  • gotchas
  • Home
  • modals
  • sass with bem
  • toolbox
  • typescript
  • webpack