@leafer/decorator 1.0.0-rc.3 → 1.0.0-rc.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/decorator",
3
- "version": "1.0.0-rc.3",
3
+ "version": "1.0.0-rc.30",
4
4
  "description": "@leafer/decorator",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/platform": "1.0.0-rc.3",
26
- "@leafer/debug": "1.0.0-rc.3"
25
+ "@leafer/platform": "1.0.0-rc.30",
26
+ "@leafer/debug": "1.0.0-rc.30"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.0.0-rc.3"
29
+ "@leafer/interface": "1.0.0-rc.30"
30
30
  }
31
31
  }
package/src/data.ts CHANGED
@@ -1,197 +1,215 @@
1
- import { ILeafData, ILeaf, IObject, __Value } from '@leafer/interface'
1
+ import { ILeafData, ILeaf, IObject, IValue, ILeafAttrDescriptor, ILeafAttrDescriptorFn } from '@leafer/interface'
2
2
  import { defineKey, getDescriptor } from './object'
3
3
  import { Debug } from '@leafer/debug'
4
4
 
5
5
 
6
6
  // name
7
7
 
8
- export function aliasType(name: string) {
9
- return (target: ILeaf, key: string) => {
10
- defineKey(target, key, {
11
- get() { return this.__getAttr(name) },
12
- set(value: __Value) {
13
- this.__setAttr(name, value)
14
- }
15
- })
16
- }
8
+ export function decorateLeafAttr(defaultValue?: IValue, descriptorFn?: ILeafAttrDescriptorFn) {
9
+ return (target: ILeaf, key: string) => defineLeafAttr(target, key, defaultValue, descriptorFn && descriptorFn(key))
17
10
  }
18
11
 
19
- export function defineLeafAttr(target: ILeaf, key: string, defaultValue?: __Value, mergeDescriptor?: IObject & ThisType<ILeaf>): void {
20
- const defaultDescriptor: IObject & ThisType<ILeaf> = {
12
+ export function attr(partDescriptor?: ILeafAttrDescriptor): ILeafAttrDescriptor {
13
+ return partDescriptor
14
+ }
15
+
16
+
17
+ export function defineLeafAttr(target: ILeaf, key: string, defaultValue?: IValue, partDescriptor?: ILeafAttrDescriptor): void {
18
+ const defaultDescriptor: ILeafAttrDescriptor = {
21
19
  get() { return this.__getAttr(key) },
22
- set(value: __Value) { this.__setAttr(key, value) },
23
- configurable: true,
24
- enumerable: true
20
+ set(value: IValue) { this.__setAttr(key, value) }
25
21
  }
26
- defineKey(target, key, Object.assign(defaultDescriptor, mergeDescriptor || {}))
22
+ defineKey(target, key, Object.assign(defaultDescriptor, partDescriptor || {}))
27
23
  defineDataProcessor(target, key, defaultValue)
28
24
  }
29
25
 
30
- export function dataType(defaultValue?: __Value) {
31
- return (target: ILeaf, key: string) => {
32
- defineLeafAttr(target, key, defaultValue)
33
- }
26
+
27
+ export function dataType(defaultValue?: IValue) {
28
+ return decorateLeafAttr(defaultValue)
34
29
  }
35
30
 
36
- export function positionType(defaultValue?: __Value) {
37
- return (target: ILeaf, key: string) => {
38
- defineLeafAttr(target, key, defaultValue, {
39
- set(value: __Value) {
40
- this.__setAttr(key, value)
41
- this.__layout.positionChanged || this.__layout.positionChange()
42
- }
43
- })
44
- }
31
+ export function positionType(defaultValue?: IValue, checkFiniteNumber?: boolean) {
32
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
33
+ set(value: IValue) {
34
+ this.__setAttr(key, value, checkFiniteNumber) && (this.__layout.matrixChanged || this.__layout.matrixChange())
35
+ }
36
+ }))
45
37
  }
46
38
 
47
- export function scaleType(defaultValue?: __Value) {
48
- return (target: ILeaf, key: string) => {
49
- defineLeafAttr(target, key, defaultValue, {
50
- set(value: __Value) {
51
- this.__setAttr(key, value)
52
- this.__layout.scaleChanged || this.__layout.scaleChange()
39
+ export function autoLayoutType(defaultValue?: IValue) {
40
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
41
+ set(value: IValue) {
42
+ if (this.__setAttr(key, value)) {
43
+ this.__layout.matrixChanged || this.__layout.matrixChange()
44
+ this.__hasAutoLayout = !!value
45
+ if (!this.__local) this.__layout.createLocal()
53
46
  }
54
- })
55
- }
47
+ }
48
+ }))
56
49
  }
57
50
 
51
+ export function scaleType(defaultValue?: IValue, checkFiniteNumber?: boolean) {
52
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
53
+ set(value: IValue) {
54
+ this.__setAttr(key, value, checkFiniteNumber) && (this.__layout.scaleChanged || this.__layout.scaleChange())
58
55
 
59
- export function rotationType(defaultValue?: __Value) {
60
- return (target: ILeaf, key: string) => {
61
- defineLeafAttr(target, key, defaultValue, {
62
- set(value: __Value) {
63
- this.__setAttr(key, value)
64
- this.__layout.rotationChanged || this.__layout.rotationChange()
56
+ }
57
+ }))
58
+ }
65
59
 
66
- }
67
- })
68
- }
60
+ export function rotationType(defaultValue?: IValue, checkFiniteNumber?: boolean) {
61
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
62
+ set(value: IValue) {
63
+ this.__setAttr(key, value, checkFiniteNumber) && (this.__layout.rotationChanged || this.__layout.rotationChange())
64
+ }
65
+
66
+ }))
69
67
  }
