@player-ui/player
Version:
26 lines • 1.15 kB
TypeScript
import type { SyncWaterfallHook } from "tapable-ts";
import type { PathNode, AnyNode } from "../binding-grammar";
export interface NormalizedResult {
/** The normalized path */
path: Array<string | number>;
/** Any new updates that need to happen for this binding to be resolved */
updates?: Record<string, any>;
}
export interface ResolveBindingASTOptions {
/** Get the value of the model at the given path */
getValue: (path: Array<string | number>) => any;
/** Convert the value into valid path segments */
convertToPath: (value: any) => string;
/** Convert the value into valid path segments */
evaluate: (exp: string) => any;
}
export interface ResolveBindingASTHooks {
/** A hook for transforming a node before fully resolving it */
beforeResolveNode: SyncWaterfallHook<[
AnyNode,
Required<NormalizedResult> & ResolveBindingASTOptions
]>;
}
/** Given a binding AST, resolve it */
export declare function resolveBindingAST(bindingPathNode: PathNode, options: ResolveBindingASTOptions, hooks?: ResolveBindingASTHooks): NormalizedResult;
//# sourceMappingURL=resolver.d.ts.map