@statezero/core
Version:
The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate
32 lines (31 loc) • 1.13 kB
TypeScript
/**
* Register a callback to be notified when a temp pk is resolved to a real pk
* @param {Function} callback - Called with (tempPk, realPk) when resolved
* @returns {Function} - Unsubscribe function
*/
export function onTempPkResolved(callback: Function): Function;
/**
* Check if a string contains a temporary PK template
* @param {string} str - The string to check
* @returns {boolean} - True if the string contains a TempPK tag
*/
export function containsTempPk(str: string): boolean;
/**
* Create a temporary PK with handlebars syntax
*/
export function createTempPk(uuid: any): string;
/**
* Register a real PK for a temporary PK
*/
export function setRealPk(uuid: any, realPk: any): void;
/**
* Get the real PK for a temp PK if it exists in the registry
* @param {any} pk - The pk to resolve (may be temp or real)
* @returns {any} - The real pk if found, otherwise the original pk
*/
export function resolveToRealPk(pk: any): any;
/**
* Replace all temporary PKs in an object (or string) with their real values
*/
export function replaceTempPks(payload: any): any;
export const tempPkMap: Map<any, any>;