Thank you. I encounter this in one of our legacy applications and I wanted to learn what that was for. In the first place, I've got a clue about what that is for but I just wanted to be sure and learn more about it.
@@covalence-io and how to extend them? For example, if I have an object and keys a,b,c,d (all a string etc.) from some package and I simply want to make a little change and make the b to be number etc. and leave other fields typed as they are typed from the package itself
@@salkohajric6176 you could try something like this and use type B in your code instead of A. Rewriting the value of A doesn't make sense since there is clearly a library using that value as a string. interface A { x: string } export type B = Omit & { x: number };
I'm really struggling with this concept: What if I want to create a type definition library for my own javascript components? I want to be able to share types between a number of different projects, so I just want to npm install ../types and have access to namespace.mytype globally without imports (es6).
Thank you. I encounter this in one of our legacy applications and I wanted to learn what that was for. In the first place, I've got a clue about what that is for but I just wanted to be sure and learn more about it.
That was actually very good content. Helped a lot.
Can you crate a video on how to change existing values or extend them
you should be able to change existing values the same way or just by redefining the interface. it should take the last definition that's been defined.
@@covalence-io and how to extend them? For example, if I have an object and keys a,b,c,d (all a string etc.) from some package and I simply want to make a little change and make the b to be number etc. and leave other fields typed as they are typed from the package itself
@@salkohajric6176 you could try something like this and use type B in your code instead of A. Rewriting the value of A doesn't make sense since there is clearly a library using that value as a string.
interface A {
x: string
}
export type B = Omit & { x: number };
I'm really struggling with this concept: What if I want to create a type definition library for my own javascript components? I want to be able to share types between a number of different projects, so I just want to npm install ../types and have access to namespace.mytype globally without imports (es6).
you could create your own npm package or add your types to a github repo and add the repo as a dependency to your package.json