@casual-simulation/aux-common
Version:
Common library for AUX projects
33 lines • 1.41 kB
TypeScript
export declare function branchNamespace(mode: string, recordName: string | null, inst: string, branch: string): string;
/**
* Gets the namespace that should be used for watching devices connected to branches.
* @param branch The branch to watch.
*/
export declare function watchBranchNamespace(recordName: string | null, inst: string, branch: string): string;
export declare function branchFromNamespace(mode: string, namespace: string): {
recordName: string;
inst: string;
branch: string;
};
/**
* Gets the ID for an inst with the given origin.
* @param recordName The name of the record for the simulation.
* @param inst The name of the inst for the simulation.
*/
export declare function formatInstId(recordName: string | null, inst: string): string;
/**
* Parses the given inst ID into the record name and inst name.
* @param id The ID of the inst.
*/
export declare function parseInstId(id: string): {
recordName: string | null;
inst: string;
};
/**
* Normalizes the given isnt ID.
* Insts can belong to a record, so inst IDs have to formatted like: "{recordName}/{instName}""
* In previous versions, insts were only referenced by their name. This function is able to normalize those IDs so that they can be parsed correctly.
* @param id The ID that should be normalized.
*/
export declare function normalizeInstId(id: string): string;
//# sourceMappingURL=Utils.d.ts.map