tickethead-sdk
Version:
SDK for the Tickethead API
13 lines • 741 B
TypeScript
export type IUpdateProxy<T extends Record<string | symbol | number, unknown>, K extends keyof T> = T & {
updatedObject: Partial<Record<K, T[K]>>;
};
/**
* Wraps the object in a proxy, which allows you to see which updates were made since the proxies creation.
* This can be useful so only updated fields are sent in patch requests, for example.
* Updated fields are present in the `updatedObject` field.
*
* @param trackedObject an object whose changes will be tracked
* @returns proxied object which tracks changes made through it
*/
export declare function attachUpdateProxy<T extends Record<string | symbol | number, unknown>, K extends keyof T>(trackedObject: T): IUpdateProxy<T, K>;
//# sourceMappingURL=update-proxy.d.ts.map