Skip to content

Commit

Permalink
added definition for JSONStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartvds committed Jun 19, 2014
1 parent 8c8e721 commit bd3b137
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
15 changes: 15 additions & 0 deletions JSONStream/JSONStream-tests.ts
@@ -0,0 +1,15 @@
/// <reference path="JSONStream.d.ts" />

import json = require('JSONStream');

var read: NodeJS.ReadableStream;
var write: NodeJS.WritableStream;

read = read.pipe(json.parse('*'));
read = read.pipe(json.parse(['foo/*', 'bar/*']));

read = json.stringify();
read = json.stringify('{', ',', '}');

read = json.stringifyObject();
read = json.stringifyObject('{', ',', '}');
22 changes: 22 additions & 0 deletions JSONStream/JSONStream.d.ts
@@ -0,0 +1,22 @@
// Type definitions for JSONStream v0.8.0
// Project: http://github.com/dominictarr/JSONStream
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

/// <reference path="../node/node.d.ts" />

declare module 'JSONStream' {

export interface Options {
recurse: boolean;
}

export function parse(pattern: any): NodeJS.ReadWriteStream;
export function parse(patterns: any[]): NodeJS.ReadWriteStream;

export function stringify(): NodeJS.ReadWriteStream;
export function stringify(open: string, sep: string, close: string): NodeJS.ReadWriteStream;

export function stringifyObject(): NodeJS.ReadWriteStream;
export function stringifyObject(open: string, sep: string, close: string): NodeJS.ReadWriteStream;
}

0 comments on commit bd3b137

Please sign in to comment.