From 587449f4084a352bf0ef91cceda1b2fd57628d96 Mon Sep 17 00:00:00 2001 From: Marcin Porebski Date: Thu, 5 Mar 2015 16:31:17 +0100 Subject: [PATCH] ini module def. --- ini/ini-tests.ts | 10 ++++++++++ ini/ini.d.ts | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 ini/ini-tests.ts create mode 100644 ini/ini.d.ts diff --git a/ini/ini-tests.ts b/ini/ini-tests.ts new file mode 100644 index 00000000000000..44241625f722c9 --- /dev/null +++ b/ini/ini-tests.ts @@ -0,0 +1,10 @@ +/// +/// + +import fs = require("fs"); +import ini = require("ini"); + +var ini_content = fs.readFileSync("path_to_file.ini", "utf-8"); + +var ini_object: any = ini.decode(ini_content); +var ini_rev_string: string = ini.encode(ini_object); \ No newline at end of file diff --git a/ini/ini.d.ts b/ini/ini.d.ts new file mode 100644 index 00000000000000..6cab735330af0c --- /dev/null +++ b/ini/ini.d.ts @@ -0,0 +1,25 @@ +// Type definitions for ini v1.3.3 +// Project: https://github.com/isaacs/ini +// Definitions by: Marcin Porębski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "ini" +{ + interface EncodeOptions { + section: string + whitespace: boolean + } + + function decode(inistring: string): any; + + function parse(initstring: string): any; + + function encode(object: any, options?: EncodeOptions): string; + + function stringify(object: any, options?: EncodeOptions): string; + + function safe(val: string): string; + + function unsafe(val: string): string; + +}