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>
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
import * as ts from 'typescript';
|
|
/** Wraps an AST node. Can be used as a tree using `children` or a linked list using `next` and `skip`. */
|
|
export interface NodeWrap {
|
|
/** The real AST node. */
|
|
node: ts.Node;
|
|
/** The SyntaxKind of `node`. */
|
|
kind: ts.SyntaxKind;
|
|
/** All immediate children of `node` that would be visited by `ts.forEachChild(node, cb)`. */
|
|
children: NodeWrap[];
|
|
/** Link to the next NodeWrap, depth-first. */
|
|
next?: NodeWrap;
|
|
/** Link to the next NodeWrap skipping all children of the current node. */
|
|
skip?: NodeWrap;
|
|
/** Link to the parent NodeWrap */
|
|
parent?: NodeWrap;
|
|
}
|
|
export interface WrappedAst extends NodeWrap {
|
|
node: ts.SourceFile;
|
|
next: NodeWrap;
|
|
skip: undefined;
|
|
parent: undefined;
|
|
}
|
|
export interface ConvertedAst {
|
|
/** nodes wrapped in a data structure with useful links */
|
|
wrapped: WrappedAst;
|
|
/** depth-first array of all nodes excluding SourceFile */
|
|
flat: ReadonlyArray<ts.Node>;
|
|
}
|
|
/**
|
|
* Takes a `ts.SourceFile` and creates data structures that are easier (or more performant) to traverse.
|
|
* Note that there is only a performance gain if you can reuse these structures. It's not recommended for one-time AST walks.
|
|
*/
|
|
export declare function convertAst(sourceFile: ts.SourceFile): ConvertedAst;
|