70
68
 
71
- export function boundsType(defaultValue?: __Value) {
72
- return (target: ILeaf, key: string) => {
73
- defineLeafAttr(target, key, defaultValue, {
74
- set(value: __Value) {
75
- this.__setAttr(key, value)
76
- this.__layout.boxChanged || this.__layout.boxChange()
77
- if (this.__.around) this.__layout.positionChanged || this.__layout.positionChange()
78
- }
79
- })
80
- }
69
+ export function boundsType(defaultValue?: IValue, checkFiniteNumber?: boolean) {
70
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
71
+ set(value: IValue) {
72
+ this.__setAttr(key, value, checkFiniteNumber) && doBoundsType(this)
73
+ }
74
+ }))
75
+ }
76
+
77
+ export function naturalBoundsType(defaultValue?: IValue) {
78
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
79
+ set(value: IValue) {
80
+ this.__setAttr(key, value) && (doBoundsType(this), this.__.__removeNaturalSize())
81
+ }
82
+ }))
83
+ }
84
+
85
+ export function doBoundsType(leaf: ILeaf): void {
86
+ leaf.__layout.boxChanged || leaf.__layout.boxChange()
87
+ if (leaf.__hasAutoLayout) leaf.__layout.matrixChanged || leaf.__layout.matrixChange()
88
+ }
89
+
90
+ export function pathInputType(defaultValue?: IValue) {
91
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
92
+ set(value: IValue) {
93
+ const data = this.__
94
+ if (data.__pathInputed !== 2) data.__pathInputed = value ? 1 : 0
95
+ if (!value) data.__pathForRender = undefined
96
+ this.__setAttr(key, value)
97
+ doBoundsType(this)
98
+ }
99
+ }))
81
100
  }
82
101
 
83
102
  export const pathType = boundsType
84
103
 
85
104
 
86
- export function affectStrokeBoundsType(defaultValue?: __Value) {
87
- return (target: ILeaf, key: string) => {
88
- defineLeafAttr(target, key, defaultValue, {
89
- set(value: __Value) {
90
- this.__setAttr(key, value)
91
- this.__layout.strokeChanged || this.__layout.strokeChange()
92
- }
93
- })
94
- }
105
+ export function affectStrokeBoundsType(defaultValue?: IValue) {
106
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
107
+ set(value: IValue) {
108
+ this.__setAttr(key, value) && doStrokeType(this)
109
+ }
110
+ }))
111
+ }
112
+
113
+ export function doStrokeType(leaf: ILeaf): void {
114
+ leaf.__layout.strokeChanged || leaf.__layout.strokeChange()
115
+ if (leaf.__.__useArrow) doBoundsType(leaf)
95
116
  }
