Skip to content

Commit

Permalink
fix: Add missing type definition for oneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
znck committed Jan 22, 2019
1 parent 0783478 commit 6ce9364
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 1 addition & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ jobs:
- node_modules
key: v1-dependencies-{{ checksum "package-lock.json" }}

- run:
name: check code style
command: npm run lint

- run:
name: test
command: npm run test:cov

- run:
name: upload coverage
command: bash <(curl -s https://codecov.io/bash)
command: npm test
8 changes: 8 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ export interface PropTypes {
arrayOf<T>(type: PropValidator<T>): PropValidator<Array<T>>
arrayOf<T>(type: ValidatorFn<T>): PropValidator<Array<T>>

oneOf<T>(...args: T[]): PropValidator<T>
oneOf<T1>(arg1: T1): PropValidator<T1 | T2 | T3 | T4>
oneOf<T1, T2>(arg1: T1, arg2: T2): PropValidator<T1 | T2 | T3 | T4>
oneOf<T1, T2, T3>(arg1: T1, arg2: T2, arg3: T3): PropValidator<T1 | T2 | T3 | T4>
oneOf<T1, T2, T3, T4>(arg1: T1, arg2: T2, arg3: T3, arg4: T4): PropValidator<T1 | T2 | T3 | T4>
oneOf<T1, T2, T3, T4, T5>(arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): PropValidator<T1 | T2 | T3 | T4 | T5>
oneOf<T1, T2, T3, T4, T5, T6>(arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6): PropValidator<T1 | T2 | T3 | T4 | T5 | T6>

oneOfType<T1>(t1: T1): PropValidator<Infer<T1>>
oneOfType<T1, T2>(t1: T1, t2: T2): PropValidator<Infer<T1 | T2>>
oneOfType<T1, T2, T3>(
Expand Down

0 comments on commit 6ce9364

Please sign in to comment.