Commit Graph
3272 Commits
Author SHA1 Message Date
John Vilk cddd0b7aab [Node] Node attaches errno information to some exceptions.
This is valuable information for Node applications that need to figure out why a particular system call failed.

Note that errno can either be a string or a number, which is why I have typed it as 'any'.

While this is undocumented, it is tested:
Code property: https://github.com/joyent/node/blob/v0.10.23-release/test/simple/test-fs-open.js#L34
Errno property [string]: https://github.com/joyent/node/blob/v0.10.23-release/test/internet/test-dns.js#L148
Errno property [number]: https://github.com/joyent/node/blob/v0.10.23-release/test/simple/test-domain-implicit-fs.js#L43
Syscall property: https://github.com/joyent/node/blob/v0.10.23-release/test/simple/test-stdout-close-catch.js#L38
Path property (I can’t find a test, but many examples have this line): https://github.com/joyent/node/blob/v0.10.23-release/deps/npm/node_modules/fstream-npm/example/bundle.js#L6

..and well supported in the code for all platforms (this is where I got the name 'ErrnoException' from):
*nix: https://github.com/joyent/node/blob/v0.10.23-release/src/node.cc#L719
Windows: https://github.com/joyent/node/blob/v0.10.23-release/src/node.cc#L856

Unfortunately, while every errno exception is guaranteed to have the ‘errno’ and ‘code’ properties (see the logic in the source code in node.cc), there is no hard guarantee that particular library functions will always pass an ErrnoException to the callback. I cannot find a counterexample at this moment, though. Since we can’t have union types in TypeScript, I simply made all of the properties on ErrnoException optional as a compromise.

I am only adding modifications to the fs module, which definitely throws ErrnoExceptions. But according to the examples above, other modules (e.g. dns) also pass errno information back to applications. People familiar with those other modules can update their typings to reference this interface when applicable; I lack the experience with those modules to update their typings.

Further proof:
```javascript
$ node
> var fs = require('fs');
undefined
> fs.open('doesntexistlol', 'r', function(e) { console.log(Object.keys(e)); console.log(e.code); console.log(e.errno); console.log(e.path); });
undefined
> [ 'errno', 'code', 'path' ]
ENOENT
34
doesntexistlol
```
2013-12-17 16:36:08 -05:00
Basarat Ali Syed 718eff7763 Merge pull request #1456 from daptiv/54952-use-new-tslint-rules
Update angular resource definitions, and add injector definition
2013-12-17 02:34:08 -08:00
John Emau 459e286cd0 added syntax highlighting 2013-12-16 19:17:47 -08:00
John Emau a859e22699 added missing test for resource service factory and updated readme 2013-12-16 19:15:42 -08:00
John Emau 71e23deadd added tests for new angular-resource generics signatures 2013-12-16 19:03:37 -08:00
Jonathan Park 72cc261506 adding invoke inline annotated functions 2013-12-16 17:39:28 -08:00
Jonathan Park 41a7127404 updating angular resource and injector definitions 2013-12-16 17:17:39 -08:00
Basarat Ali Syed 8828800831 Merge pull request #1383 from jedmao/handlebars
Fix Ember/Handlebars
2013-12-16 16:26:32 -08:00
Basarat Ali Syed 1d30cca2e7 Merge pull request #1453 from damianog/patch-9
Update highcharts.d.ts Fixed missing type declarations.
2013-12-16 03:47:40 -08:00
Basarat Ali Syed efd60916df Merge pull request #1452 from damianog/patch-8
Update globalize.d.ts 'format' lacks return-type annotation
2013-12-16 03:47:15 -08:00
Basarat Ali Syed 30a55d258b Merge pull request #1454 from michalkutil/master
jQuery: The interface used to specify easing functions add
2013-12-15 15:16:22 -08:00
Michal Kutil 0d2fb0d17a jQuery: The interface used to specify easing functions add 2013-12-15 23:04:05 +01:00
Masahiro Wakame 909a178441 Merge pull request #1442 from brettpostin/patch-1
Update to resolve issue #1434
2013-12-15 06:50:22 -08:00
damianog a3cca0d72f Update highcharts.d.ts
Fixed missing type declarations.
2013-12-15 13:50:21 +01:00
damianog ef0db52948 Update globalize.d.ts
'format' lacks return-type annotation
2013-12-15 13:16:39 +01:00
Jed Hunsaker a63e5a7e1e Fix Ember/Handlebars 2013-12-14 14:21:00 -06:00
Brett Postin bb1fbec552 Update to resolve issue #1434
Alternative fix as suggested here:

https://github.com/borisyankov/DefinitelyTyped/pull/1435
2013-12-13 10:11:18 +00:00
Masahiro Wakame 7469c06f42 Merge pull request #1440 from ashwinr/master
Update when.d.ts
2013-12-12 19:46:05 -08:00
Masahiro Wakame 0daed330d1 Merge pull request #1439 from jvilk/node-fixes
[Node] Removing incorrect typing for `buffer.INSPECT_MAX_BYTES`.
2013-12-12 19:42:45 -08:00
Masahiro Wakame 3e14f31e63 Merge pull request #1437 from DevExpress/master
Support for 0.9.5 compiler version added
2013-12-12 18:35:25 -08:00
Masahiro Wakame b459266af9 Merge pull request #1436 from nvivo/backbone-opional-params
Makes some parameters optional, as they are not required by backbone.
2013-12-12 18:31:46 -08:00
Masahiro Wakame 2edeece21e Merge pull request #1432 from markwongsk/master
Specified typings for functions returning void
2013-12-12 18:25:58 -08:00
Masahiro Wakame 2807d6fa76 Merge pull request #1430 from timbow574521/work
Add suport for Google BarChart.
2013-12-12 18:10:53 -08:00
Masahiro Wakame 4f16ab8239 Merge pull request #1425 from michelsalib/patch-4
[Angular-ui-router] onExit/onEnter can be inline injected functions
2013-12-12 17:48:12 -08:00
Masahiro Wakame 1f3da824da Merge pull request #1423 from brian428/_extjs
Update to TS 0.9.5
2013-12-12 17:42:03 -08:00
Basarat Ali Syed 862cca6943 Merge pull request #1433 from jedmao/fix-express
More specific Express types
2013-12-12 14:12:18 -08:00
ashwinr 5a1317725c Update when.d.ts 2013-12-12 17:09:36 -05:00
John Vilk f1c040b378 [Node] Removing incorrect typing for buffer.INSPECT_MAX_BYTES.
From http://nodejs.org/api/buffer.html#buffer_buffer_inspect_max_bytes:

"...this is a property on the buffer module returned by require('buffer'), not on the Buffer global, or a buffer instance."

The Node typings do not have a notion of a buffer module, and introducing one would be more work than might be useful. It contains a reference to `Buffer` and `SlowBuffer`, which are currently defined as variables in the typings. I believe I would need
 to redefine these in the module definition.

If anyone has any ideas for how to efficiently restructure this, let me know.
2013-12-12 14:41:23 -05:00
Igor Kriklivets 6b0e6361f4 Support for 0.9.5 compiler version 2013-12-12 21:31:41 +04:00
Igor Kriklivets 41d06a112d .tscparams removed 2013-12-12 21:30:01 +04:00
Jed Mao 1ee4c773d0 More specific Express types 2013-12-12 11:07:02 -06:00
Natan Vivo 67c0a6fc37 Makes some parameters optional, as they are not required by backbone. 2013-12-12 12:13:10 -02:00
Basarat Ali Syed 40296ff5e1 Update promptly.d.ts 2013-12-12 15:56:13 +11:00
Mark Wong Siang Kai a11a5d90e6 Specified typings for functions returning void
-- note that removeKeyMap in codemirror.js returns true sometimes
-- but I think it should only return
2013-12-11 16:12:31 -08:00
Basarat Ali Syed dd476daddd add node def reference 2013-12-12 10:06:42 +11:00
timbow574521 f56e4880df Add suport for Google BarChart. 2013-12-11 16:44:11 -05:00
Basarat Ali Syed 087bbaa195 Merge pull request #1427 from danrspencer/master
Added definition file for Promptly
2013-12-11 04:19:01 -08:00
Basarat Ali Syed 04aea4be15 Merge pull request #1426 from michelsalib/karma-jasmine
Add karma-jasmine extra definitions (closes #1415)
2013-12-11 04:18:10 -08:00
Dan Spencer 2661fd4a9a Added definition file for Promptly 2013-12-11 12:15:34 +00:00
Michel Salib 1e8f04b8f8 Add karma-jasmine extra definitions 2013-12-11 12:02:46 +01:00
Michel Salib 751cdfb539 [Angular-ui-router] onExit/onEnter can be inline injected functions 2013-12-11 10:48:53 +01:00
Brian Kotek ddf2401d06 Update to TS 0.9.5; fix invalid MultiSlider setValue method; add logic to include static properties. 2013-12-10 22:03:35 -05:00
Masahiro Wakame 4df0598c8d Merge pull request #1421 from Igorbek/master
rx.js: added definition for experimental functions
2013-12-10 18:50:26 -08:00
Masahiro Wakame 4ac672836e Merge pull request #1420 from stanthomas/master
TS 0.9.5 support: add definition for rest arguments in jQuery.on() to su...
2013-12-10 18:45:22 -08:00
Masahiro Wakame ba98843480 Merge pull request #1418 from RomanoLindano/master
Angular scenario typings.
2013-12-10 18:30:51 -08:00
Masahiro Wakame 52b37e40fa Merge pull request #1417 from csrakowski/iScroll-5
Added iScroll 5 typings
2013-12-10 18:27:54 -08:00
Masahiro Wakame 7efe26a709 Merge pull request #1416 from nvivo/backbone_collections
Added missing overloads to add/reset
2013-12-10 18:25:32 -08:00
Masahiro Wakame 5ea1a8ef2e Merge pull request #1414 from gandjustas/master
Added SP.Publishing and SP.DocumentManagement; Checked for TS 0.9.5
2013-12-10 18:24:16 -08:00
Masahiro Wakame 5794e98cb1 Merge pull request #1413 from loyd/websocket
Add undocumented but useful fields to WebSocket-Node
2013-12-10 18:23:06 -08:00
Masahiro Wakame 0b8937df23 Merge pull request #1401 from loyd/fix-#1321
Rename Timer to NodeTimer
2013-12-10 18:20:31 -08:00