// Type definitions for icepick v1.1.0 // Project: https://github.com/aearly/icepick // Definitions by: Nathan Brown // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "icepick" { export function freeze(collection: T): T; export function thaw(collection: T): T; export function assoc(collection: T, key: number | string, value: any): T; export function dissoc(collection: T, key: number | string): T; export function assocIn(collection: T, path: Array, value: any): T; export function getIn(collection: any, path: Array): Result; export function updateIn(collection: T, path: Array, callback: (value: V) => V): T; export {assoc as set}; export {dissoc as unset}; export {assocIn as setIn}; export function assign(target: T): T; export function assign(target: T, source1: S1): (T & S1); export function assign(target: T, s1: S1, s2: S2): (T & S1 & S2); export function assign(target: T, s1: S1, s2: S2, s3: S3): (T & S1 & S2 & S3); export function assign(target: T, s1: S1, s2: S2, s3: S3, s4: S4): (T & S1 & S2 & S3 & S4); export {assign as extend}; export function merge(target: T, source: S1): (T & S1); export function push(array: T[], element: T): T[]; export function pop(array: T[]): T[]; export function shift(array: T[]): T[]; export function unshift(array: T[], element: T): T[]; export function reverse(array: T[]): T[]; export function sort(array: T[], compareFunction?: (a:T, b:T) => number): T[]; export function splice(array: T[], start: number, deleteCount: number, ...items: T[]): T[]; export function slice(array: T[], begin?: number, end?: number): T[]; export function map(fn: (value: T) => U, array: T[]): U[]; export function filter(fn: (value: T) => boolean, array: T[]): T[]; interface IcepickWrapper { value(): T; freeze(): IcepickWrapper; thaw(): IcepickWrapper; assoc(key: number | string, value: any): IcepickWrapper; set(key: number | string, value: any): IcepickWrapper; dissoc(key: number | string): IcepickWrapper; unset(key: number | string): IcepickWrapper; assocIn(path: Array, value: any): IcepickWrapper; setIn(path: Array, value: any): IcepickWrapper; getIn(collection: any, path: Array): IcepickWrapper; updateIn(collection: T, path: Array, callback: (value: V) => V): IcepickWrapper; assign(source1: S1): IcepickWrapper; assign(s1: S1, s2: S2): IcepickWrapper; assign(s1: S1, s2: S2, s3: S3): IcepickWrapper; assign(s1: S1, s2: S2, s3: S3, s4: S4): IcepickWrapper; extend(source1: S1): IcepickWrapper; extend(s1: S1, s2: S2): IcepickWrapper; extend(s1: S1, s2: S2, s3: S3): IcepickWrapper; extend(s1: S1, s2: S2, s3: S3, s4: S4): IcepickWrapper; merge(source: S1): IcepickWrapper; } export function chain(target: T): IcepickWrapper; }