Cross Dependency in TypeScript

Hello,
I’m a newbie in TypeScript of Cocos Creator and I need help.
Currently, I have some cross dependency in my project, similar to this topick: How to resolve circular dependency in editor cocos creator?
But it’s in JavaScript.

How can I import refToA using require(‘A-script’) in TS?
Please help me to write this statement code in TS:
properties: () => ({
refToA: require(‘A-script’)
})

Thank you!

2 Likes

TS does not support deferred initialization. Please refactor the structure to avoid circular dependency.

Thanks for your anwser!
I will try to refactor my code to avoid that one.