import type { InterpolationFunction, TimingFunction } from '@revideo/core'; export interface PropertyMetadata { default?: T; interpolationFunction?: InterpolationFunction; parser?: (value: any) => T; getter?: () => T; setter?: (value: any) => void; tweener?: (value: T, duration: number, timingFunction: TimingFunction, interpolationFunction: InterpolationFunction) => void; cloneable?: boolean; inspectable?: boolean; compoundParent?: string; compound?: boolean; compoundEntries: [string, string][]; } export declare function getPropertyMeta(object: any, key: string | symbol): PropertyMetadata | null; export declare function getPropertyMetaOrCreate(object: any, key: string | symbol): PropertyMetadata; export declare function getPropertiesOf(value: any): Record>; export declare function initializeSignals(instance: any, props: Record): void; /** * Create a signal decorator. * * @remarks * This decorator turns the given property into a signal. * * The class using this decorator can implement the following methods: * - `get[PropertyName]` - A property getter. * - `get[PropertyName]` - A property setter. * - `tween[PropertyName]` - A tween provider. * * @example * ```ts * class Example { * \@property() * public declare length: Signal; * } * ``` */ export declare function signal(): PropertyDecorator; /** * Create an initial signal value decorator. * * @remarks * This decorator specifies the initial value of a property. * * Must be specified before the {@link signal} decorator. * * @example * ```ts * class Example { * \@initial(1) * \@property() * public declare length: Signal; * } * ``` * * @param value - The initial value of the property. */ export declare function initial(value: T): PropertyDecorator; /** * Create a signal interpolation function decorator. * * @remarks * This decorator specifies the interpolation function of a property. * The interpolation function is used when tweening between different values. * * Must be specified before the {@link signal} decorator. * * @example * ```ts * class Example { * \@interpolation(textLerp) * \@property() * public declare text: Signal; * } * ``` * * @param value - The interpolation function for the property. */ export declare function interpolation(value: InterpolationFunction): PropertyDecorator; /** * Create a signal parser decorator. * * @remarks * This decorator specifies the parser of a property. * Instead of returning the raw value, its passed as the first parameter to the * parser and the resulting value is returned. * * If the wrapper class has a method called `lerp` it will be set as the * default interpolation function for the property. * * Must be specified before the {@link signal} decorator. * * @example * ```ts * class Example { * \@wrapper(Vector2) * \@property() * public declare offset: Signal; * } * ``` * * @param value - The wrapper class for the property. */ export declare function parser(value: (value: any) => T): PropertyDecorator; /** * Create a signal wrapper decorator. * * @remarks * This is a shortcut decorator for setting both the {@link parser} and * {@link interpolation}. * * The interpolation function will be set only if the wrapper class has a method * called `lerp`, which will be used as said function. * * Must be specified before the {@link signal} decorator. * * @example * ```ts * class Example { * \@wrapper(Vector2) * \@property() * public declare offset: Signal; * * // same as: * \@parser(value => new Vector2(value)) * \@interpolation(Vector2.lerp) * \@property() * public declare offset: Signal; * } * ``` * * @param value - The wrapper class for the property. */ export declare function wrapper(value: (new (value: any) => T) & { lerp?: InterpolationFunction; }): PropertyDecorator; /** * Create a cloneable property decorator. * * @remarks * This decorator specifies whether the property should be copied over when * cloning the node. * * By default, any property is cloneable. * * Must be specified before the {@link signal} decorator. * * @example * ```ts * class Example { * \@clone(false) * \@property() * public declare length: Signal; * } * ``` * * @param value - Whether the property should be cloneable. */ export declare function cloneable(value?: boolean): PropertyDecorator; /** * Create an inspectable property decorator. * * @remarks * This decorator specifies whether the property should be visible in the * inspector. * * By default, any property is inspectable. * * Must be specified before the {@link signal} decorator. * * @example * ```ts * class Example { * \@inspectable(false) * \@property() * public declare hiddenLength: Signal; * } * ``` * * @param value - Whether the property should be inspectable. */ export declare function inspectable(value?: boolean): PropertyDecorator; //# sourceMappingURL=signal.d.ts.map