Skip to content

Commit

Permalink
fix: improve typing
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Aug 20, 2021
1 parent 3faa10d commit b0fb310
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/types/components/controller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface ControllerMethods {
* Pass here another Swiper instance or array with Swiper instances that should be controlled
* by this Swiper
*/
control?: Swiper;
control?: Swiper | Swiper[];
}

export interface ControllerEvents {}
Expand Down
1 change: 1 addition & 0 deletions src/types/components/virtual.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export interface VirtualMethods {
enabled?: boolean;
/**
* Object with cached slides HTML elements
*/
Expand Down
21 changes: 20 additions & 1 deletion src/types/swiper-class.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@ interface Swiper extends SwiperClass<SwiperEvents> {
*/
wrapperEl: HTMLElement;

/**
* Object with original initialization parameters
*/
originalParams: SwiperOptions;

/**
* Dom7 array-like collection of slides HTML elements. To get specific slide HTMLElement use `swiper.slides[1]`
*/
slides: Dom7Array;

/**
* !INTERNAL
*/
loopedSlides: number | null;

/**
* Width of container
*/
Expand Down Expand Up @@ -300,10 +310,19 @@ interface Swiper extends SwiperClass<SwiperEvents> {
*/
attachEvents(): void;

/**
* !INTERNAL
*/
loopDestroy(): void;
/**
* !INTERNAL
*/
loopCreate(): void;

/**
* Initialize slider
*/
init(): void;
init(el?: HTMLElement): Swiper;

/**
* Destroy slider instance and detach all events listeners
Expand Down
4 changes: 2 additions & 2 deletions src/types/swiper-events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ export interface SwiperEvents {
/**
* !INTERNAL: Event will fired after setting CSS classes on swiper slide element
*/
_slideClass?: (swiper: Swiper, el: HTMLElement, classNames: string) => void;
_slideClass?: (swiper: Swiper, slideEl: HTMLElement, classNames: string) => void;

/**
* !INTERNAL: Event will fired after setting CSS classes on all swiper slides
*/
_slideClasses?: (
swiper: Swiper,
slides: { el: HTMLElement; classNames: string; index: number }[],
slides: { slideEl: HTMLElement; classNames: string; index: number }[],
) => void;

/**
Expand Down

0 comments on commit b0fb310

Please sign in to comment.