diff --git a/types/yawn-yaml/cjs/index.d.ts b/types/yawn-yaml/cjs/index.d.ts new file mode 100644 index 0000000000..86da2fde63 --- /dev/null +++ b/types/yawn-yaml/cjs/index.d.ts @@ -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; +} diff --git a/types/yawn-yaml/index.d.ts b/types/yawn-yaml/index.d.ts new file mode 100644 index 0000000000..76d6af9bc4 --- /dev/null +++ b/types/yawn-yaml/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for yawn-yaml 1.4 +// Project: https://github.com/mohsen1/yawn-yaml#readme +// Definitions by: Jamie Magee +// 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; +} diff --git a/types/yawn-yaml/tsconfig.json b/types/yawn-yaml/tsconfig.json new file mode 100644 index 0000000000..8c59cd6f73 --- /dev/null +++ b/types/yawn-yaml/tsconfig.json @@ -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" + ] +} diff --git a/types/yawn-yaml/tslint.json b/types/yawn-yaml/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/yawn-yaml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/yawn-yaml/yawn-yaml-tests.ts b/types/yawn-yaml/yawn-yaml-tests.ts new file mode 100644 index 0000000000..52f4e85386 --- /dev/null +++ b/types/yawn-yaml/yawn-yaml-tests.ts @@ -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