From 802bbfcfdcd1c823e1db67750851a1809a6e6f43 Mon Sep 17 00:00:00 2001 From: Gustav Bylund Date: Fri, 12 Oct 2018 18:32:10 +0200 Subject: [PATCH] Update tempy to v0.2.x (#29681) --- types/tempy/index.d.ts | 9 +++++---- types/tempy/tempy-tests.ts | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/types/tempy/index.d.ts b/types/tempy/index.d.ts index ec210e0829..15c1664409 100644 --- a/types/tempy/index.d.ts +++ b/types/tempy/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for tempy 0.1 +// Type definitions for tempy 0.2 // Project: https://github.com/sindresorhus/tempy#readme -// Definitions by: Douglas Duteil +// Definitions by: Douglas Duteil , Gustav Bylund // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export function directoryAsync(): Promise; export function directory(): string; -export function file(options?: {extension: string}): string; +export function file( + options?: { extension: string } | { name: string } +): string; export const root: string; diff --git a/types/tempy/tempy-tests.ts b/types/tempy/tempy-tests.ts index 56ec437e55..0af9467bb2 100644 --- a/types/tempy/tempy-tests.ts +++ b/types/tempy/tempy-tests.ts @@ -1,12 +1,12 @@ -import { directoryAsync, directory, file, root } from 'tempy'; +import { directory, file, root } from "tempy"; // -directoryAsync().then((tempDir1: string) => tempDir1 === '/tmp/123456789'); - const tempDir2: string = directory(); const tempFile: string = file(); -const pngFile: string = file({extension: 'png'}); +const pngFile: string = file({ extension: "png" }); + +const fileWithName: string = file({ name: "afile.txt" }); const tmpRoot: string = root;