ng2-json-editor
Version:
Angular2 component for editing large json documents
29 lines (28 loc) • 1.29 kB
TypeScript
import { OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
import { Set } from 'immutable';
import { Subscription } from 'rxjs/Subscription';
import { AbstractSubscriberComponent } from '../abstract-subscriber';
import { DomUtilService, PathUtilService, KeysStoreService, JsonSchemaService } from '../shared/services';
import { JSONSchema } from '../shared/interfaces';
export declare class AddNestedFieldDropdownComponent extends AbstractSubscriberComponent implements OnChanges, OnDestroy {
keysStoreService: KeysStoreService;
jsonSchemaService: JsonSchemaService;
pathUtilService: PathUtilService;
domUtilService: DomUtilService;
schema: JSONSchema;
pathString: string;
isDisabled: boolean;
nestedKeysMap: {
[path: string]: Set<string>;
};
keysChangeSubscription: Subscription;
constructor(keysStoreService: KeysStoreService, jsonSchemaService: JsonSchemaService, pathUtilService: PathUtilService, domUtilService: DomUtilService);
ngOnChanges(changes: SimpleChanges): void;
/**
* Return keys that could be added for the given path.
*
* @return schema key - hidden keys - existing keys
*/
addableKeysForPath(path: string): Set<string>;
onFieldSelect(path: string, key: string): void;
}