Add types for yawn-yaml (#41627)

* Add types for yawn-yaml

* PR comments
This commit is contained in:
Jamie Magee
2020-01-26 01:31:19 -05:00
committed by Eli Barzilay
parent 3ce8975738
commit 253c9edcff
5 changed files with 49 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
export default class YAWN {
constructor(content: string);
json: any;
yaml: string;
getRemark(path: string): string;
setRemark(path: string, remark: string): boolean;
}
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for yawn-yaml 1.4
// Project: https://github.com/mohsen1/yawn-yaml#readme
// Definitions by: Jamie Magee <https://github.com/JamieMagee>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export default class YAWN {
constructor(content: string);
json: any;
yaml: string;
getRemark(path: string): string;
setRemark(path: string, remark: string): boolean;
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"yawn-yaml-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+7
View File
@@ -0,0 +1,7 @@
import YAML from 'yawn-yaml/cjs';
const yaml = new YAML(''); // $ExpectType YAWN
yaml.json; // $ExpectType any
yaml.yaml; // $ExpectType string
yaml.getRemark(''); // $ExpectType string
yaml.setRemark('', ''); // $ExpectType boolean