UNPKG

@pilotlab/lux-attributes

Version:

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

34 lines (33 loc) 2.03 kB
import { INodes } from '@pilotlab/lux-nodes'; import { ProgressTracker } from '@pilotlab/lux-progress'; import { IPromise } from '@pilotlab/lux-result'; import { Signal } from '@pilotlab/lux-signals'; import IAttributeSetReturn from '../interfaces/iAttributeSetReturn'; import { MapList } from '@pilotlab/lux-collections'; import IAttributeChangeOptions from './iAttributeChangeOptions'; import IAttributeCreateOptions from './iAttributeCreateOptions'; import IAttribute from './iAttribute'; import IAttributeUpdateTracker from './iAttributeUpdateTracker'; import IAttributeFactory from './iAttributeFactory'; import AttributeEventArgs from '../attributeEventArgs'; import { DataType } from '../attributeEnums'; export interface IAttributes extends INodes { create: IAttributeFactory; copy: IAttributes; saveTriggered: Signal<AttributeEventArgs<any>>; getOrCreate(path: string, createOptions?: IAttributeCreateOptions, segmentCreateOptions?: IAttributeCreateOptions): IAttribute; get(path: string, value?: any, dataType?: DataType, label?: string, changeOptions?: IAttributeChangeOptions): IAttribute; getOnly(paths: string[]): IAttributes; getAll(index?: string, options?: any, filter?: (data: any) => boolean, sort?: (a: any, b: any) => number): IAttributes; set(path: string, value?: any, changeOptions?: IAttributeChangeOptions): IPromise<IAttributeSetReturn>; deleteByKey(key: string, changeOptions?: IAttributeChangeOptions): IAttribute; 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; internalChanged(args: AttributeEventArgs<IAttribute>): void; } export default IAttributes;