96
117
 
97
118
  export const strokeType = affectStrokeBoundsType
98
119
 
99
- export function affectRenderBoundsType(defaultValue?: __Value) {
100
- return (target: ILeaf, key: string) => {
101
- defineLeafAttr(target, key, defaultValue, {
102
- set(value: __Value) {
103
- this.__setAttr(key, value)
104
- this.__layout.renderChanged || this.__layout.renderChange()
105
- }
106
- })
107
- }
120
+ export function affectRenderBoundsType(defaultValue?: IValue) {
121
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
122
+ set(value: IValue) {
123
+ this.__setAttr(key, value)
124
+ this.__layout.renderChanged || this.__layout.renderChange()
125
+ }
126
+ }))
108
127
  }
109
128
 
110
- export function surfaceType(defaultValue?: __Value) {
111
- return (target: ILeaf, key: string) => {
112
- defineLeafAttr(target, key, defaultValue, {
113
- set(value: __Value) {
114
- this.__setAttr(key, value)
115
- this.__layout.surfaceChanged || this.__layout.surfaceChange()
116
- }
117
- })
118
- }
129
+ export function surfaceType(defaultValue?: IValue) {
130
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
131
+ set(value: IValue) {
132
+ this.__setAttr(key, value) && (this.__layout.surfaceChanged || this.__layout.surfaceChange())
133
+ }
134
+ }))
135
+ }
136
+
137
+ export function opacityType(defaultValue?: IValue) {
138
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
139
+ set(value: IValue) {
140
+ this.__setAttr(key, value) && (this.__layout.opacityChanged || this.__layout.opacityChange())
141
+ }
142
+ }))
119
143
  }
120
144
 
121
- export function opacityType(defaultValue?: __Value) {
122
- return (target: ILeaf, key: string) => {
123
- defineLeafAttr(target, key, defaultValue, {
124
- set(value: __Value) {
125
- this.__setAttr(key, value)
145
+ export function visibleType(defaultValue?: IValue) {
146
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
147
+ set(value: IValue) {
148
+ const oldValue = this.visible
149
+ if (this.__setAttr(key, value)) {
126
150
  this.__layout.opacityChanged || this.__layout.opacityChange()
151
+ if (oldValue === 0 || value === 0) doBoundsType(this) // 0 = display: none
127
152
  }
128
- })
129
- }
153
+ }
154
+ }))
130
155
  }
131
156
 
132
- export function sortType(defaultValue?: __Value) {
133
- return (target: ILeaf, key: string) => {
134
- defineLeafAttr(target, key, defaultValue, {
135
- set(value: __Value) {
136
- this.__setAttr(key, value)
157
+ export function sortType(defaultValue?: IValue) {
158
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
159
+ set(value: IValue) {
160
+ if (this.__setAttr(key, value)) {
137
161
  this.__layout.surfaceChanged || this.__layout.surfaceChange()
138
162
  this.waitParent(() => { this.parent.__layout.childrenSortChange() })
139
163
  }
140
- })
141
- }
164
+ }
165
+ }))
142
166
  }
143
167
 
144
- export function maskType(defaultValue?: __Value) {
145
- return (target: ILeaf, key: string) => {
146
- defineLeafAttr(target, key, defaultValue, {
147
- set(value: boolean) {
148
- this.__setAttr(key, value)
168
+ export function maskType(defaultValue?: IValue) {
169
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
170
+ set(value: boolean) {
171
+ if (this.__setAttr(key, value)) {
149
172
  this.__layout.boxChanged || this.__layout.boxChange()
150
173
  this.waitParent(() => { this.parent.__updateMask(value) })
151
174
  }
152
- })
153
- }
175
+ }
176
+ }))
154
177
  }
155
178
 
