import { ThreadGenerator } from '../threading'; import { InterpolationFunction, TimingFunction } from '../tweening'; import { DependencyContext } from './DependencyContext'; import { DEFAULT } from './symbols'; import { SignalExtensions, SignalGenerator, SignalGetter, SignalSetter, SignalTween, SignalValue } from './types'; export type SimpleSignal = Signal; export interface Signal> extends SignalSetter, SignalGetter, SignalTween { /** * {@inheritDoc SignalContext.reset} */ reset(): TOwner; /** * {@inheritDoc SignalContext.save} */ save(): TOwner; /** * {@inheritDoc SignalContext.isInitial} */ isInitial(): boolean; context: TContext; } export declare class SignalContext extends DependencyContext { private initial; private readonly interpolation; protected parser: (value: TSetterValue) => TValue; protected extensions: SignalExtensions; protected current: SignalValue | undefined; protected last: TValue | undefined; protected tweening: boolean; constructor(initial: SignalValue | undefined, interpolation: InterpolationFunction, owner?: TOwner, parser?: (value: TSetterValue) => TValue, extensions?: Partial>); toSignal(): Signal; parse(value: TSetterValue): TValue; set(value: SignalValue | typeof DEFAULT): TOwner; setter(value: SignalValue | typeof DEFAULT): TOwner; get(): TValue; getter(): TValue; protected invoke(value?: SignalValue | typeof DEFAULT, duration?: number, timingFunction?: TimingFunction, interpolationFunction?: InterpolationFunction): TValue | TOwner | SignalGenerator; protected createQueue(defaultTimingFunction: TimingFunction, defaultInterpolationFunction: InterpolationFunction): SignalGenerator; protected tween(value: SignalValue | typeof DEFAULT, duration: number, timingFunction: TimingFunction, interpolationFunction: InterpolationFunction): ThreadGenerator; tweener(value: SignalValue, duration: number, timingFunction: TimingFunction, interpolationFunction: InterpolationFunction): ThreadGenerator; dispose(): void; /** * Reset the signal to its initial value (if one has been set). * * @example * ```ts * const signal = createSignal(7); * * signal.reset(); * // same as: * signal(7); * ``` */ reset(): TOwner; /** * Compute the current value of the signal and immediately set it. * * @remarks * This method can be used to stop the signal from updating while keeping its * current value. * * @example * ```ts * signal.save(); * // same as: * signal(signal()); * ``` */ save(): TOwner; /** * Check if the signal is currently using its initial value. * * @example * ```ts * * const signal = createSignal(0); * signal.isInitial(); // true * * signal(5); * signal.isInitial(); // false * * signal(DEFAULT); * signal.isInitial(); // true * ``` */ isInitial(): boolean; /** * Get the initial value of this signal. */ getInitial(): SignalValue | undefined; /** * Get the raw value of this signal. * * @remarks * If the signal was provided with a factory function, the function itself * will be returned, without invoking it. * * This method can be used to create copies of signals. * * @example * ```ts * const a = createSignal(2); * const b = createSignal(() => a); * // b() == 2 * * const bClone = createSignal(b.raw()); * // bClone() == 2 * * a(4); * // b() == 4 * // bClone() == 4 * ``` */ raw(): SignalValue | undefined; /** * Is the signal undergoing a tween? */ isTweening(): boolean; } //# sourceMappingURL=SignalContext.d.ts.map