mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
ini module def.
This commit is contained in:
10
ini/ini-tests.ts
Normal file
10
ini/ini-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference path="ini.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
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);
|
||||
25
ini/ini.d.ts
vendored
Normal file
25
ini/ini.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for ini v1.3.3
|
||||
// Project: https://github.com/isaacs/ini
|
||||
// Definitions by: Marcin Porębski <https://github.com/marcinporebski>
|
||||
// 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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user