forked from flow-typed/flow-typed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add definition for tempy (flow-typed#1495)
* Add definition for tempy * trigger rebuild
- Loading branch information
1 parent
d7ad169
commit 56b4548
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
definitions/npm/tempy_v0.x.x/flow_v0.47.x-/tempy_v0.x.x.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type $npm$tempy$Options = { | ||
extension?: string, | ||
name?: string | ||
}; | ||
|
||
declare module "tempy" { | ||
declare module.exports: { | ||
directory: () => string, | ||
file: (options?: $npm$tempy$Options) => string, | ||
root: string | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const tempy = require("tempy"); | ||
|
||
(tempy.file(): string); | ||
|
||
(tempy.file({ extension: ".txt" }): string); | ||
|
||
(tempy.file({ name: "foo.txt" }): string); | ||
|
||
// $ExpectError | ||
tempy.file(123); | ||
|
||
(tempy.directory(): string); | ||
|
||
// $ExpectError | ||
tempy.directory({}); | ||
|
||
(tempy.root: string); |