Answer the question
In order to leave comments, you need to log in
How to extend the types of an installed library?
Good afternoon.
I use swiper. Delivered for it @types/swiper
However, as I understood types are described not all. Specifically, I get this error.
I tried to override interface AutoplayOptions like this
interface AutoplayOptions {
delay: number;
enable: boolean;
}
Answer the question
In order to leave comments, you need to log in
you need a Declaration Merge, you can google it as an example:
declare module 'swiper' {
interface AutoplayOptions {
// тут новые свойства, которыми нужно расширить библиотечный интерфейс
}
}
However, as I understand, not all types are described. Specifically, I get this error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question