sy-bind
Version:
A lightweight binding framework for Cocos Creator
61 lines (60 loc) • 3.22 kB
TypeScript
import { BindType, ListMethodType } from "../../../src/enums/SyEnums";
import { sy_pipe_types } from "../../../src/types/SyPipeTypes";
import { sy_types } from "../../../src/types/SyTypes";
import { ISyResult } from "../ISyResult";
import { SyContainer } from "../SyContainer";
import { ISyTreeNode } from "./Interfaces";
import { SyPipeTree } from "./SyTree/SyPipeTree";
type t_pipe = sy_pipe_types.t_pipe;
type t_pipe_leader = sy_pipe_types.t_pipe_leader;
type t_pipe_index = sy_pipe_types.t_pipe_index;
type t_pipe_head<T> = sy_pipe_types.t_pipe_head<T>;
type t_head_pipe = sy_pipe_types.t_head_pipe;
type t_pipes = sy_pipe_types.t_pipes;
type t_index_pipes = sy_pipe_types.t_index_pipes;
type bind_target = sy_types.bind_target;
type comm_property_name = sy_types.comm_property_name;
export declare class SyPipe {
private heads;
private pipes;
private readonly trees;
private listheadtrees;
private listpipes;
private listMutants;
private indexpipes;
private readonly listIndexNodes;
constructor();
private _getOrCreateHeads;
private _addToPipes;
private _removeFromPipes;
private _createTree;
private _getOrCreateListHeadTrees;
private _getOrCreatelistMutant;
private _addToIndexPipes;
private _removeFromIndexPipes;
private createPipe;
private intersection;
getOrCreateTree<T extends object>(head: t_pipe_leader): SyPipeTree<T>;
getRoot(pipe: t_pipe): ISyResult<ISyTreeNode>;
replaceNode<P extends object, C extends object>(pipe: t_pipe, parent: P, oldObj: C, newObj: C): void;
getOrCreateTreeNode<T extends object>(pipe: t_pipe, parentNode: ISyTreeNode, index: T, prop: comm_property_name): ISyResult<ISyTreeNode>;
getOrCreateIndexTreeNode<T extends object>(tree: SyPipeTree<any>, parentNode: ISyTreeNode, index: T, prop: comm_property_name): ISyResult<ISyTreeNode>;
getOrCreateHeadTree<T>(head: t_pipe_head<T>): SyPipeTree<t_pipe_head<T>> | undefined;
getOrCreatelistMutant<K>(headpipe: t_head_pipe): SyContainer<K>;
getOrCreateIndexNode(tree: SyPipeTree<any>, target: object, index: string): ISyTreeNode;
getIndexNode(tree: SyPipeTree<any>, index: string): ISyTreeNode | undefined;
private addOrCreateIndexNode;
getPipeline(entrance: object, direction: object): t_pipes | undefined;
getIndexPipeline(entrance: object, direction: object): t_pipes | undefined;
replaceIndexNode<P extends object, C extends object>(pipe: t_pipe, parent: P, oldObj: C, newObj: C): void;
getHeadpipe(head: t_pipe_head<any>): SyPipeTree<t_pipe_head<any>> | undefined;
getIndexPipes(index: t_pipe_index): t_index_pipes | undefined;
headTrigger<T extends object>(tree: SyPipeTree<any>, index: ListMethodType, oldValue: any, value: T): void;
listen(node: ISyTreeNode, prop: comm_property_name, fn: Function, triggerImmediately?: boolean, bindType?: BindType): ISyResult;
unListen<T extends object>(target: T, prop?: comm_property_name, bindType?: BindType): ISyResult;
trigger(target: bind_target, prop: comm_property_name, value: any): void;
private headPush;
private headPop;
private headChange;
}
export {};