import { IdentityRule, RecompileRule } from './types'; /** * Rebuild the shader only when the prop crosses `value`, not on every change. * * Put it on a prop's `recompile:`. Pair it with an identity rule at the same value: the rule * decides whether the filter is skipped, and this is what lets that decision change. * * @example * ```ts * props: {shift: {default: 0, recompile: crosses(0)}}, * effect: hueRotate(p('shift')), * identityWhen: isZero('shift'), * ``` * @tip Without it a runtime prop never rebuilds, so a filter that started skipped stays skipped. * @see isZero, isValue, recompileWhen */ export declare function crosses(value: number): RecompileRule; /** * Rebuild when your own test of the old and new value says so, for a threshold `crosses` cannot express. * * @example * ```ts * blur: {default: 0, recompile: recompileWhen((prev, next) => (prev > 0) !== (next > 0))} * ``` * @see crosses */ export declare function recompileWhen(predicate: (prev: any, next: any) => boolean): RecompileRule; /** * Skip the filter entirely while `prop` is exactly 0. * * Put it on `identityWhen:`. An unset prop counts as its default. A prop that is mapped per * pixel by a driver disables the skip automatically, since the value then varies across the * canvas. Give the prop `recompile: crosses(0)` so the skip switches on and off. * * @example * ```ts * identityWhen: isZero('intensity') * ``` * @see isValue, allOf, crosses */ export declare function isZero(prop: string): IdentityRule; /** * Skip the filter entirely while `prop` equals `value`, for a filter whose no-op is not 0. * * An unset prop counts as its default; a per-pixel mapped prop disables the skip. Give the * prop `recompile: crosses(value)` so the skip switches on and off. * * @example * ```ts * props: {intensity: {default: 1, recompile: crosses(1)}}, * effect: saturate(p('intensity')), * identityWhen: isValue('intensity', 1), * ``` * @see isZero, allOf, crosses */ export declare function isValue(prop: string, value: unknown): IdentityRule; /** * Skip the filter only while every rule holds, for a no-op that needs several props at rest. * * @example * ```ts * identityWhen: allOf(isZero('brightness'), isZero('contrast')) * ``` * @see isZero, isValue */ export declare function allOf(...rules: IdentityRule[]): IdentityRule; /** * Skip the filter when your own test of the props' values says so. * * List in `props` every prop the test reads: a per-pixel mapped prop among them disables the * skip, and the engine needs the list to know which. * * @example * ```ts * identityWhen: identityWhenever(['amount', 'mode'], (v) => v.amount === 0 || v.mode === 'off') * ``` * @see isZero, isValue, allOf */ export declare function identityWhenever(props: string[], when: (values: Record) => boolean): IdentityRule; //# sourceMappingURL=slots.d.ts.map