import { Map, OrderedSet, Iterable } from 'immutable'; import { ReplaySubject } from 'rxjs/ReplaySubject'; import { Subject } from 'rxjs/Subject'; import { JSONSchema } from '../interfaces'; import { PathUtilService } from './path-util.service'; import { JsonSchemaService } from './json-schema.service'; import { AppGlobalsService } from './app-globals.service'; import { CompareKeysBySchemaService } from './compare-keys-by-schema.service'; export declare class KeysStoreService { private appGlobalsService; private pathUtilService; private jsonSchemaService; private compareKeysBySchemaService; private keys$Map; keysMap: { [path: string]: OrderedSet; }; onKeysChange: Subject<{ path: string; keys: OrderedSet; }>; constructor(appGlobalsService: AppGlobalsService, pathUtilService: PathUtilService, jsonSchemaService: JsonSchemaService, compareKeysBySchemaService: CompareKeysBySchemaService); forPath(path: string): ReplaySubject>; /** * Adds a key to the specified path. * * @param path path to add the key to * @param key key to be added * @param schema schema that belongs to path (schema.items for table-list) */ addKey(path: string, key: string, schema: JSONSchema, value?: any): string; deletePath(path: Array): void; /** * Sync keys in store for the given path or its parent, grand parent etc. if necessary * * @param path path to the (re)set field * @param json whole json */ syncKeysForPath(path: Array, json: Map): void; deleteKey(parentPath: string, key: string): void; /** * Swaps keys of given two indices in object list recursively */ swapListElementKeys(listPath: Array, index1: number, index2: number): void; buildKeysMap(json: Map, schema: JSONSchema): void; buildKeysMapRecursivelyForPath(mapOrList: Iterable, path: string | Array, schema?: JSONSchema): void; private buildKeysForTableList(path, list, schema); private buildkeysForObject(path, map, schema); /** * Filters keys, add alwaysShow fields and sorts by schema. */ private schemafy(keys, schema); private isNotHidden(key, schema); private isObjectOrArray(schema); private setKeys(path, keys); }