Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/utils / src / typings.ts
Size: Mime:
export interface AnyObj {
  [key: string]: any
  [key: number]: any
}

export type Overwrite<T1, T2> = { [P in Exclude<keyof T1, keyof T2>]: T1[P] } &
  T1

export type Zip<List = any[], Values = {}> = {
  //
  [P in keyof List]: Values[P]
}

export type _Without<Obj, ListToRemove> = {
  [P in Exclude<keyof Obj, keyof ListToRemove>]: Obj[P]
}

// type Without<Obj, List> = _Without<Obj, Zip<Obj, List>>
export type Without<Obj, List> = _Without<Obj, Zip<List, Obj>>

export interface OmitFunction<Obj = AnyObj> {
  (obj: Obj, omitKeys: Array<string>): Obj
  <T>(obj: Obj, omitKeys: Array<string>): T
  (obj: Obj, omitKeys: Obj): Obj
  <T>(obj: Obj, omitKeys: Obj): T
}

export type Dictionary<Type> = { [key in keyof Type]: any }

// ArrayKeyof
export type ArrayAsEnum<Type extends string[]> = {
  [Index in
    | Type[0]
    | Type[1]
    | Type[2]
    | Type[3]
    | Type[3]
    | Type[4]
    | Type[5]
    | Type[6]
    | Type[7]
    | Type[8]
    | Type[9]
    | Type[10]
    | Type[11]]: any
}