156
- export function eraserType(defaultValue?: __Value) {
157
- return (target: ILeaf, key: string) => {
158
- defineLeafAttr(target, key, defaultValue, {
159
- set(value: boolean) {
160
- this.__setAttr(key, value)
161
- this.waitParent(() => { this.parent.__updateEraser(value) })
162
- }
163
- })
164
- }
179
+ export function eraserType(defaultValue?: IValue) {
180
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
181
+ set(value: boolean) {
182
+ this.__setAttr(key, value) && this.waitParent(() => { this.parent.__updateEraser(value) })
183
+ }
184
+ }))
165
185
  }
166
186
 
167
- export function hitType(defaultValue?: __Value) {
168
- return (target: ILeaf, key: string) => {
169
- defineLeafAttr(target, key, defaultValue, {
170
- set(value: __Value) {
171
- this.__setAttr(key, value)
187
+ export function hitType(defaultValue?: IValue) {
188
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
189
+ set(value: IValue) {
190
+ if (this.__setAttr(key, value)) {
191
+ this.__layout.hitCanvasChanged = true
172
192
  if (Debug.showHitView) { this.__layout.surfaceChanged || this.__layout.surfaceChange() }
173
193
  if (this.leafer) this.leafer.updateCursor()
174
194
  }
175
- })
176
- }
195
+ }
196
+ }))
177
197
  }
178
198
 
179
- export function cursorType(defaultValue?: __Value) {
180
- return (target: ILeaf, key: string) => {
181
- defineLeafAttr(target, key, defaultValue, {
182
- set(value: __Value) {
183
- this.__setAttr(key, value)
184
- if (this.leafer) this.leafer.updateCursor()
185
- }
186
- })
187
- }
199
+ export function cursorType(defaultValue?: IValue) {
200
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
201
+ set(value: IValue) {
202
+ this.__setAttr(key, value)
203
+ if (this.leafer) this.leafer.updateCursor()
204
+ }
205
+ }))
188
206
  }
189
207
 
190
208
 
191
209
  // get
192
210
 
