superfly-timeline
Version:
Resolver for defining objects with temporal boolean logic relationships on a timeline
25 lines • 1.59 kB
TypeScript
import { Time, InstanceBase, TimelineObjectInstance, InstanceId } from '../../api';
export declare function isInstanceId(str: string): str is InstanceId;
export declare function instanceIsActive(instance: InstanceBase, time: Time): boolean;
/**
* Returns the intersection of two instances.
* Example: for (10-20) and (15-30), the intersection is (15-20).
*/
export declare function getInstanceIntersection(a: InstanceBase, b: InstanceBase): null | InstanceBase;
/**
* Convenience function to splice an array of instances
* @param instances The array of instances to splice
* @param fcn Operator function.
* Is called for each instance in the array,
* and should return an instance (or an array of instances) to insert in place of the original instance,
* or undefined to remove the instance.
* (To leave the instance unchanged, return the original instance)
*/
export declare function spliceInstances<I extends InstanceBase>(instances: I[], fcn: (instance: I) => I[] | I | undefined): void;
export declare function baseInstances(instances: TimelineObjectInstance[]): InstanceBase[];
export declare function baseInstance(instance: TimelineObjectInstance): InstanceBase;
/** Returns a string hash that changes whenever any instance has changed in a significant way */
export declare function getInstancesHash(instances: TimelineObjectInstance[]): string;
/** Returns a string hash that changes whenever an instance has changed in a significant way */
export declare function getInstanceHash(instance: TimelineObjectInstance): string;
//# sourceMappingURL=instance.d.ts.map