UNPKG

2.58 kBTypeScriptView Raw
1import { ChangeDetectorRef } from '@angular/core';
2import { Dir } from '@angular/cdk/bidi';
3import * as i0 from "@angular/core";
4export declare class TdJsonFormatterComponent {
5 private _changeDetectorRef;
6 private _dir;
7 /**
8 * Max length for property names. Any names bigger than this get trunctated.
9 */
10 private static KEY_MAX_LENGTH;
11 /**
12 * Max length for preview string. Any names bigger than this get trunctated.
13 */
14 private static PREVIEW_STRING_MAX_LENGTH;
15 /**
16 * Max tooltip preview elements.
17 */
18 private static PREVIEW_LIMIT;
19 private _key?;
20 private _data;
21 private _children?;
22 private _open;
23 private _levelsOpen;
24 /**
25 * levelsOpen?: number
26 * Levels opened by default when JS object is formatted and rendered.
27 */
28 set levelsOpen(levelsOpen: number);
29 get levelsOpen(): number;
30 get open(): boolean;
31 /**
32 * key?: string
33 * Tag to be displayed next to formatted object.
34 */
35 set key(key: string);
36 get key(): string;
37 /**
38 * data: any
39 * JS object to be formatted.
40 */
41 set data(data: Record<string, any>);
42 get data(): Record<string, any>;
43 get children(): string[];
44 get isRTL(): boolean;
45 constructor(_changeDetectorRef: ChangeDetectorRef, _dir: Dir);
46 /**
47 * Refreshes json-formatter and rerenders [data]
48 */
49 refresh(): void;
50 /**
51 * Toggles collapse/expanded state of component.
52 */
53 toggle(): void;
54 isObject(): boolean;
55 isArray(): boolean;
56 hasChildren(): boolean;
57 /**
58 * Gets parsed value depending on value type.
59 */
60 getValue(value: any): string;
61 /**
62 * Gets type of object.
63 * returns 'null' if object is null and 'date' if value is object and can be parsed to a date.
64 */
65 getType(object: any): string;
66 /**
67 * Generates string representation depending if its an object or function.
68 * see: http://stackoverflow.com/a/332429
69 */
70 getObjectName(): string;
71 /**
72 * Creates preview of nodes children to render in tooltip depending if its an array or an object.
73 */
74 getPreview(): string;
75 private parseChildren;
76 static ɵfac: i0.ɵɵFactoryDeclaration<TdJsonFormatterComponent, [null, { optional: true; }]>;
77 static ɵcmp: i0.ɵɵComponentDeclaration<TdJsonFormatterComponent, "td-json-formatter", never, { "levelsOpen": { "alias": "levelsOpen"; "required": false; }; "key": { "alias": "key"; "required": false; }; "data": { "alias": "data"; "required": false; }; }, {}, never, never, false, never>;
78}