refactor: Convert protected methods to private (#2358)

This commit is contained in:
Dermot Duffy
2026-02-19 20:47:59 -08:00
committed by GitHub
parent 529500ed94
commit 0a67df9a25
122 changed files with 815 additions and 829 deletions
+15 -15
View File
@@ -17,21 +17,21 @@ type EmblaCarouselPlugins = CreatePluginType<LoosePluginType, Record<string, unk
export type CarouselDirection = 'vertical' | 'horizontal';
export class CarouselController {
protected _parent: HTMLElement;
protected _root: HTMLElement;
protected _direction: CarouselDirection;
protected _startIndex: number;
protected _transitionEffect: TransitionEffect;
protected _loop: boolean;
protected _dragFree: boolean;
protected _draggable: boolean;
protected _textDirection: TextDirection;
protected _wheelScrolling: boolean;
private _parent: HTMLElement;
private _root: HTMLElement;
private _direction: CarouselDirection;
private _startIndex: number;
private _transitionEffect: TransitionEffect;
private _loop: boolean;
private _dragFree: boolean;
private _draggable: boolean;
private _textDirection: TextDirection;
private _wheelScrolling: boolean;
protected _plugins: EmblaCarouselPlugins;
protected _carousel: EmblaCarouselType;
private _plugins: EmblaCarouselPlugins;
private _carousel: EmblaCarouselType;
protected _mutationObserver = new MutationObserver(
private _mutationObserver = new MutationObserver(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(_mutations: MutationRecord[], _observer: MutationObserver) =>
this._refreshCarouselContents(),
@@ -121,7 +121,7 @@ export class CarouselController {
}
}
protected _refreshCarouselContents = (): void => {
private _refreshCarouselContents = (): void => {
const slides = getChildrenFromElement(this._parent);
const slidesChanged = !isEqual(this._carousel.slideNodes(), slides);
if (slidesChanged) {
@@ -129,7 +129,7 @@ export class CarouselController {
}
};
protected _createCarousel(slides: HTMLElement[]): EmblaCarouselType {
private _createCarousel(slides: HTMLElement[]): EmblaCarouselType {
const carousel = EmblaCarousel(
this._root,
{
+1 -1
View File
@@ -8,7 +8,7 @@ type InitializationCallback = () => Promise<boolean>;
* applied to the usage of this class.
*/
export class Initializer {
protected _initialized: Set<string> = new Set();
private _initialized: Set<string> = new Set();
public async initializeMultipleIfNecessary(
aspects: Record<string, InitializationCallback>,
+2 -2
View File
@@ -1,6 +1,6 @@
export class Timer {
protected _timer: number | null = null;
protected _repeated = false;
private _timer: number | null = null;
private _repeated = false;
public stop(): void {
if (this._timer) {