import { BehaviorByID, EntityPropOverride, Import, NodeByID, ParsedImport, Props, ZComponentData } from './data/core'; import * as Data from './data'; import { ZValues } from './values/values'; /** * Parses an import string into a tuple containing the import path and import name. * * @param i - The import string to parse. * @returns A tuple where the first element is the import path and the second element is the import name. */ export declare function parseImport(i: Import): ParsedImport; /** * Constructs an import string from given parameters. * * @param from - The source file path. * @param destFile - The destination file path. * @param imp - The import name. * @returns A string representing the constructed import. */ export declare function constructImport(from: string, destFile: string, imp: string): string; /** * Generates a script name from a given string, ensuring uniqueness within a specified context. * * @param n - The input string to generate the script name from. * @param requireUniqueIn - The context (array or object) in which the generated name should be unique. * @returns A string representing the generated script name. */ export declare function getScriptName(n: string, requireUniqueIn: string[] | { [k: string]: any; }): string; /** * Generates a script name for a behavior label, ensuring uniqueness within the context of a ZComponent's nodes. * * @param zcomp - The ZComponent data. * @param nodeID - The node ID associated with the behavior. * @param label - The behavior label. * @returns A string representing the generated script name for the behavior. */ export declare function getScriptNameForBehaviorLabel(zcomp: ZComponentData, nodeID: string, label: string): string; /** * Generates a script name for a node label, ensuring uniqueness within the context of a ZComponent's nodes. * * @param zcomp - The ZComponent data. * @param label - The node label. * @returns A string representing the generated script name for the node. */ export declare function getScriptNameForNodeLabel(zcomp: ZComponentData, label: string): string; /** * Checks if a given string is a valid variable name. * * @param n - The string to check. * @returns True if the string is a valid variable name, otherwise false. */ export declare function isValidVariableName(n: string): boolean; /** * Generates a variable name from an import statement. * * @param imp - The parsed import statement. * @returns A string representing the generated variable name. */ export declare function variableNameFromImport(imp: ParsedImport): string; /** * Organizes entity property overrides by entity ID and property name. * * @param entityPropOverrides - An object containing entity property overrides. * @returns An object organized by entity ID and property name, containing the overrides. */ export type EntityPropOverrideByEntityPropPath = { [entityID: string]: { [propName: string]: { [path: string]: EntityPropOverride; }; }; }; /** * Generates a summary description for the destination of an entity property override. * * @param o - The entity property override object. * @returns A string representing the summary description of the override's destination. */ export declare function entityPropOverrideByEntityAndProp(entityPropOverrides: { [id: string]: EntityPropOverride; }): EntityPropOverrideByEntityPropPath; /** * Generates a summary description for the destination of an entity property override. * * @param o - The entity property override object. * @returns A string representing the summary description of the override's destination. */ export declare function summaryForEntityPropOverrideDestination(o: EntityPropOverride): string; /** * Generates a TypeScript type definition for a ZComponent. * * This function creates a type definition script for a ZComponent based on its nodes, properties, constructor properties, script names, layers, and behaviors. * * @param nodes - The nodes of the ZComponent. * @param props - The properties of the ZComponent. * @param constructorProps - The constructor properties of the ZComponent. * @param scriptNames - The script names for the nodes and behaviors. * @param layers - The layers of the ZComponent's animation. * @param behaviors - The behaviors of the ZComponent. * @returns A string containing the TypeScript type definition for the ZComponent. */ export declare const typeDefinitionForComponent: (nodes: NodeByID, props: Props, constructorProps: Props | undefined, scriptNames: { [id: string]: { [id: string]: boolean; }; } | undefined, layers: Data.ByID, behaviors: BehaviorByID, group: string | undefined, tags: string[] | undefined, icon: string | undefined, comments?: string[] | undefined, parents?: string[] | undefined) => string; /** * Sanitizes a key name to ensure it is safe for use in scripting. * * @param n - The original key name. * @returns A sanitized, script-safe key name. */ export declare function getSafeKeyName(n: string): string; /** * Extracts and groups property tracks by their associated entity ID from a given clip. * * @param clip - The clip containing property tracks. * @returns An object mapping entity IDs to their respective property tracks. */ export declare function propertyTracksByEntityID(clip: Data.Clip): { [id: string]: Data.PropertyTrack[]; }; export declare function clipNamesForEntitiesByProp(animation: Data.Animation, entityIDs: Set): { [propName: string]: Set; }; export declare function entitiesWithAnimation(animation: Data.Animation): { [id: string]: Set; }; /** * Generates a behavior block for a node, based on the behaviors and their IDs. * * @param behaviors - An object containing behavior data. * @param behaviorIDs - An array of behavior IDs. * @param importMapping - A map of behavior types to their import names. * @returns A string representing the behavior block for the node. */ export declare function getBehaviorBlockForNode(behaviors: BehaviorByID, behaviorIDs: string[], importMapping: Map): string; /** * Removes the file extension from an import name, if it ends with '.ts'. * * @param imp - The import name to process. * @returns The import name without the '.ts' extension. */ export declare function importNameWithoutExt(imp: string): string; /** * Generates a TypeScript type definition for ZValues. * * This function creates a type definition script for ZValues based on the values and their associated URL. * * @param values - The ZValues instance. * @param url - The URL associated with the values. * @returns A string containing the TypeScript type definition for ZValues. */ export declare const typeDefinitionForZValues: (values: ZValues, url: string) => string;