import { SyncHook } from "tapable-ts"; import type { View as ViewType } from "@player-ui/types"; import type { BindingInstance } from "../binding"; import type { ValidationProvider, ValidationObject } from "../validator"; import type { Resolve } from "./resolver"; import { Resolver } from "./resolver"; import type { Node } from "./parser"; import { Parser } from "./parser"; import { TemplatePlugin } from "./plugins"; export type ViewHooks = { /** Hook every time there is an update to this view instance */ onUpdate: SyncHook<[ViewType]>; /** Hook to retrieve the parser used for this view */ parser: SyncHook<[Parser]>; /** Hook to retrieve the resolver used for this view */ resolver: SyncHook<[Resolver]>; /** Hook to retrieve the template plugin used for this view */ templatePlugin: SyncHook<[TemplatePlugin]>; }; /** A stateful view instance from an content */ export declare class ViewInstance implements ValidationProvider { hooks: ViewHooks; private resolver?; readonly initialView: ViewType; readonly resolverOptions: Resolve.ResolverOptions; private rootNode?; private validationProvider?; private templatePlugin; lastUpdate: Record | undefined; constructor(initialView: ViewType, resolverOptions: Resolve.ResolverOptions); /** @deprecated use ViewController.updateViewAST */ updateAsync(asyncNode: string): void; update(changes?: Set, nodeChanges?: Set): any; getValidationsForBinding(binding: BindingInstance): Array | undefined; setTemplatePlugin(plugin: TemplatePlugin): void; } /** A plugin for a view */ export interface ViewPlugin { /** Called with a view instance */ apply(view: ViewInstance): void; } //# sourceMappingURL=view.d.ts.map