superfly-timeline
Version:
Resolver for defining objects with temporal boolean logic relationships on a timeline
53 lines • 2.25 kB
TypeScript
import { Expression } from '../api/expression';
import { ResolvedTimelineObject, TimelineObjectInstance } from '../api/resolvedTimeline';
import { Reference } from '../api/types';
import { ResolvedTimelineHandler } from './ResolvedTimelineHandler';
import { InstanceHandler } from './InstanceHandler';
import { ValueWithReference } from './lib/reference';
import { OperatorFunction } from './lib/operator';
export type ObjectRefType = 'start' | 'end' | 'duration';
export declare class ReferenceHandler {
private resolvedTimeline;
private instance;
constructor(resolvedTimeline: ResolvedTimelineHandler, instance: InstanceHandler);
/**
* Look up a reference on the timeline
* Return values:
* TimelineObjectInstance[]: Instances on the timeline where the reference expression is true
* ValueWithReference: A singular value which can be combined arithmetically with Instances
* null: Means "something is invalid", an null-value will always return null when combined with other values
*
* @param obj
* @param expr
* @param context
*/
lookupExpression(obj: ResolvedTimelineObject, expr: Expression | null, context: ObjectRefType): LookupResult;
applyParentInstances(parentInstances: TimelineObjectInstance[] | null, value: TimelineObjectInstance[] | null | ValueWithReference): TimelineObjectInstance[] | null | ValueWithReference;
private operateApplyParentInstance;
/**
* Perform an action on 2 arrays. Behaves somewhat like the ".*"-operator in Matlab
* @param array0
* @param array1
* @param operate
*/
operateOnArrays(array0: ReferenceResult, array1: ReferenceResult, operate: OperatorFunction): ReferenceResult;
/**
* Look up the referenced objects (in the context of a duration-reference)
*/
private lookupReferencedObjsDuration;
/**
* Look up the referenced objects
*/
private lookupReferencedObjs;
/**
* Look up an ExpressionObj
*/
private lookupExpressionObj;
}
type LookupResult = {
result: ReferenceResult;
allReferences: Reference[];
};
type ReferenceResult = TimelineObjectInstance[] | ValueWithReference | null;
export {};
//# sourceMappingURL=ReferenceHandler.d.ts.map