codeant-ai-for-open-source[bot] commented on PR #37923:
URL: https://github.com/apache/superset/pull/37923#issuecomment-3888451488
## **Sequence Diagram**
The PR explicitly types a dayjs instance factory that includes runtime-added
plugin methods. It shows importing dayjs and plugins, extending dayjs with
those plugins, creating typed interfaces (ExtendedDayjs /
ExtendedDayjsFactory), exporting the typed factory, and how a consumer can call
plugin methods without TypeScript errors.
```mermaid
sequenceDiagram
participant Module as dates.ts
participant Dayjs as dayjs lib
participant Plugins as plugins (utc,tz,duration,...)
participant Consumer
Module->>Dayjs: import dayjs
Module->>Plugins: import plugins
Module->>Dayjs: dayjs.extend(plugins) // load plugin behavior at runtime
Module->>Module: define ExtendedDayjs & ExtendedDayjsFactory types
(include plugin APIs)
Module-->>Consumer: export extendedDayjs typed as ExtendedDayjsFactory
Consumer->>Module: call extendedDayjs.utc(...) / .tz(...) /
.duration(...)
Module->>Dayjs: runtime methods dispatched to dayjs (plugins handle
behavior)
Dayjs-->>Consumer: returns ExtendedDayjs / Duration (typed correctly)
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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]