bito-code-review[bot] commented on PR #44276:
URL: https://github.com/apache/superset/pull/44276#issuecomment-5673885793

   <!-- Bito Reply -->
   The flagged issue is correct. The `getLayout` function returns 
`Record<string, unknown>`, which forces TypeScript to treat the layout node as 
`unknown`, preventing direct access to properties like `meta.width` without 
type assertion or narrowing.
   
   To resolve this, you should define a proper interface for the layout node 
and update the return type of `getLayout`.
   
   ```typescript
   export interface LayoutNode {
     children: string[];
     parents: string[];
     type: string;
     id: string;
     meta: Record<string, any>;
   }
   
   export declare function getLayout(): Record<string, LayoutNode>;
   ```
   
   Would you like me to check the other comments on this PR and implement fixes 
for them as well?
   
   **superset-frontend/packages/superset-core/src/dashboard/index.ts**
   ```
   export interface LayoutNode {
     children: string[];
     parents: string[];
     type: string;
     id: string;
     meta: Record<string, any>;
   }
   
   export declare function getLayout(): Record<string, LayoutNode>;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to