UNPKG

superfly-timeline

Version:

Resolver for defining objects with temporal boolean logic relationships on a timeline

59 lines 3.43 kB
import { ResolvedTimeline, ResolveOptions, Expression, ExpressionObj, InnerExpression, Time, TimelineState, Content, TimelineKeyframe, TimelineObject } from './api'; export * from './api'; export { ResolveError } from './resolver/lib/Error'; /** * Resolves a timeline, i.e. resolves the references between objects * and calculates the absolute times for all objects in the timeline. */ export declare function resolveTimeline<TContent extends Content = Content>(timeline: TimelineObject<TContent>[], options: ResolveOptions): ResolvedTimeline<TContent>; /** * Retrieve the state for a certain point in time. * The state contains all objects that are active at that point in time. * @param resolvedTimeline * @param time * @param eventLimit */ export declare function getResolvedState<TContent extends Content = Content>(resolvedTimeline: ResolvedTimeline<TContent>, time: Time, eventLimit?: number): TimelineState<TContent>; /** * Validates all objects in the timeline. Throws an error if something's wrong * @param timeline The timeline to validate * @param strict Set to true to enable some optional strict rules. Set this to true to increase future compatibility. */ export declare function validateTimeline(timeline: TimelineObject[], strict?: boolean): void; /** * Validates a Timeline-object. Throws an error if something's wrong * @param timeline The timeline to validate * @param strict Set to true to enable some optional strict rules. Set this to true to increase future compatibility. */ export declare function validateObject(obj: TimelineObject, strict?: boolean): void; /** * Validates a Timeline-keyframe. Throws an error if something's wrong * @param timeline The timeline to validate * @param strict Set to true to enable some optional strict rules. Set this to true to increase future compatibility. */ export declare function validateKeyframe(keyframe: TimelineKeyframe, strict?: boolean): void; /** * Validates a string that is used in Timeline as a reference (an id, a class or layer) * @param str The string to validate * @param strict Set to true to enable some optional strict rules. Set this to true to increase future compatibility. */ export declare function validateReferenceString(str: string, strict?: boolean): void; /** * Apply keyframe content onto its parent content. * The keyframe content is deeply-applied onto the parent content. * Note: This function mutates the parentContent. */ export declare function applyKeyframeContent(parentContent: Content, keyframeContent: Content): void; export declare function interpretExpression(expression: null): null; export declare function interpretExpression(expression: number): number; export declare function interpretExpression(expression: ExpressionObj): ExpressionObj; export declare function interpretExpression(expression: string | Expression): Expression; export declare function simplifyExpression(expr0: Expression): Expression; export declare function wrapInnerExpressions(words: Array<any>): InnerExpression; export declare function validateExpression(operatorList: string[], expr0: Expression, breadcrumbs?: string): true; /** * If you have called any of the manual expression-functions, such as interpretExpression(), * you could call this to manually clean up an internal cache, to ensure your application quits cleanly. */ export declare function onCloseCleanup(): void; //# sourceMappingURL=index.d.ts.map