json - Is there a common (not any) type in typescript for [] and LinkedList/Dictionary -


We have to copy the object between a web worker and the main application. We have installed a system, where for each class Copied, we define an interface and then there is a class implementing interface.

This works because the added JSON can be copied to the interface and then the properties can be assigned. This interface is not important for implementing the class, but it is clean and probably will reduce the bug.

But we have a problem. We use class. So my class will be:

  Export class DocHeader {public format: DocumentFormat; Public Fonts: Archive. Linked list & lt; Fonts.FontAttributes & gt; Public style: collections.Dictionary & lt; String, styles. Style & gt;   

But JSON is an array and will be:

  Export Interface IDC header {format: DocumentFormat; Fonts: fonts FontAutimes []; Style: Genre. Style []; }   

I know that possibly "No, it is not possible." But I feel that it never hurts to ask. Is there some type (and none) like IEnumerable at least something that I can use in the interface which uses both?

You see JSON type is an associative array:

  Export Interface IDocHeader {format: DocumentFormat; Fonts: fonts FontAutimes []; Style: {[Style id: string]: styles. Style; }; }    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -