/// /// /** Defines a Rojo-esque tree type which defines an abstract object tree. */ export interface InstanceTree { $className?: keyof Instances; [Key: string]: keyof Instances | undefined | InstanceTree; } declare type MoreSpecificType = U extends D ? U : D extends U ? D : U & D; declare type AllKeys = T extends any ? keyof T : never; /** Evaluates a Rojo-esque tree and transforms it into an indexable type. */ export declare type EvaluateInstanceTree = (T extends { $className: keyof Instances; } ? Instances[T["$className"]] : D) extends infer U ? MoreSpecificType & { [K in Exclude>>]: T[K] extends keyof Instances ? Instances[T[K]] : EvaluateInstanceTree; } : never; /** Returns whether a given Instance matches a particular Rojo-esque InstanceTree. * @param object The object which needs validation * @param tree The tree to validate * @param violators */ export declare function validateTree(object: I, tree: T, violators?: Array): object is EvaluateInstanceTree; /** Promises a given tree of objects exists within an object. * @param tree Must be an object tree similar to ones considered valid by Rojo. * Every tree must have a `$className` member, and can have any number of keys which represent * the name of a child instance, which should have a corresponding value which is this same kind of tree. * There is also a shorthand syntax available, where setting a key equal to a className is equivalent * to an object with `$className` defined. Hence `Things: "Folder"` is equivalent to `Things: { $className: "Folder" }` */ export declare function promiseTree(object: I, tree: T): Promise>; export {};