@egjs/flicking 4.4.1 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +0 -1
  2. package/declaration/Flicking.d.ts +8 -2
  3. package/declaration/camera/Camera.d.ts +26 -24
  4. package/declaration/camera/index.d.ts +2 -4
  5. package/declaration/camera/mode/BoundCameraMode.d.ts +13 -0
  6. package/declaration/camera/mode/CameraMode.d.ts +19 -0
  7. package/declaration/camera/mode/CircularCameraMode.d.ts +18 -0
  8. package/declaration/camera/mode/LinearCameraMode.d.ts +9 -0
  9. package/declaration/camera/mode/index.d.ts +6 -0
  10. package/declaration/const/external.d.ts +4 -0
  11. package/declaration/control/StrictControl.d.ts +1 -0
  12. package/declaration/type/external.d.ts +1 -3
  13. package/dist/flicking.esm.js +1205 -1093
  14. package/dist/flicking.esm.js.map +1 -1
  15. package/dist/flicking.js +1208 -1095
  16. package/dist/flicking.js.map +1 -1
  17. package/dist/flicking.min.js +2 -2
  18. package/dist/flicking.min.js.map +1 -1
  19. package/dist/flicking.pkgd.js +1208 -1095
  20. package/dist/flicking.pkgd.js.map +1 -1
  21. package/dist/flicking.pkgd.min.js +2 -2
  22. package/dist/flicking.pkgd.min.js.map +1 -1
  23. package/package.json +5 -4
  24. package/src/Flicking.ts +26 -15
  25. package/src/camera/Camera.ts +156 -71
  26. package/src/camera/index.ts +3 -7
  27. package/src/camera/{BoundCamera.ts → mode/BoundCameraMode.ts} +46 -43
  28. package/src/camera/mode/CameraMode.ts +77 -0
  29. package/src/camera/mode/CircularCameraMode.ts +171 -0
  30. package/src/camera/mode/LinearCameraMode.ts +23 -0
  31. package/src/camera/mode/index.ts +14 -0
  32. package/src/cfc/sync.ts +9 -4
  33. package/src/cfc/withFlickingMethods.ts +2 -1
  34. package/src/const/external.ts +12 -0
  35. package/src/control/StrictControl.ts +10 -0
  36. package/declaration/camera/BoundCamera.d.ts +0 -9
  37. package/declaration/camera/CircularCamera.d.ts +0 -37
  38. package/declaration/camera/LinearCamera.d.ts +0 -5
  39. package/src/camera/CircularCamera.ts +0 -268
  40. package/src/camera/LinearCamera.ts +0 -35
@@ -2,40 +2,46 @@
2
2
  * Copyright (c) 2015 NAVER Corp.
3
3
  * egjs projects are licensed under the MIT license
4
4
  */
5
- import Panel from "../core/panel/Panel";
6
- import AnchorPoint from "../core/AnchorPoint";
7
- import { getFlickingAttached, parseAlign } from "../utils";
5
+ import AnchorPoint from "../../core/AnchorPoint";
6
+ import Panel from "../../core/panel/Panel";
7
+ import { parseAlign } from "../../utils";
8
8
 
9
- import Camera from "./Camera";
9
+ import CameraMode from "./CameraMode";
10
10
 
