Skip to content

Commit 3068395

Browse files
committed
feat: Controller 플러그인 타입스크립트 적용
1 parent b080537 commit 3068395

File tree

7 files changed

+284
-214
lines changed

7 files changed

+284
-214
lines changed

jest.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
2-
preset: 'ts-jest',
3-
testEnvironment: 'node',
2+
preset: 'ts-jest/presets/js-with-babel',
43
moduleDirectories: ['node_modules', 'src'],
54
moduleNameMapper: {
65
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':

src/base/ui-plugin/UIPlugin.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ export default abstract class UIPlugin extends UIObject<'div'> {
2424
/**
2525
* 모든 UI 플러그인은 내부에서 core를 갖는다.
2626
*/
27-
get core(): Core {
27+
public get core(): Core {
2828
return this._core;
2929
}
3030

3131
/**
3232
* core를 통해서 video에 접근할 수 있다.
3333
*/
34-
get video(): Video {
34+
public get video(): Video {
3535
return this._core.video;
3636
}
3737

3838
/**
3939
* 플러그인 활성화 여부
4040
*/
41-
get enabled(): boolean {
41+
public get enabled(): boolean {
4242
return this._enabled;
4343
}
4444

@@ -56,13 +56,13 @@ export default abstract class UIPlugin extends UIObject<'div'> {
5656
* Core에 이벤트 리스너를 등록한다.
5757
* NOTE: disable/enable을 제대로 작동시키기 위해서 반드시 this.listenTo 메소드를 이용해 이벤트 리스너를 등록해야한다.
5858
*/
59-
abstract addEventListeners(): void;
59+
protected abstract addEventListeners(): void;
6060

6161
/**
6262
* 플러그인을 작동시킨다.
6363
* 이 함수는 disable 이후에 다시 플러그인을 작동시킬 때만 사용해야 한다.
6464
*/
65-
enable(): void {
65+
public enable(): void {
6666
if (this._enabled) return;
6767
this.addEventListeners();
6868
showElement(this.el);
@@ -72,7 +72,7 @@ export default abstract class UIPlugin extends UIObject<'div'> {
7272
/**
7373
* 플러그인을 작동하지 않도록 한다.
7474
*/
75-
disable(): void {
75+
public disable(): void {
7676
this.stopListening();
7777
hideElement(this.el);
7878
this._enabled = false;
@@ -83,7 +83,7 @@ export default abstract class UIPlugin extends UIObject<'div'> {
8383
*
8484
* @returns {UIPlugin}
8585
*/
86-
render(): UIPlugin {
86+
public render(): UIPlugin {
8787
return this;
8888
}
8989
}

0 commit comments

Comments
 (0)