UNPKG

ngx-diagrams

Version:

> Light Weight, Modular, Typed Diagram Engine for Angular

47 lines (46 loc) 1.96 kB
/** * Utility pathing and routing service */ import { MonoTypeOperatorFunction, Observable } from 'rxjs'; import { Coords } from '../interfaces/coords.interface'; import { Entries, HashMap } from './types'; export declare enum LOG_LEVEL { 'LOG' = 0, 'ERROR' = 1 } export declare let __DEV__: boolean; export declare let __LOG__: LOG_LEVEL; export declare function enableDiagramProdMode(): void; export declare function setLogLevel(level: LOG_LEVEL): void; export declare function isDev(): boolean; export declare function log(message: string, level?: LOG_LEVEL, ...args: any[]): void; /** * rxjs log operator * @internal */ export declare function withLog(message: string, level?: LOG_LEVEL, ...args: any): <T>(source: Observable<T>) => Observable<T>; /** * rxjs entity properties operator * @internal */ export declare function entityProperty<T>(destroyedNotifier: Observable<any>, replayBy?: number, logMessage?: string): MonoTypeOperatorFunction<T>; export declare type ID = string; /** * Generates a unique ID */ export declare function UID(): ID; export declare function isArray<T>(val: any): val is T[]; export declare function isString(val: any): val is string; export declare function isFunction(val: any): val is (...args: any) => any; export declare function isNil(v: any): boolean; export declare function coerceArray<T>(value: T | T[]): T[]; export declare function isEmptyArray<T>(arr: T[]): boolean; export declare function mapToArray<T>(map: HashMap<T>): T[]; export declare function mapToEntries<T>(map: HashMap<T>): Entries<T>; export declare function unique<T>(arr: T[]): T[]; export declare function arrayToMap<T>(arr: Array<{ id: ID; } & T>): HashMap<T>; export declare function generateLinePath(firstPoint: any, lastPoint: any): string; export declare function generateCurvePath(firstPoint: Coords, lastPoint: Coords, curvy?: number): string; export declare function generateDynamicPath(pathCoords: number[][]): any;