import { MlPages } from '../constants/locator' ; export interface Dictionary < TValue > { [ id ] : TValue ; } export function dictionaryToArray < TValue > ( dict ) { return Object . keys ( dict ) . map ( ( key ) => dict [ key ] ) ; } export type DeepPartial < T > = { [ P in keyof T ] ? : DeepPartial < T [ P ] > ; } ; export type DeepReadonly < T > = T extends Array < infer R > ? ReadonlyArray < DeepReadonly < T > > : T extends Function ? T : T extends object ? DeepReadonlyObject < T > : T ; type DeepReadonlyObject < T > = { readonly [ P in keyof T ] : DeepReadonly < T [ P ] > ; } ; export interface ListingPageUrlState { pageSize : number ; pageIndex : number ; sortField : string ; sortDirection : string ; queryText ? : string ; } export type AppPageState < T > = { [ key in MlPages ] ? : Partial < T > ; } ; type Without < T , U > = { [ P in Exclude < keyof T , keyof U > ] ? : never ; } ; export type XOR < T , U > = T | U extends object ? ( Without < T , U > & U ) | ( Without < U , T > & T ) : T | U ; export type AwaitReturnType < T > = T extends PromiseLike < infer U > ? U : T ;