@player-ui/player
Version:
37 lines • 1.65 kB
TypeScript
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 { Parser } from "./parser";
import { TemplatePlugin } from "./plugins";
/** A stateful view instance from an content */
export declare class ViewInstance implements ValidationProvider {
hooks: {
onUpdate: SyncHook<[import("@player-ui/types").Asset<string> & {
validation?: Array<import("@player-ui/types").Validation.CrossfieldReference>;
}], Record<string, any>>;
parser: SyncHook<[Parser], Record<string, any>>;
resolver: SyncHook<[Resolver], Record<string, any>>;
onTemplatePluginCreated: SyncHook<[TemplatePlugin], Record<string, any>>;
templatePlugin: SyncHook<[TemplatePlugin], Record<string, any>>;
};
private resolver?;
readonly initialView: ViewType;
readonly resolverOptions: Resolve.ResolverOptions;
private rootNode?;
private validationProvider?;
private templatePlugin;
lastUpdate: Record<string, any> | undefined;
constructor(initialView: ViewType, resolverOptions: Resolve.ResolverOptions);
updateAsync(): void;
update(changes?: Set<BindingInstance>): any;
getValidationsForBinding(binding: BindingInstance): ValidationObject[] | undefined;
}
/** A plugin for a view */
export interface ViewPlugin {
/** Called with a view instance */
apply(view: ViewInstance): void;
}
//# sourceMappingURL=view.d.ts.map