-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import type { Assign } from './typeUtils/Assign'; | ||
import type { List } from './typeUtils/List'; | ||
import type { Pop } from './typeUtils/List'; | ||
import type { PrettyPrint } from './typeUtils/PrettyPrint'; | ||
/** | ||
* The return type of `merge()`. It reflects the type that is returned by JavaScript. | ||
* | ||
* This TS Utility can be used as standalone as well | ||
*/ | ||
export declare type Merge<T extends Record<string | number | symbol, unknown>, Ts extends List<Record<string | number | symbol, unknown>>> = PrettyPrint<Assign<T, Ts>>; | ||
export declare type Merge<T, Ts extends unknown[]> = T extends Record<string | number | symbol, unknown> ? Ts extends Record<string | number | symbol, unknown>[] ? PrettyPrint<Assign<T, Ts>> : Pop<Ts> : Pop<Ts>; | ||
/** | ||
* Merge anything recursively. | ||
* Objects get merged, special objects (classes etc.) are re-assigned "as is". | ||
* Basic types overwrite objects or other basic types. | ||
*/ | ||
export declare function merge<T extends Record<string | number | symbol, unknown>, Tn extends Record<string | number | symbol, unknown>[]>(object: T, ...otherObjects: Tn): Merge<T, Tn>; | ||
export declare function mergeAndCompare<T extends Record<string | number | symbol, unknown>, Tn extends Record<string | number | symbol, unknown>[]>(compareFn: (prop1: any, prop2: any, propName: string | symbol) => any, object: T, ...otherObjects: Tn): Merge<T, Tn>; | ||
export declare function mergeAndConcat<T extends Record<string | number | symbol, unknown>, Tn extends Record<string | number | symbol, unknown>[]>(object: T, ...otherObjects: Tn): Merge<T, Tn>; | ||
export declare function merge<T, Tn extends unknown[]>(object: T, ...otherObjects: Tn): Merge<T, Tn>; | ||
export declare function mergeAndCompare<T, Tn extends unknown[]>(compareFn: (prop1: any, prop2: any, propName: string | symbol) => any, object: T, ...otherObjects: Tn): Merge<T, Tn>; | ||
export declare function mergeAndConcat<T, Tn extends unknown[]>(object: T, ...otherObjects: Tn): Merge<T, Tn>; |
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