circular type reference nonsense

to be more clear about the type definition I'm looking for here, it should accept: - [1, [1, 'test']] - [[1, [1, 'test']], [1, 'test']] - [[1, [1, 'test']], [[[1, [1, 'test']], [1, 'test']], 'test']] - [1, [[1, [[[1, [1, 'test']], [[1, [1, 'test']], 'test']], 'test']], 'test']] and so on basically it starts off with a base [...number[], [...number[], string]] but any of the ...number[]s can be replaced with the entire expression recursively
DAHDeno AI Helper9/26/2023
The error you're seeing is not related to circular dependencies, but rather to TypeScript's structural type system. In TypeScript, two types are considered identical if their structures (i.e., their properties and methods) are identical. In your code, you have an interface Foo that has a property bar of type Bar[]. Bar is an interface that has a property foo of type Foo. This creates a circular reference between Foo and Bar, because Foo refers to Bar and Bar refers back to Foo. When you remove the array from the bar property in Foo, TypeScript sees Foo and Bar as identical, because their structures are now the same: they both have a single property of the same type. This is why you're getting the error "Type alias 'Foo' circularly references itself." To fix this, you could make Foo and Bar distinct in some way. For example, you could add another property to one of them. This would make their structures different, and TypeScript would no longer consider them to be the same type. Please note that this explanation is based on the general principles of TypeScript's type system and not on the specific documentation provided.

Looking for more? Join the community!

Recommended Posts
Getting exports from an evaluated module with get_module_namespace always results in null valuesTrying to get module exports like the example [here](https://github.com/denoland/deno/pull/14026/fiIs there any way to define a signal inside a route component?Is there any way to define a signal inside a route component? I am trying to do it but an error raiDeno EmitHow come does `deno bundle` work a lot differently to Deno emit (https://deno.land/x/emit@0.28.0 )? `deno lsp` does not understand bare imports without prefixEven in minimal project, freshly created from a template, Deno marks imports as errors and doesn't uWhen I use crypto in this code, it returns 'Unknown cipher.'const secret ="**1111111111111111111**"; let encryptedText='test'; const decipher = crypto.cTroubleshooting deno.land downloadsI have docker containers, within a minikube cluster, that have trouble downloading https://deno.landRun remote Fresh application code locally.Is it possible to run a remotely hosted Fresh application? E.g. I'm attempting to do `deno run -A hmigrate from node to deno: p5js projectHi, I want to rewrite my p5js project built with nodejs in deno. Here is my code: https://github.coPeer dependencyCan I somehow mark a dependency as "peer"? So this dependency (which is known to shuffle typings bet'Spawn' multiple promises from the same moduleI'm trying to use Deno for scripted npcs in a game, the main issue that the npc has to await user acReturn results from execute_main_moduleI currently have this function to run some execute some js ``` pub async fn run(&self, path_to_Fresh Blog + Website Thingshttps://vuepress-theme-yuu.netlify.app/, what is the closest thing to that which can be run on Fresh