Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
82 lines
2.0 KiB
TypeScript
82 lines
2.0 KiB
TypeScript
export = memize;
|
|
/**
|
|
* Memize options object.
|
|
*
|
|
* @typedef MemizeOptions
|
|
*
|
|
* @property {number} [maxSize] Maximum size of the cache.
|
|
*/
|
|
/**
|
|
* Internal cache entry.
|
|
*
|
|
* @typedef MemizeCacheNode
|
|
*
|
|
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
|
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
|
* @property {Array<*>} args Function arguments for cache
|
|
* entry.
|
|
* @property {*} val Function result.
|
|
*/
|
|
/**
|
|
* Properties of the enhanced function for controlling cache.
|
|
*
|
|
* @typedef MemizeMemoizedFunction
|
|
*
|
|
* @property {()=>void} clear Clear the cache.
|
|
*/
|
|
/**
|
|
* Accepts a function to be memoized, and returns a new memoized function, with
|
|
* optional options.
|
|
*
|
|
* @template {(...args: any[]) => any} F
|
|
*
|
|
* @param {F} fn Function to memoize.
|
|
* @param {MemizeOptions} [options] Options object.
|
|
*
|
|
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
|
|
*/
|
|
declare function memize<F extends (...args: any[]) => any>(fn: F, options?: MemizeOptions | undefined): ((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction;
|
|
declare namespace memize {
|
|
export { MemizeOptions, MemizeCacheNode, MemizeMemoizedFunction };
|
|
}
|
|
/**
|
|
* Memize options object.
|
|
*/
|
|
type MemizeOptions = {
|
|
/**
|
|
* Maximum size of the cache.
|
|
*/
|
|
maxSize?: number | undefined;
|
|
};
|
|
/**
|
|
* Properties of the enhanced function for controlling cache.
|
|
*/
|
|
type MemizeMemoizedFunction = {
|
|
/**
|
|
* Clear the cache.
|
|
*/
|
|
clear: () => void;
|
|
};
|
|
/**
|
|
* Internal cache entry.
|
|
*/
|
|
type MemizeCacheNode = {
|
|
/**
|
|
* Previous node.
|
|
*/
|
|
prev?: (MemizeCacheNode | undefined) | null;
|
|
/**
|
|
* Next node.
|
|
*/
|
|
next?: (MemizeCacheNode | undefined) | null;
|
|
/**
|
|
* Function arguments for cache
|
|
* entry.
|
|
*/
|
|
args: Array<any>;
|
|
/**
|
|
* Function result.
|
|
*/
|
|
val: any;
|
|
};
|