Skip to content

Commit

Permalink
Merge pull request #94 from kolodny/several-typings-fixes
Browse files Browse the repository at this point in the history
Several fixes for typings
  • Loading branch information
andreiglingeanu committed Feb 15, 2018
2 parents 936c034 + 2f57ec6 commit c54770c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Project: Immutability helper
// TypeScript Version: 2.2

export = update
export default update

declare function update<T>(
data: ReadonlyArray<T>,
Expand All @@ -21,16 +21,16 @@ declare function update<K, V>(
declare function update<T>(data: T, query: Query<T>): T

type Tree<T> = {[K in keyof T]?: Query<T[K]>}
type Query<T> =
export type Query<T> =
| Tree<T>
| ObjectOperators<T>
| ArrayOperators<any>
| SetOperators<any>

type ObjectOperators<T> =
| {$set: any}
| {$toggle: Array<keyof T>}
| {$unset: Array<keyof T>}
| {$toggle: Array<keyof T | number>}
| {$unset: Array<keyof T | number>}
| {$merge: Partial<T>}
| {$apply: (old: T) => T}
| ((old: T) => any)
Expand Down

0 comments on commit c54770c

Please sign in to comment.