This repository has been archived by the owner on Aug 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Flow type definitions for exported functions (#93)
- Loading branch information
1 parent
63a4c2d
commit 06f2ad5
Showing
12 changed files
with
433 additions
and
31 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
[ignore] | ||
.*/node_modules/.*[^(package)]\.json$ | ||
<PROJECT_ROOT>/dist/.* | ||
|
||
[include] | ||
./src/ | ||
|
||
[libs] | ||
./node_modules/fusion-core/flow-typed | ||
|
||
[lints] | ||
|
||
[options] | ||
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore | ||
|
||
[strict] |
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,10 @@ | ||
/** Copyright (c) 2018 Uber Technologies, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
declare var __NODE__: boolean; | ||
declare var __BROWSER__: boolean; |
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,105 @@ | ||
/* eslint-disable */ | ||
|
||
declare type tape$TestOpts = { | ||
skip: boolean, | ||
timeout?: number, | ||
} | { | ||
skip?: boolean, | ||
timeout: number, | ||
}; | ||
|
||
declare type tape$TestCb = (t: tape$Context) => mixed; | ||
declare type tape$TestFn = (a: string | tape$TestOpts | tape$TestCb, b?: tape$TestOpts | tape$TestCb, c?: tape$TestCb) => void; | ||
|
||
declare interface tape$Context { | ||
fail(msg?: string): void, | ||
pass(msg?: string): void, | ||
|
||
error(err: mixed, msg?: string): void, | ||
ifError(err: mixed, msg?: string): void, | ||
ifErr(err: mixed, msg?: string): void, | ||
iferror(err: mixed, msg?: string): void, | ||
|
||
ok(value: mixed, msg?: string): void, | ||
true(value: mixed, msg?: string): void, | ||
assert(value: mixed, msg?: string): void, | ||
|
||
notOk(value: mixed, msg?: string): void, | ||
false(value: mixed, msg?: string): void, | ||
notok(value: mixed, msg?: string): void, | ||
|
||
// equal + aliases | ||
equal(actual: mixed, expected: mixed, msg?: string): void, | ||
equals(actual: mixed, expected: mixed, msg?: string): void, | ||
isEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
is(actual: mixed, expected: mixed, msg?: string): void, | ||
strictEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
strictEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// notEqual + aliases | ||
notEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
notStrictEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notStrictEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
isNot(actual: mixed, expected: mixed, msg?: string): void, | ||
not(actual: mixed, expected: mixed, msg?: string): void, | ||
doesNotEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
isInequal(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// deepEqual + aliases | ||
deepEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
deepEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
isEquivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
same(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// notDeepEqual | ||
notDeepEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notEquivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
notDeeply(actual: mixed, expected: mixed, msg?: string): void, | ||
notSame(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotDeepEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotDeeply(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotEquivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
isInequivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// deepLooseEqual | ||
deepLooseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
looseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
looseEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// notDeepLooseEqual | ||
notDeepLooseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notLooseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notLooseEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
throws(fn: Function, expected?: RegExp | Function, msg?: string): void, | ||
doesNotThrow(fn: Function, expected?: RegExp | Function, msg?: string): void, | ||
|
||
timeoutAfter(ms: number): void, | ||
|
||
skip(msg?: string): void, | ||
plan(n: number): void, | ||
onFinish(fn: Function): void, | ||
end(): void, | ||
comment(msg: string): void, | ||
test: tape$TestFn, | ||
} | ||
|
||
declare module 'tape-cup' { | ||
declare type TestHarness = Tape; | ||
declare type StreamOpts = { | ||
objectMode?: boolean, | ||
}; | ||
|
||
declare type Tape = { | ||
(a: string | tape$TestOpts | tape$TestCb, b?: tape$TestCb | tape$TestOpts, c?: tape$TestCb, ...rest: Array<void>): void, | ||
test: tape$TestFn, | ||
skip: (name: string, cb?: tape$TestCb) => void, | ||
createHarness: () => TestHarness, | ||
createStream: (opts?: StreamOpts) => stream$Readable, | ||
only: (a: string | tape$TestOpts | tape$TestCb, b?: tape$TestCb | tape$TestOpts, c?: tape$TestCb, ...rest: Array<void>) => void, | ||
}; | ||
|
||
declare module.exports: Tape; | ||
} |
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
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
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
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
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
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
Oops, something went wrong.