Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # tslib
  2. This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
  3. This library is primarily used by the `--importHelpers` flag in TypeScript.
  4. When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:
  5. ```ts
  6. var __assign = (this && this.__assign) || Object.assign || function(t) {
  7. for (var s, i = 1, n = arguments.length; i < n; i++) {
  8. s = arguments[i];
  9. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  10. t[p] = s[p];
  11. }
  12. return t;
  13. };
  14. exports.x = {};
  15. exports.y = __assign({}, exports.x);
  16. ```
  17. will instead be emitted as something like the following:
  18. ```ts
  19. var tslib_1 = require("tslib");
  20. exports.x = {};
  21. exports.y = tslib_1.__assign({}, exports.x);
  22. ```
  23. Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
  24. For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.
  25. # Installing
  26. For the latest stable version, run:
  27. ## npm
  28. ```sh
  29. # TypeScript 2.3.3 or later
  30. npm install --save tslib
  31. # TypeScript 2.3.2 or earlier
  32. npm install --save tslib@1.6.1
  33. ```
  34. ## bower
  35. ```sh
  36. # TypeScript 2.3.3 or later
  37. bower install tslib
  38. # TypeScript 2.3.2 or earlier
  39. bower install tslib@1.6.1
  40. ```
  41. ## JSPM
  42. ```sh
  43. # TypeScript 2.3.3 or later
  44. jspm install tslib
  45. # TypeScript 2.3.2 or earlier
  46. jspm install tslib@1.6.1
  47. ```
  48. # Usage
  49. Set the `importHelpers` compiler option on the command line:
  50. ```
  51. tsc --importHelpers file.ts
  52. ```
  53. or in your tsconfig.json:
  54. ```json
  55. {
  56. "compilerOptions": {
  57. "importHelpers": true
  58. }
  59. }
  60. ```
  61. #### For bower and JSPM users
  62. You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
  63. ```json
  64. {
  65. "compilerOptions": {
  66. "module": "amd",
  67. "importHelpers": true,
  68. "baseUrl": "./",
  69. "paths": {
  70. "tslib" : ["bower_components/tslib/tslib.d.ts"]
  71. }
  72. }
  73. }
  74. ```
  75. For JSPM users:
  76. ```json
  77. {
  78. "compilerOptions": {
  79. "module": "system",
  80. "importHelpers": true,
  81. "baseUrl": "./",
  82. "paths": {
  83. "tslib" : ["jspm_packages/npm/tslib@1.9.3/tslib.d.ts"]
  84. }
  85. }
  86. }
  87. ```
  88. # Contribute
  89. There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
  90. * [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
  91. * Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
  92. * Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
  93. * Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
  94. * [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
  95. * Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)).
  96. # Documentation
  97. * [Quick tutorial](http://www.typescriptlang.org/Tutorial)
  98. * [Programming handbook](http://www.typescriptlang.org/Handbook)
  99. * [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
  100. * [Homepage](http://www.typescriptlang.org/)