UNPKG

@kaaiot/services

Version:

Type definitions for KaaIoT platform REST API service communication

66 lines (65 loc) 2.25 kB
/// <reference types="react" /> import { ThunkAction } from 'redux-thunk'; export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; export declare type Without<T, K> = { [L in Exclude<keyof T, K>]: T[L]; }; export declare type ThunkActionDispatch<TActionCreator extends (...args: any[]) => ThunkAction<any, any, any>> = (...args: Parameters<TActionCreator>) => ReturnType<ReturnType<TActionCreator>>; export declare type RouterHandleIsActive = (path: string, indexOnly?: boolean, options?: { strict: boolean; }) => boolean; export interface RouterLocation { pathname: string; action: string; query: Record<string, string>; } export interface Router<T = any> { setRouteLeaveHook: (route: Route, callback: (nextRoute: Route) => void) => void; getCurrentLocation: () => RouterLocation; params: T; isActive: RouterHandleIsActive; push: (pathname: string) => void; } export interface Route { pathname: string; } export interface Location<QueryParams = any> { pathname: string; query?: QueryParams; search: string; } export interface WithRouter<Params, Query = any, Injected = any> { route: Route & Injected; location: Location<Query>; router: Router<Params>; params: Params; routeParams: Params; } interface RouterLinkPathObject { pathname: string; query?: Record<string, any>; state?: Record<string, any>; hash?: string; } export interface RouterLinkProps { to?: string | RouterLinkPathObject; } export declare type MuiStyleClasses<T extends string> = Partial<Record<T, string | React.CSSProperties>>; export declare const tuple: <T extends string[]>(...args: T) => T; export declare type Optionalize<T, Keys extends keyof T> = Omit<T, Keys> & { [P in Keys]?: T[P]; }; export declare type LodashSortDirection = 'asc' | 'desc'; export interface WithDimensions { containerHeight: number; containerWidth: number; } export interface Type<T> extends Function { new (...args: any[]): T; } export declare type JsonPrimitiveType = string | null | number | boolean; export declare type Nullable<T> = T | null; export declare type DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]>; } : T; export {};