Merge pull request #3992 from tjonischkat/master

Added defintion for yamljs module
This commit is contained in:
Masahiro Wakame
2015-04-03 00:08:26 +09:00
2 changed files with 27 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="yamljs.d.ts" />
import yamljs = require('yamljs');
yamljs.load('yaml-testfile.yml');
yamljs.parse('this_is_no_ymlstring');
yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }});
yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}, 1);
yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}, 1, 2);
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for yamljs 0.2.1
// Project: https://github.com/jeremyfa/yaml.js
// Definitions by: Tim Jonischkat <http://www.tim-jonischkat.de>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "yamljs" {
export function load(path : string) : any;
export function stringify(nativeObject : any, inline? : number, spaces? : number) : string;
export function parse(yamlString : string) : any;
}