/** * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal */ import { ParamDefinition as PD } from './param-definition.js'; import { Mutable } from './type-helpers.js'; export interface ParamMapping { params(ctx: Ctx): PD.For; getTarget(ctx: Ctx): T; getValues(t: T, ctx: Ctx): S; update(s: S, ctx: Ctx): T; apply(t: T, ctx: Ctx): void | Promise; } export declare function ParamMapping(def: { params: ((ctx: Ctx) => PD.For) | PD.For; target(ctx: Ctx): T; }): (options: { values(t: T, ctx: Ctx): S; update(s: S, t: Mutable, ctx: Ctx): void; apply?(t: T, ctx: Ctx): void | Promise; }) => ParamMapping;