mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Moved old node defs to node-0.8.8 and separated tests for each version.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/// <reference path="node-0.8.8.d.ts" />
|
||||
|
||||
import assert = module("assert");
|
||||
import fs = module("fs");
|
||||
|
||||
assert(1 + 1 - 2 === 0, "The universe isn't how it should.");
|
||||
|
||||
assert.deepEqual({ x: { y: 3 } }, { x: { y: 3 } }, "DEEP WENT DERP");
|
||||
|
||||
assert.equal(3, "3", "uses == comparator");
|
||||
|
||||
assert.notStrictEqual(2, "2", "uses === comparator");
|
||||
|
||||
assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT");
|
||||
|
||||
assert.doesNotThrow(() => {
|
||||
if (false) { throw "a hammer at your face"; }
|
||||
}, undefined, "What the...*crunch*");
|
||||
|
||||
|
||||
fs.writeFile("thebible.txt",
|
||||
"Do unto others as you would have them do unto you.",
|
||||
assert.ifError);
|
||||
|
||||
fs.writeFile("Harry Potter",
|
||||
"\"You be wizzing, Harry,\" jived Dumbledore.",
|
||||
"ascii",
|
||||
assert.ifError);
|
||||
Vendored
+1059
File diff suppressed because it is too large
Load Diff
Vendored
+11
-10
@@ -1,6 +1,6 @@
|
||||
/************************************************
|
||||
* *
|
||||
* Node.js v0.8.8 API *
|
||||
* Node.js v0.10.1 API *
|
||||
* *
|
||||
************************************************/
|
||||
|
||||
@@ -768,19 +768,20 @@ declare module "fs" {
|
||||
export function futimesSync(fd: string, atime: number, mtime: number): void;
|
||||
export function fsync(fd: string, callback?: Function): void;
|
||||
export function fsyncSync(fd: string): void;
|
||||
export function write(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) =>any): void;
|
||||
export function write(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err, written: number, buffer: NodeBuffer) =>any): void;
|
||||
export function writeSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): void;
|
||||
export function read(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void;
|
||||
export function read(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err, bytesRead: number, buffer: NodeBuffer) => void): void;
|
||||
export function readSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): any[];
|
||||
export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void;
|
||||
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
|
||||
export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err, data: any) => void ): void;
|
||||
export function readFile(filename: string, callback: (err, data: NodeBuffer) => void ): void;
|
||||
export function readFileSync(filename: string): NodeBuffer;
|
||||
export function readFileSync(filename: string, encoding: string): string;
|
||||
export function readFileSync(filename: string, options: { encoding?: string; flag?: string; }): any;
|
||||
export function writeFile(filename: string, data: any, callback?: (err) => void): void;
|
||||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: Function): void;
|
||||
export function writeFileSync(filename: string, data: any, encoding?: string): void;
|
||||
export function appendFile(filename: string, data: any, encoding?: string, callback?: Function): void;
|
||||
export function appendFileSync(filename: string, data: any, encoding?: string): void;
|
||||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err) => void): void;
|
||||
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
|
||||
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err) => void): void;
|
||||
export function appendFile(filename: string, data: any, callback?: (err) => void): void;
|
||||
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
|
||||
export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void;
|
||||
export function watchFile(filename: string, options: { persistent?: bool; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void;
|
||||
export function unwatchFile(filename: string, listener?: Stats): void;
|
||||
|
||||
Reference in New Issue
Block a user