UNPKG

@pilotlab/lux-attributes

Version:

A luxurious user experience framework, developed by your friends at Pilot.

36 lines (35 loc) 2.29 kB
import { MapList } from '@pilotlab/lux-collections'; import { NodesBase } from '@pilotlab/lux-nodes'; import { ProgressTracker } from '@pilotlab/lux-progress'; import { IPromise } from '@pilotlab/lux-result'; import { Signal } from '@pilotlab/lux-signals'; import IAttribute from './interfaces/iAttribute'; import { DataType } from './attributeEnums'; import IAttributeChangeOptions from './interfaces/iAttributeChangeOptions'; import IAttributeCreateOptions from './interfaces/iAttributeCreateOptions'; import IAttributes from './interfaces/iAttributes'; import IAttributeUpdateTracker from './interfaces/iAttributeUpdateTracker'; import IAttributeFactory from './interfaces/iAttributeFactory'; import AttributeEventArgs from './attributeEventArgs'; import IAttributeSetReturn from './interfaces/iAttributeSetReturn'; export declare abstract class AttributesBase<TNode extends IAttribute, TNodes extends IAttributes> extends NodesBase<TNode> implements IAttributes { constructor(factory: IAttributeFactory, parent?: TNode, pathSegment?: string); readonly create: IAttributeFactory; protected p_factory: IAttributeFactory; readonly copy: TNodes; saveTriggered: Signal<AttributeEventArgs<any>>; getOrCreate(path: string, createOptions?: IAttributeCreateOptions, segmentCreateOptions?: IAttributeCreateOptions): TNode; get(path: string, value?: any, dataType?: DataType, label?: string, changeOptions?: IAttributeChangeOptions): TNode; getOnly(paths: string[]): TNodes; getAll(key?: string, options?: any, filter?: (data: any) => boolean, sort?: (a: any, b: any) => number): TNodes; set(path: string, value: any, changeOptions?: IAttributeChangeOptions): IPromise<IAttributeSetReturn>; deleteByKey(key: string, changeOptions?: IAttributeChangeOptions): TNode; interruptAll(): void; toMap(isIncludeDataTypes?: boolean): MapList<string, any>; toObject(isIncludeDataTypes?: boolean, isForceIncludeAll?: boolean): Object; toArray(): any[]; toJson(isIncludeDataTypes?: boolean): string; update(data: (IAttributes | Object | string), changeOptions?: IAttributeChangeOptions, progressTracker?: ProgressTracker): IAttributeUpdateTracker; updateTracked(updateTracker: IAttributeUpdateTracker): void; } export default AttributesBase;