Merge pull request #6342 from chrootsu/iniparser

iniparser: definition of the module has been added
This commit is contained in:
Horiuchi_H
2015-10-20 15:47:00 +09:00
2 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/// <reference path="iniparser.d.ts" />
import * as iniparser from 'iniparser';
type Result = {section: {param: string}};
let file: string;
{
let callback: (err: any, data: Result) => void;
let result: void;
iniparser.parse(file, callback);
}
{
let result: Result;
result = iniparser.parseSync<Result>(file);
result = iniparser.parseString<Result>('');
}

15
iniparser/iniparser.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
// Type definitions for iniparser
// Project: https://github.com/shockie/node-iniparser
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "iniparser" {
export function parse<T>(
file: string,
callback: (err: any, data: T) => void
): void;
export function parseSync<T>(file: string): T;
export function parseString<T>(data: string): T;
}