UNPKG

ngx-dynamic-hooks

Version:

Automatically insert live Angular components into a dynamic string of content (based on their selector or any pattern of your choice) and render the result in the DOM.

58 lines (57 loc) 2.21 kB
import { Logger } from './logger'; import { ParseOptions } from '../settings/options'; import * as i0 from "@angular/core"; /** * The object returned by the detailedStringify function in DeepComparer. * Contains the stringified value as well as the number of times the maximum stringify depth was reached. */ export interface DetailedStringifyResult { result: string | null; depthReachedCount: number; } /** * A service for comparing two variables by value instead of by reference */ export declare class DeepComparer { private logger; constructor(logger: Logger); /** * Tests if two objects are equal by value * * @param a - The first object * @param b - The second object * @param compareDepth - How many levels deep to compare * @param options - The current parseOptions */ isEqual(a: any, b: any, compareDepth?: number, options?: ParseOptions): boolean; /** * Like JSON.stringify, but stringifies additional datatypes that would have been * nulled otherwise. It also doesn't throw errors on cyclic property paths. * * If obj can't be stringified for whatever reason, returns null. * * @param obj - The object to stringify * @param depth - How many levels deep to stringify */ detailedStringify(obj: any, depth?: number): DetailedStringifyResult; /** * Travels on object and replaces cyclical references with null * * @param obj - The object to travel * @param stack - To keep track of already travelled objects * @param depth - How many levels deep to decycle * @param depthReached - An object to track the number of times the max depth was reached */ decycle(obj: any, stack: any[] | undefined, depth: number | undefined, depthReached: { count: number; }): any; /** * Returns true when all the properties of one object equal those of another object, otherwise false. * * @param a - The first object * @param b - The second object */ objEqualsProperties(a: any, b: any): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<DeepComparer, never>; static ɵprov: i0.ɵɵInjectableDeclaration<DeepComparer>; }