193
211
  export function dataProcessor(processor: IObject) {
194
- return (target: ILeaf, _key: string) => {
212
+ return (target: IObject, _key?: string) => {
195
213
  defineKey(target, '__DataProcessor', {
196
214
  get() { return processor }
197
215
  })
@@ -199,7 +217,7 @@ export function dataProcessor(processor: IObject) {
199
217
  }
200
218
 
201
219
  export function layoutProcessor(processor: IObject) {
202
- return (target: ILeaf, _key: string) => {
220
+ return (target: IObject, _key?: string) => {
203
221
  defineKey(target, '__LayoutProcessor', {
204
222
  get() { return processor }
205
223
  })
@@ -213,27 +231,22 @@ function getSetMethodName(key: string): string {
213
231
  return 'set' + key.charAt(0).toUpperCase() + key.slice(1)
214
232
  }
215
233
 
216
- export function setDefaultValue(target: IObject, key: string, defaultValue: __Value): void {
217
- defineDataProcessor(target.prototype, key, defaultValue)
218
- }
219
234
 
220
235
  // define leaf.__[key] getter/setter
221
- export function defineDataProcessor(target: ILeaf, key: string, defaultValue?: __Value): void {
236
+ export function defineDataProcessor(target: ILeaf, key: string, defaultValue?: IValue): void {
222
237
 
223
- const data = target.__DataProcessor.prototype as ILeafData
238
+ const data = target.__DataProcessor.prototype
224
239
  const computedKey = '_' + key
225
240
  const setMethodName = getSetMethodName(key)
226
241
 
227
242
  const property: IObject & ThisType<ILeafData> = {
228
243
  get() {
229
- const v = this[computedKey]
244
+ const v = (this as IObject)[computedKey]
230
245
  return v === undefined ? defaultValue : v
231
246
  },
232
- set(value: __Value) {
233
- this[computedKey] = value
234
- },
235
- configurable: true,
236
- enumerable: true
247
+ set(value: IValue) {
248
+ (this as IObject)[computedKey] = value
249
+ }
237
250
  }
238
251
 
239
252
  if (defaultValue === undefined) {
@@ -241,25 +254,40 @@ export function defineDataProcessor(target: ILeaf, key: string, defaultValue?: _
241
254
  } else if (key === 'width') {
242
255
  property.get = function () {
243
256
  const v = this[computedKey]
244
- return v === undefined ? ((this as ILeafData).__naturalWidth || defaultValue) : v
257
+ if (v === undefined) {
258
+ const t = this as ILeafData
259
+ return (t as IObject)._height && t.__naturalWidth && t.__useNaturalRatio ? (t as IObject)._height * t.__naturalWidth / t.__naturalHeight : t.__naturalWidth || defaultValue
260
+ } else {
261
+ return v
262
+ }
245
263
  }
246
264
  } else if (key === 'height') {
247
265
  property.get = function () {
248
266
  const v = this[computedKey]
249
- return v === undefined ? ((this as ILeafData).__naturalHeight || defaultValue) : v
267
+ if (v === undefined) {
268
+ const t = this as ILeafData
269
+ return (t as IObject)._width && t.__naturalHeight && t.__useNaturalRatio ? (t as IObject)._width * t.__naturalHeight / t.__naturalWidth : t.__naturalHeight || defaultValue
270
+ } else {
271
+ return v
272
+ }
250
273
  }
251
274
  }
252
275
 
253
- const descriptor = getDescriptor(data, key)
276
+ // find parent proto
277
+ let descriptor, find = data
278
+ while (!descriptor && find) {
279
+ descriptor = getDescriptor(find, key)
280
+ find = find.__proto__
281
+ }
254
282
 
255
- if (descriptor && descriptor.set) property.set = descriptor.set // use custom set
283
+ if (descriptor && descriptor.set) property.set = descriptor.set // use exist set
256
284
 
257
285
  if (data[setMethodName]) {
258
- property.set = data[setMethodName] // use custom setKey(value)
286
+ property.set = data[setMethodName] // first use custom setKey(value)
259
287
  delete data[setMethodName]
260
288
  }
261
289
 
262
- Object.defineProperty(data, key, property)
290
+ defineKey(data, key, property)
263
291
 
264
292
  }
265
293
 
package/src/define.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeaf, IObject, __Value } from '@leafer/interface'
1
+ import { ILeaf, IObject } from '@leafer/interface'
2
2
 
3
3
  import * as types from './data'
4
4
 
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { aliasType, defineLeafAttr, dataType, positionType, boundsType, affectStrokeBoundsType, strokeType, affectRenderBoundsType, scaleType, rotationType, surfaceType, opacityType, sortType, maskType, eraserType, hitType, pathType, cursorType, dataProcessor, layoutProcessor, setDefaultValue, defineDataProcessor } from './data'
1
+ export { defineLeafAttr, decorateLeafAttr, attr, dataType, positionType, autoLayoutType, boundsType, doBoundsType, naturalBoundsType, affectStrokeBoundsType, doStrokeType, strokeType, affectRenderBoundsType, scaleType, rotationType, surfaceType, opacityType, visibleType, sortType, maskType, eraserType, hitType, pathType, pathInputType, cursorType, dataProcessor, layoutProcessor, defineDataProcessor } from './data'
2
2
  export { useModule, rewrite, rewriteAble } from './rewrite'
3
3
  export { defineKey, getDescriptor } from './object'
4
4
  export { registerUI, registerUIEvent } from './class'
package/src/object.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { IObject } from '@leafer/interface'
2
2
 
3
- export function defineKey<T>(target: T, key: string, descriptor: IObject & ThisType<T>): void {
3
+ export function defineKey<T>(target: T, key: string, descriptor: IObject & ThisType<T>, noConfigurable?: boolean): void {
4
+ if (!noConfigurable) descriptor.configurable = descriptor.enumerable = true
4
5
  Object.defineProperty(target, key, descriptor)
5
6
  }
6
7
 
package/types/index.d.ts CHANGED
@@ -1,36 +1,42 @@
1
- import { ILeaf, __Value, IObject, IFunction } from '@leafer/interface';
1
+ import { IValue, ILeafAttrDescriptorFn, ILeaf, ILeafAttrDescriptor, IObject, IFunction } from '@leafer/interface';
2
2
 
3
- declare function aliasType(name: string): (target: ILeaf, key: string) => void;
4
- declare function defineLeafAttr(target: ILeaf, key: string, defaultValue?: __Value, mergeDescriptor?: IObject & ThisType<ILeaf>): void;
5
- declare function dataType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
6
- declare function positionType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
7
- declare function scaleType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
8
- declare function rotationType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
9
- declare function boundsType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
3
+ declare function decorateLeafAttr(defaultValue?: IValue, descriptorFn?: ILeafAttrDescriptorFn): (target: ILeaf, key: string) => void;
4
+ declare function attr(partDescriptor?: ILeafAttrDescriptor): ILeafAttrDescriptor;
5
+ declare function defineLeafAttr(target: ILeaf, key: string, defaultValue?: IValue, partDescriptor?: ILeafAttrDescriptor): void;
6
+ declare function dataType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
7
+ declare function positionType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
8
+ declare function autoLayoutType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
9
+ declare function scaleType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
10
+ declare function rotationType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
11
+ declare function boundsType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
12
+ declare function naturalBoundsType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
13
+ declare function doBoundsType(leaf: ILeaf): void;
14
+ declare function pathInputType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
10
15
  declare const pathType: typeof boundsType;
11
- declare function affectStrokeBoundsType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
16
+ declare function affectStrokeBoundsType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
17
+ declare function doStrokeType(leaf: ILeaf): void;
12
18
  declare const strokeType: typeof affectStrokeBoundsType;
13
- declare function affectRenderBoundsType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
14
- declare function surfaceType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
15
- declare function opacityType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
16
- declare function sortType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
17
- declare function maskType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
18
- declare function eraserType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
19
- declare function hitType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
20
- declare function cursorType(defaultValue?: __Value): (target: ILeaf, key: string) => void;
21
- declare function dataProcessor(processor: IObject): (target: ILeaf, _key: string) => void;
22
- declare function layoutProcessor(processor: IObject): (target: ILeaf, _key: string) => void;
23
- declare function setDefaultValue(target: IObject, key: string, defaultValue: __Value): void;
24
- declare function defineDataProcessor(target: ILeaf, key: string, defaultValue?: __Value): void;
19
+ declare function affectRenderBoundsType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
20
+ declare function surfaceType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
21
+ declare function opacityType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
22
+ declare function visibleType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
23
+ declare function sortType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
24
+ declare function maskType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
25
+ declare function eraserType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
26
+ declare function hitType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
27
+ declare function cursorType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
28
+ declare function dataProcessor(processor: IObject): (target: IObject, _key?: string) => void;
29
+ declare function layoutProcessor(processor: IObject): (target: IObject, _key?: string) => void;
30
+ declare function defineDataProcessor(target: ILeaf, key: string, defaultValue?: IValue): void;
25
31
 
26
32
  declare function rewrite(method: IFunction): (target: IObject, key: string) => void;
27
33
  declare function rewriteAble(): (_target: IObject) => void;
28
34
  declare function useModule(module: IObject, exclude?: string[]): (target: IObject) => void;
29
35
 
30
- declare function defineKey<T>(target: T, key: string, descriptor: IObject & ThisType<T>): void;
36
+ declare function defineKey<T>(target: T, key: string, descriptor: IObject & ThisType<T>, noConfigurable?: boolean): void;
31
37
  declare function getDescriptor(object: IObject, name: string): PropertyDescriptor;
32
38
 
33
39
  declare function registerUI(): (target: IObject) => void;
34
40
  declare function registerUIEvent(): (target: IObject) => void;
35
41
 
36
- export { affectRenderBoundsType, affectStrokeBoundsType, aliasType, boundsType, cursorType, dataProcessor, dataType, defineDataProcessor, defineKey, defineLeafAttr, eraserType, getDescriptor, hitType, layoutProcessor, maskType, opacityType, pathType, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, setDefaultValue, sortType, strokeType, surfaceType, useModule };
42
+ export { affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, eraserType, getDescriptor, hitType, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, useModule, visibleType };