Add type definition for config-yaml

This commit is contained in:
Arylo
2018-06-15 10:44:20 +08:00
parent ac8c4cb9c0
commit 2e9d3fd71d
4 changed files with 49 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import yaml = require('config-yaml');
yaml('./simple.yaml');
yaml('./simple.yaml', { encoding: 'gbk' });
yaml('./simple.yaml', { encoding: 'utf-8' });
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for config-yaml 1.1
// Project: https://github.com/neolao/config-yaml#readme
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="node" />
import * as fs from 'fs';
export = Yaml;
declare namespace Yaml {
interface Options {
encoding: string;
}
}
declare function Yaml(path: fs.PathLike, options?: Partial<Yaml.Options>): any;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"config-yaml-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }