UNPKG

reblendjs

Version:

ReblendJs uses Reactjs pradigm to build UI components, with isolated state for each components.

155 lines (154 loc) 6.57 kB
import * as ReblendTyping from 'reblend-typing'; import { type BaseComponent } from './BaseComponent'; export declare enum ReblendNodeTypeDict { ReblendNode = "ReblendNode", ReblendVNode = "ReblendVNode", ReblendLazyNode = "ReblendLazyNode", ReblendLazyVNode = "ReblendLazyVNode", ReactToReblendNode = "ReactToReblendNode", ReactToReblendVNode = "ReactToReblendVNode", ReblendNodeStandard = "ReblendNodeStandard", ReblendVNodeStandard = "ReblendVNodeStandard" } export declare function addSymbol(type: ReblendNodeTypeDict, obj: object): any; /** * Checks if the given element has a name other than 'BaseComponent'. * * @param {typeof BaseComponent} element - The element to check. * @returns {boolean} `true` if the element has a name and it is not 'BaseComponent', otherwise `false`. */ export declare function hasName(element: typeof BaseComponent): boolean; /** * Checks if the provided node is a rendered Reblend node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a rendered Reblend node, otherwise `false`. */ export declare function isReblendRenderedNode(node: any): boolean; /** * Checks if the provided node is a virtual Reblend node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a virtual Reblend node, otherwise `false`. */ export declare function isReblendVirtualNode(node: any): boolean; /** * Checks if the provided node is a rendered Reblend lazy node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a rendered Reblend lazy node, otherwise `false`. */ export declare function isReblendRenderedLazyNode(node: any): boolean; /** * Checks if the provided node is a virtual Reblend lazy node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a virtual Reblend lazy node, otherwise `false`. */ export declare function isReblendLazyVirtualNode(node: any): boolean; /** * Checks if the provided node is a standard rendered Reblend node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a standard rendered Reblend node, otherwise `false`. */ export declare function isReblendRenderedNodeStandard(node: any): boolean; /** * Checks if the provided node is a standard virtual Reblend node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a standard virtual Reblend node, otherwise `false`. */ export declare function isReblendVirtualNodeStandard(node: any): boolean; /** * Checks if the provided node is a React to Reblend rendered node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a React to Reblend rendered node, otherwise `false`. */ export declare function isReactToReblendRenderedNode(node: any): boolean; /** * Checks if the provided node is a React to Reblend virtual node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a React to Reblend virtual node, otherwise `false`. */ export declare function isReactToReblendVirtualNode(node: any): boolean; /** * Checks if the provided node is a standard virtual node. * * @param {any} node - The node to check. * @returns {boolean} `true` if the node is a standard virtual node, otherwise `false`. */ export declare function isStandardVirtualNode(node: any): boolean; /** * Checks if the provided element is a Reblend primitive element. * * @param {any} element - The element to check. * @returns {boolean} `true` if the element is a Reblend primitive element, otherwise `false`. */ export declare function isReblendPrimitiveElement(element: any): boolean; /** * Checks if the provided data is a primitive type. * Primitive types include string, number, boolean, bigint, null, undefined, and symbol. * * @param {any} data - The data to check. * @returns {boolean} `true` if the data is a primitive, otherwise `false`. */ export declare function isPrimitive(data: any): boolean; /** * Checks if the given object is an array-like structure by verifying that it contains array-specific methods and properties. * * @param {unknown} obj - The object to check. * @returns {boolean} `true` if the object is an array-like structure, otherwise `false`. */ export declare function isArray(obj: unknown): boolean; /** * Checks if the provided display name represents a React node. * * @param {ReblendTyping.IAny} displayName - The display name to check. * @returns {boolean} `true` if the display name represents a React node, otherwise `false`. */ export declare function isReactNode(displayName: ReblendTyping.IAny): boolean; /** * Checks if the provided display name represents a Lazy node. * * @param {ReblendTyping.IAny} displayName - The display name to check. * @returns {boolean} `true` if the display name represents a Promise Instance, otherwise `false`. */ export declare function isLazyNode(displayName: ReblendTyping.IAny): boolean; /** * Checks if a node is a standard HTML element or a Reblend primitive element. * * @param {ReblendTyping.Component | HTMLElement} node - The node to check. * @returns {boolean} - True if the node is standard or a Reblend primitive element, false otherwise. */ export declare function isStandard<P, S>(node: ReblendTyping.Component<P, S> | HTMLElement): boolean; /** * Checks if a node is a Reblend HTML element or a Reblend React HTML element. * * @param {ReblendTyping.Component | HTMLElement} node - The node to check. * @returns {boolean} - True if the node is Reblend or a Reblend React element, false otherwise. */ export declare function isNonStandard<P, S>(node: ReblendTyping.Component<P, S> | HTMLElement): boolean; /** * Determines if a given node is a text node. * * @param {Node} node - The node to check. * @returns {boolean} - True if the node is a text node, otherwise false. */ export declare function isTextNode(node: Node): node is Text; /** * Checks whether the given data is empty (undefined or null). * * @param {*} data - The data to check. * @returns {boolean} - True if the data is empty, otherwise false. */ export declare function isEmpty(data: any): boolean; /** * Extends the prototype of the target object with the provided prototype, skipping constructors and existing functions. * * @param {any} target - The target object to extend. * @param {any} prototype - The prototype object to copy properties and methods from. */ export declare function extendPrototype(target: any, prototype: any): void;