11
- /**
12
- * A {@link Camera} that set range not to go out of the first/last panel, so it won't show empty spaces before/after the first/last panel
13
- * @ko 첫번째와 마지막 패널 밖으로 넘어가지 못하도록 범위를 설정하여, 첫번째/마지막 패널 전/후의 빈 공간을 보이지 않도록 하는 종류의 {@link Camera}
14
- */
15
- class BoundCamera extends Camera {
16
- /**
17
- * Update {@link Camera#range range} of Camera
18
- * @ko Camera의 {@link Camera#range range}를 업데이트합니다
19
- * @chainable
20
- * @throws {FlickingError}
21
- * {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
22
- * <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
23
- * @return {this}
24
- */
25
- public updateRange() {
26
- const flicking = getFlickingAttached(this._flicking);
11
+ class BoundCameraMode extends CameraMode {
12
+ public checkAvailability(): boolean {
13
+ const flicking = this._flicking;
14
+ const renderer = flicking.renderer;
15
+
16
+ const firstPanel = renderer.getPanel(0);
17
+ const lastPanel = renderer.getPanel(renderer.panelCount - 1);
18
+
19
+ if (!firstPanel || !lastPanel) {
20
+ return false;
21
+ }
22
+
23
+ const viewportSize = flicking.camera.size;
24
+ const firstPanelPrev = firstPanel.range.min;
25
+ const lastPanelNext = lastPanel.range.max;
26
+ const panelAreaSize = lastPanelNext - firstPanelPrev;
27
+ const isBiggerThanViewport = viewportSize < panelAreaSize;
28
+
29
+ return isBiggerThanViewport;
30
+ }
31
+
32
+ public getRange(): { min: number; max: number } {
33
+ const flicking = this._flicking;
27
34
  const renderer = flicking.renderer;
28
- const alignPos = this._alignPos;
35
+ const alignPos = flicking.camera.alignPosition;
29
36
 
30
37
  const firstPanel = renderer.getPanel(0);
31
38
  const lastPanel = renderer.getPanel(renderer.panelCount - 1);
32
39
 
33
40
  if (!firstPanel || !lastPanel) {
34
- this._range = { min: 0, max: 0 };
35
- return this;
41
+ return { min: 0, max: 0 };
36
42
  }
37
43
 
38
- const viewportSize = this.size;
44
+ const viewportSize = flicking.camera.size;
39
45
  const firstPanelPrev = firstPanel.range.min;
40
46
  const lastPanelNext = lastPanel.range.max;
41
47
  const panelAreaSize = lastPanelNext - firstPanelPrev;
@@ -45,32 +51,30 @@ class BoundCamera extends Camera {
45
51
  const lastPos = lastPanelNext - viewportSize + alignPos;
46
52
 
47
53
  if (isBiggerThanViewport) {
48
- this._range = { min: firstPos, max: lastPos };
54
+ return { min: firstPos, max: lastPos };
49
55
  } else {
50
- const align = this._align;
56
+ const align = flicking.camera.align;
51
57
  const alignVal = typeof align === "object"
52
58
  ? (align as { camera: string | number }).camera
53
59
  : align;
54
60
 
55
61
  const pos = firstPos + parseAlign(alignVal, lastPos - firstPos);
56
62
 
57
- this._range = { min: pos, max: pos };
63
+ return { min: pos, max: pos };
58
64
  }
59
-
60
- return this;
61
65
  }
62
66
 
63
- public updateAnchors(): this {
64
- const flicking = getFlickingAttached(this._flicking);
67
+ public getAnchors(): AnchorPoint[] {
68
+ const flicking = this._flicking;
69
+ const camera = flicking.camera;
65
70
  const panels = flicking.renderer.panels;
66
71
 
67
72
  if (panels.length <= 0) {
68
- this._anchors = [];
69
- return this;
73
+ return [];
70
74
  }
71
75
 
72
- const range = this._range;
73
- const reachablePanels = panels.filter(panel => this.canReach(panel));
76
+ const range = flicking.camera.range;
77
+ const reachablePanels = panels.filter(panel => camera.canReach(panel));
74
78
 
75
79
  if (reachablePanels.length > 0) {
76
80
  const shouldPrependBoundAnchor = reachablePanels[0].position !== range.min;
@@ -99,7 +103,7 @@ class BoundCamera extends Camera {
99
103
  }));
100
104
  }
101
105
 
102
- this._anchors = newAnchors;
106
+ return newAnchors;
103
107
  } else if (range.min !== range.max) {
104
108
  // There're more than 2 panels
105
109
  const nearestPanelAtMin = this._findNearestPanel(range.min, panels);
@@ -108,7 +112,7 @@ class BoundCamera extends Camera {
108
112
  : nearestPanelAtMin;
109
113
  const panelAtMax = panelAtMin.next()!;
110
114
 
111
- this._anchors = [
115
+ return [
112
116
  new AnchorPoint({
113
117
  index: 0,
114
118
  position: range.min,
@@ -121,19 +125,18 @@ class BoundCamera extends Camera {
121
125
  })
122
126
  ];
123
127
  } else {
124
- this._anchors = [new AnchorPoint({
128
+ return [new AnchorPoint({
125
129
  index: 0,
126
130
  position: range.min,
127
131
  panel: this._findNearestPanel(range.min, panels)
128
132
  })];
129
133
  }
130
-
131
- return this;
132
134
  }
133
135
 
134
136
  public findAnchorIncludePosition(position: number): AnchorPoint | null {
135
- const range = this._range;
136
- const anchors = this._anchors;
137
+ const camera = this._flicking.camera;
138
+ const range = camera.range;
139
+ const anchors = camera.anchorPoints;
137
140
 
138
141
  if (anchors.length <= 0) return null;
139
142
 
@@ -165,4 +168,4 @@ class BoundCamera extends Camera {
165
168
  }
166
169
  }
167
170
 
168
- export default BoundCamera;
171
+ export default BoundCameraMode;
@@ -0,0 +1,77 @@
1
+ /*
2
+ * Copyright (c) 2015 NAVER Corp.
3
+ * egjs projects are licensed under the MIT license
4
+ */
5
+ import Flicking from "../../Flicking";
6
+ import Panel from "../../core/panel/Panel";
7
+ import AnchorPoint from "../../core/AnchorPoint";
8
+ import { clamp } from "../../utils";
9
+
10
+ /**
11
+ * A mode of camera
12
+ */
13
+ abstract class CameraMode {
14
+ protected _flicking: Flicking;
15
+
16
+ /** */
17
+ public constructor(flicking: Flicking) {
18
+ this._flicking = flicking;
19
+ }
20
+
21
+ public abstract checkAvailability(): boolean;
22
+ public abstract getRange(): { min: number; max: number };
23
+
24
+ public getAnchors(): AnchorPoint[] {
25
+ const panels = this._flicking.renderer.panels;
26
+
27
+ return panels.map((panel, index) => new AnchorPoint({
28
+ index,
29
+ position: panel.position,
30
+ panel
31
+ }));
32
+ }
33
+
34
+ public findAnchorIncludePosition(position: number): AnchorPoint | null {
35
+ const anchors = this._flicking.camera.anchorPoints;
36
+ const anchorsIncludingPosition = anchors.filter(anchor => anchor.panel.includePosition(position, true));
37
+
38
+ return anchorsIncludingPosition.reduce((nearest: AnchorPoint | null, anchor) => {
39
+ if (!nearest) return anchor;
40
+
41
+ return Math.abs(nearest.position - position) < Math.abs(anchor.position - position)
42
+ ? nearest
43
+ : anchor;
44
+ }, null);
45
+ }
46
+
47
+ public clampToReachablePosition(position: number): number {
48
+ const camera = this._flicking.camera;
49
+ const range = camera.range;
50
+
51
+ return clamp(position, range.min, range.max);
52
+ }
53
+
54
+ public getCircularOffset(): number {
55
+ return 0;
56
+ }
57
+
58
+ public canReach(panel: Panel): boolean {
59
+ const camera = this._flicking.camera;
60
+ const range = camera.range;
61
+
62
+ if (panel.removed) return false;
63
+
64
+ const panelPos = panel.position;
65
+
66
+ return panelPos >= range.min && panelPos <= range.max;
67
+ }
68
+
69
+ public canSee(panel: Panel): boolean {
70
+ const camera = this._flicking.camera;
71
+ const visibleRange = camera.visibleRange;
72
+ // Should not include margin, as we don't declare what the margin is visible as what the panel is visible.
73
+ return panel.isVisibleOnRange(visibleRange.min, visibleRange.max);
74
+ }
75
+ }
76
+
77
+ export default CameraMode;
@@ -0,0 +1,171 @@
1
+ /*
2
+ * Copyright (c) 2015 NAVER Corp.
3
+ * egjs projects are licensed under the MIT license
4
+ */
5
+ import Panel from "../../core/panel/Panel";
6
+ import AnchorPoint from "../../core/AnchorPoint";
7
+ import { DIRECTION } from "../../const/external";
8
+ import { circulatePosition } from "../../utils";
9
+
10
+ import CameraMode from "./CameraMode";
11
+
12
+ /**
13
+ * A {@link Camera} mode that connects the last panel and the first panel, enabling continuous loop
14
+ * @ko 첫번째 패널과 마지막 패널이 이어진 상태로, 무한히 회전할 수 있는 종류의 {@link Camera} 모드
15
+ */
16
+ class CircularCameraMode extends CameraMode {
17
+ public checkAvailability(): boolean {
18
+ const flicking = this._flicking;
19
+ const renderer = flicking.renderer;
20
+ const panels = renderer.panels;
21
+
22
+ if (panels.length <= 0) {
23
+ return false;
24
+ }
25
+
26
+ const firstPanel = panels[0];
27
+ const lastPanel = panels[panels.length - 1];
28
+ const firstPanelPrev = firstPanel.range.min - firstPanel.margin.prev;
29
+ const lastPanelNext = lastPanel.range.max + lastPanel.margin.next;
30
+
31
+ const visibleSize = flicking.camera.size;
32
+ const panelSizeSum = lastPanelNext - firstPanelPrev;
33
+
34
+ const canSetCircularMode = panels
35
+ .every(panel => panelSizeSum - panel.size >= visibleSize);
36
+
37
+ return canSetCircularMode;
38
+ }
39
+
40
+ public getRange(): { min: number; max: number } {
41
+ const flicking = this._flicking;
42
+ const panels = flicking.renderer.panels;
43
+
44
+ if (panels.length <= 0) {
45
+ return { min: 0, max: 0 };
46
+ }
47
+
48
+ const firstPanel = panels[0];
49
+ const lastPanel = panels[panels.length - 1];
50
+ const firstPanelPrev = firstPanel.range.min - firstPanel.margin.prev;
51
+ const lastPanelNext = lastPanel.range.max + lastPanel.margin.next;
52
+
53
+ return { min: firstPanelPrev, max: lastPanelNext };
54
+ }
55
+
56
+ public getAnchors(): AnchorPoint[] {
57
+ const flicking = this._flicking;
58
+ const panels = flicking.renderer.panels;
59
+
60
+ return panels.map((panel, index) => new AnchorPoint({
61
+ index,
62
+ position: panel.position,
63
+ panel
64
+ }));
65
+ }
66
+
67
+ public findAnchorIncludePosition(position: number): AnchorPoint | null {
68
+ const camera = this._flicking.camera;
69
+ const range = camera.range;
70
+ const anchors = camera.anchorPoints;
71
+ const rangeDiff = camera.rangeDiff;
72
+ const anchorCount = anchors.length;
73
+ const positionInRange = circulatePosition(position, range.min, range.max);
74
+
75
+ let anchorInRange: AnchorPoint | null = super.findAnchorIncludePosition(positionInRange);
76
+
77
+ if (anchorCount > 0 && (position === range.min || position === range.max)) {
78
+ const possibleAnchors = [
79
+ anchorInRange,
80
+ new AnchorPoint({
81
+ index: 0,
82
+ position: anchors[0].position + rangeDiff,
83
+ panel: anchors[0].panel
84
+ }),
85
+ new AnchorPoint({
86
+ index: anchorCount - 1,
87
+ position: anchors[anchorCount - 1].position - rangeDiff,
88
+ panel: anchors[anchorCount - 1].panel
89
+ })
90
+ ].filter(anchor => !!anchor) as AnchorPoint[];
91
+
92
+ anchorInRange = possibleAnchors.reduce((nearest: AnchorPoint | null, anchor) => {
93
+ if (!nearest) return anchor;
94
+
95
+ return Math.abs(nearest.position - position) < Math.abs(anchor.position - position)
96
+ ? nearest
97
+ : anchor;
98
+ }, null);
99
+ }
100
+
101
+ if (!anchorInRange) return null;
102
+
103
+ if (position < range.min) {
104
+ const loopCount = -Math.floor((range.min - position) / rangeDiff) - 1;
105
+
106
+ return new AnchorPoint({
107
+ index: anchorInRange.index,
108
+ position: anchorInRange.position + rangeDiff * loopCount,
109
+ panel: anchorInRange.panel
110
+ });
111
+ } else if (position > range.max) {
112
+ const loopCount = Math.floor((position - range.max) / rangeDiff) + 1;
113
+
114
+ return new AnchorPoint({
115
+ index: anchorInRange.index,
116
+ position: anchorInRange.position + rangeDiff * loopCount,
117
+ panel: anchorInRange.panel
118
+ });
119
+ }
120
+
121
+ return anchorInRange;
122
+ }
123
+
124
+ public getCircularOffset(): number {
125
+ const flicking = this._flicking;
126
+ const camera = flicking.camera;
127
+
128
+ if (!camera.circularEnabled) return 0;
129
+
130
+ const toggled = flicking.panels.filter(panel => panel.toggled);
131
+ const toggledPrev = toggled.filter(panel => panel.toggleDirection === DIRECTION.PREV);
132
+ const toggledNext = toggled.filter(panel => panel.toggleDirection === DIRECTION.NEXT);
133
+
134
+ return this._calcPanelAreaSum(toggledPrev) - this._calcPanelAreaSum(toggledNext);
135
+ }
136
+
137
+ public clampToReachablePosition(position: number): number {
138
+ // Basically all position is reachable for circular camera
139
+ return position;
140
+ }
141
+
142
+ public canReach(panel: Panel): boolean {
143
+ if (panel.removed) return false;
144
+
145
+ // Always reachable on circular mode
146
+ return true;
147
+ }
148
+
149
+ public canSee(panel: Panel): boolean {
150
+ const camera = this._flicking.camera;
151
+ const range = camera.range;
152
+ const rangeDiff = camera.rangeDiff;
153
+ const visibleRange = camera.visibleRange;
154
+ const visibleInCurrentRange = super.canSee(panel);
155
+
156
+ // Check looped visible area for circular case
157
+ if (visibleRange.min < range.min) {
158
+ return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min + rangeDiff, visibleRange.max + rangeDiff);
159
+ } else if (visibleRange.max > range.max) {
160
+ return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min - rangeDiff, visibleRange.max - rangeDiff);
161
+ }
162
+
163
+ return visibleInCurrentRange;
164
+ }
165
+
166
+ private _calcPanelAreaSum(panels: Panel[]) {
167
+ return panels.reduce((sum: number, panel: Panel) => sum + panel.sizeIncludingMargin, 0);
168
+ }
169
+ }
170
+
171
+ export default CircularCameraMode;
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2015 NAVER Corp.
3
+ * egjs projects are licensed under the MIT license
4
+ */
5
+ import CameraMode from "./CameraMode";
6
+
7
+ class LinearCameraMode extends CameraMode {
8
+ public checkAvailability(): boolean {
9
+ // It's always available
10
+ return true;
11
+ }
12
+
13
+ public getRange(): { min: number; max: number } {
14
+ const renderer = this._flicking.renderer;
15
+
16
+ const firstPanel = renderer.getPanel(0);
17
+ const lastPanel = renderer.getPanel(renderer.panelCount - 1);
18
+
19
+ return { min: firstPanel?.position ?? 0, max: lastPanel?.position ?? 0 };
20
+ }
21
+ }
22
+
23
+ export default LinearCameraMode;
@@ -0,0 +1,14 @@
1
+ import CameraMode from "./CameraMode";
2
+ import LinearCameraMode from "./LinearCameraMode";
3
+ import CircularCameraMode from "./CircularCameraMode";
4
+ import BoundCameraMode from "./BoundCameraMode";
5
+
6
+ export {
7
+ LinearCameraMode,
8
+ CircularCameraMode,
9
+ BoundCameraMode
10
+ };
11
+
12
+ export type {
13
+ CameraMode
14
+ };
package/src/cfc/sync.ts CHANGED
@@ -6,6 +6,7 @@ import Renderer from "../renderer/Renderer";
6
6
  export default (flicking: Flicking, diffResult: DiffResult<any>, rendered: any[]) => {
7
7
  const renderer = flicking.renderer;
8
8
  const panels = renderer.panels;
9
+ const prevList = [...diffResult.prevList];
9
10
 
10
11
  if (diffResult.removed.length > 0) {
11
12
  let endIdx = -1;
@@ -24,6 +25,8 @@ export default (flicking: Flicking, diffResult: DiffResult<any>, rendered: any[]
24
25
  } else {
25
26
  prevIdx = removedIdx;
26
27
  }
28
+
29
+ prevList.splice(removedIdx, 1);
27
30
  });
28
31
 
29
32
  batchRemove(renderer, prevIdx, endIdx + 1);
@@ -56,13 +59,15 @@ export default (flicking: Flicking, diffResult: DiffResult<any>, rendered: any[]
56
59
  let startIdx = -1;
57
60
  let prevIdx = -1;
58
61
 
62
+ const addedElements = rendered.slice(prevList.length);
63
+
59
64
  diffResult.added.forEach((addedIdx, idx) => {
60
65
  if (startIdx < 0) {
61
66
  startIdx = idx;
62
67
  }
63
68
 
64
69
  if (prevIdx >= 0 && addedIdx !== prevIdx + 1) {
65
- batchInsert(renderer, diffResult, rendered, startIdx, idx + 1);
70
+ batchInsert(renderer, diffResult, addedElements, startIdx, idx + 1);
66
71
 
67
72
  startIdx = -1;
68
73
  prevIdx = -1;
@@ -72,14 +77,14 @@ export default (flicking: Flicking, diffResult: DiffResult<any>, rendered: any[]
72
77
  });
73
78
 
74
79
  if (startIdx >= 0) {
75
- batchInsert(renderer, diffResult, rendered, startIdx);
80
+ batchInsert(renderer, diffResult, addedElements, startIdx);
76
81
  }
77
82
  }
78
83
  };
79
84
 
80
- const batchInsert = (renderer: Renderer, diffResult: DiffResult<any>, rendered: any[], startIdx: number, endIdx?: number) => {
85
+ const batchInsert = (renderer: Renderer, diffResult: DiffResult<any>, addedElements: any[], startIdx: number, endIdx?: number) => {
81
86
  renderer.batchInsert(
82
- ...diffResult.added.slice(startIdx, endIdx).map((index, elIdx) => ({ index, elements: [rendered[elIdx + diffResult.prevList.length]], hasDOMInElements: false }))
87
+ ...diffResult.added.slice(startIdx, endIdx).map((index, elIdx) => ({ index, elements: [addedElements[elIdx]], hasDOMInElements: false }))
83
88
  );
84
89
  };
85
90
 
@@ -34,7 +34,8 @@ const withFlickingMethods = (prototype: any, flickingName: string) => {
34
34
  const getterDescriptor: { get?: () => any; set?: (val: any) => void } = {};
35
35
  if (descriptor.get) {
36
36
  getterDescriptor.get = function() {
37
- return descriptor.get?.call(this[flickingName]);
37
+ const flicking = this[flickingName];
38
+ return flicking && descriptor.get?.call(flicking);
38
39
  };
39
40
  }
40
41
  if (descriptor.set) {
@@ -98,3 +98,15 @@ export const CLASS = {
98
98
  HIDDEN: "flicking-hidden",
99
99
  DEFAULT_VIRTUAL: "flicking-panel"
100
100
  };
101
+
102
+ /**
103
+ * An object with all possible {@link Flicking#circularFallback circularFallback}s
104
+ * @ko Flicking의 {@link Flicking#circularFallback circularFallback}에 설정 가능한 값들을 담고 있는 객체
105
+ * @type {object}
106
+ * @property {string} LINEAR "linear"
107
+ * @property {string} BOUND "bound"
108
+ */
109
+ export const CIRCULAR_FALLBACK = {
110
+ LINEAR: "linear",
111
+ BOUND: "bound"
112
+ } as const;
@@ -141,6 +141,16 @@ class StrictControl extends Control {
141
141
  return this;
142
142
  }
143
143
 
144
+ public async moveToPanel(panel: Panel, options: Parameters<Control["moveToPanel"]>[1]): Promise<void> {
145
+ const flicking = getFlickingAttached(this._flicking);
146
+ const camera = flicking.camera;
147
+ const controller = this._controller;
148
+
149
+ controller.update(camera.controlParams);
150
+
151
+ return super.moveToPanel(panel, options);
152
+ }
153
+
144
154
  /**
145
155
  * Move {@link Camera} to the given position
146
156
  * @ko {@link Camera}를 주어진 좌표로 이동합니다
@@ -1,9 +0,0 @@
1
- import AnchorPoint from "../core/AnchorPoint";
2
- import Camera from "./Camera";
3
- declare class BoundCamera extends Camera {
4
- updateRange(): this;
5
- updateAnchors(): this;
6
- findAnchorIncludePosition(position: number): AnchorPoint | null;
7
- private _findNearestPanel;
8
- }
9
- export default BoundCamera;
@@ -1,37 +0,0 @@
1
- import Panel from "../core/panel/Panel";
2
- import AnchorPoint from "../core/AnchorPoint";
3
- import { DIRECTION } from "../const/external";
4
- import { ValueOf } from "../type/internal";
5
- import Camera from "./Camera";
6
- export interface TogglePoint {
7
- panel: Panel;
8
- direction: ValueOf<typeof DIRECTION>;
9
- toggled: boolean;
10
- }
11
- declare class CircularCamera extends Camera {
12
- private _circularOffset;
13
- private _circularEnabled;
14
- get offset(): number;
15
- get controlParams(): {
16
- range: {
17
- min: number;
18
- max: number;
19
- };
20
- position: number;
21
- circular: boolean;
22
- };
23
- getPrevAnchor(anchor: AnchorPoint): AnchorPoint | null;
24
- getNextAnchor(anchor: AnchorPoint): AnchorPoint | null;
25
- findAnchorIncludePosition(position: number): AnchorPoint | null;
26
- clampToReachablePosition(position: number): number;
27
- canReach(panel: Panel): boolean;
28
- canSee(panel: Panel): boolean;
29
- updateRange(): this;
30
- updateOffset(): this;
31
- lookAt(pos: number): void;
32
- applyTransform(): this;
33
- protected _resetInternalValues(): void;
34
- private _calcPanelAreaSum;
35
- private _updateCircularOffset;
36
- }
37
- export default CircularCamera;
@@ -1,5 +0,0 @@
1
- import Camera from "./Camera";
2
- declare class LinearCamera extends Camera {
3
- updateRange(): this;
4
- }
5
- export default LinearCamera;