@hatiolab/things-scene 2.7.14 → 2.7.15
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.
- package/db.sqlite +0 -0
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +8 -3
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +3 -23
- package/logs/application-2021-11-30-22.log +4 -0
- package/logs/application-2021-11-30-23.log +1 -0
- package/logs/connections-2021-11-30-22.log +32 -0
- package/package.json +3 -3
- package/things-scene-ie.js +1 -1
- package/things-scene-min.js +1 -1
- package/things-scene.d.ts +120 -11
- package/things-scene.mjs +1 -1
- package/logs/application-2021-11-15-23.log +0 -4
- package/logs/connections-2021-11-08-22.log +0 -32
- package/logs/connections-2021-11-09-19.log +0 -32
- package/logs/connections-2021-11-10-23.log +0 -32
- package/logs/connections-2021-11-13-21.log +0 -32
- package/logs/connections-2021-11-15-23.log +0 -32
package/things-scene.d.ts
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
declare module '@hatiolab/things-scene' {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type Constructor<T = {}> = new (...args: any[]) => T
|
|
3
|
+
|
|
4
|
+
enum SCENE_MODE {
|
|
5
|
+
MODE_VIEW = 0,
|
|
6
|
+
MODE_EDIT = 1,
|
|
7
|
+
MODE_SHIFT = 2
|
|
8
|
+
}
|
|
5
9
|
|
|
6
10
|
type FITMODE = 'both' | 'ratio' | 'width' | 'height' | 'center' | 'none'
|
|
7
|
-
type
|
|
8
|
-
type
|
|
11
|
+
type DIMENSION = { x: number; y: number }
|
|
12
|
+
type SCALE = DIMENSION
|
|
13
|
+
type TRANSLATE = DIMENSION
|
|
14
|
+
type POSITION = DIMENSION
|
|
9
15
|
|
|
10
|
-
|
|
16
|
+
type ControlHandler = {
|
|
17
|
+
ondragstart?(point: POSITION, index: number, component: Component): void
|
|
18
|
+
ondragmove?(point: POSITION, index: number, component: Component): void
|
|
19
|
+
ondragend?(point: POSITION, index: number, component: Component): void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Control extends DIMENSION {
|
|
23
|
+
handler: ControlHandler
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function create({
|
|
11
27
|
target,
|
|
12
28
|
model,
|
|
13
29
|
style,
|
|
@@ -23,17 +39,110 @@ declare module '@hatiolab/things-scene' {
|
|
|
23
39
|
style?: any
|
|
24
40
|
layers?: Array<any>
|
|
25
41
|
handlers?: Array<any>
|
|
26
|
-
mode?:
|
|
42
|
+
mode?: SCENE_MODE
|
|
27
43
|
refProvider?: any
|
|
28
44
|
baseUrl?: string | undefined
|
|
29
45
|
fitMode?: FITMODE
|
|
30
46
|
}): Scene
|
|
31
47
|
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
function error(...args: any[]): void
|
|
49
|
+
function warn(...args: any[]): void
|
|
50
|
+
function debug(...args: any[]): void
|
|
51
|
+
|
|
52
|
+
class ScriptLoader {
|
|
53
|
+
static load(scripts: string | Array<string>, styles?: string | Array<string>): Promise<void>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
class Anchor {
|
|
57
|
+
constructor({ component, anchor, position }: { component: Component; anchor: string; position: POSITION })
|
|
58
|
+
|
|
59
|
+
position: POSITION
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
class Model {
|
|
63
|
+
static compile(model: Model, context: any): Component
|
|
64
|
+
|
|
65
|
+
type: string;
|
|
66
|
+
[key: string]: any
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
class ApplicationContext {
|
|
70
|
+
readonly refProvider: any
|
|
71
|
+
readonly isViewMode: boolean
|
|
72
|
+
|
|
73
|
+
mode: SCENE_MODE
|
|
74
|
+
baseUrl: string
|
|
75
|
+
|
|
76
|
+
dispose(): void
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function RectPath<TBase extends Constructor>(Base: TBase): TBase
|
|
80
|
+
function ValueHolder<TBase extends Constructor>(
|
|
81
|
+
Base: TBase
|
|
82
|
+
): {
|
|
83
|
+
new (...args: any[]): {
|
|
84
|
+
value: number
|
|
85
|
+
animValue: number
|
|
86
|
+
animOnValueChange(value: number, animFromBase: boolean, base: number): void
|
|
87
|
+
}
|
|
88
|
+
} & TBase
|
|
89
|
+
|
|
90
|
+
class Component {
|
|
91
|
+
static register(type: string, Clazz: typeof Component): void
|
|
92
|
+
|
|
93
|
+
state: { [key: string]: any }
|
|
94
|
+
bounds: { top: number; left: number; width: number; height: number }
|
|
95
|
+
root: RootContainer
|
|
96
|
+
parent: Container
|
|
97
|
+
app: ApplicationContext /* application context */
|
|
98
|
+
model: Model
|
|
99
|
+
hierarchy: Model
|
|
100
|
+
path: Array<DIMENSION>
|
|
101
|
+
anchors: Array<Anchor>
|
|
102
|
+
data: any
|
|
103
|
+
get controls(): Array<Control> | undefined
|
|
104
|
+
get hasTextProperty(): boolean
|
|
105
|
+
|
|
106
|
+
ready(): void
|
|
107
|
+
dispose(): void
|
|
108
|
+
setState(state: any): void
|
|
109
|
+
get(state: string): any
|
|
110
|
+
reposition(): void
|
|
111
|
+
|
|
112
|
+
drawImage(
|
|
113
|
+
context: CanvasRenderingContext2D,
|
|
114
|
+
image: HTMLImageElement,
|
|
115
|
+
left: number,
|
|
116
|
+
top: number,
|
|
117
|
+
width: number,
|
|
118
|
+
height: number
|
|
119
|
+
): void
|
|
120
|
+
drawStroke(context: CanvasRenderingContext2D): void
|
|
121
|
+
drawFill(context: CanvasRenderingContext2D): void
|
|
122
|
+
drawText(context: CanvasRenderingContext2D): void
|
|
123
|
+
|
|
124
|
+
ondblclick(e: MouseEvent): void
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
class Container extends Component {
|
|
128
|
+
indexOf(component: Component): number
|
|
129
|
+
insertComponentAt(target: Component, idx: number): void
|
|
130
|
+
findById(id: string): Component
|
|
131
|
+
}
|
|
132
|
+
class RootContainer extends Container {}
|
|
133
|
+
|
|
134
|
+
class Shape extends Component {}
|
|
135
|
+
class Ellipse extends Shape {}
|
|
136
|
+
class HTMLOverlayElement extends Component {
|
|
137
|
+
element: HTMLElement
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
class HTMLOverlayContainer extends Container {
|
|
141
|
+
readonly layout: any
|
|
142
|
+
}
|
|
34
143
|
|
|
35
|
-
|
|
36
|
-
static
|
|
144
|
+
class Scene {
|
|
145
|
+
static readonly residents: WeakSet<Scene>
|
|
37
146
|
|
|
38
147
|
/**
|
|
39
148
|
* scene에 컴포넌트를 추가한다.
|