mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
[temp-write] add typings (#18853)
This commit is contained in:
committed by
Mohamed Hegazy
parent
f6d01af1e6
commit
fb18e56681
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for temp-write 3.3
|
||||
// Project: https://github.com/sindresorhus/temp-write#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
export = tempWrite;
|
||||
|
||||
declare function tempWrite(input: string | Buffer | NodeJS.ReadableStream, filepath?: string): Promise<string>;
|
||||
|
||||
declare namespace tempWrite {
|
||||
function sync(input: string | Buffer, filepath?: string): string;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import tempWrite = require('temp-write');
|
||||
|
||||
tempWrite('unicorn').then(path => {
|
||||
path; // $ExpectType string
|
||||
});
|
||||
tempWrite('unicorn', 'pony.png'); // $ExpectType Promise<string>
|
||||
tempWrite(process.stdin, 'pony.png');
|
||||
tempWrite(new Buffer('pony'), 'pony.png');
|
||||
|
||||
tempWrite.sync('unicorn'); // $ExpectType string
|
||||
tempWrite.sync(new Buffer('unicorn'));
|
||||
tempWrite.sync('unicorn', 'pony.png');
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"temp-write-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user