@compass-framework/core 1.2.59 → 1.2.61

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 (133) hide show
  1. package/@types/activity/Activity.d.ts +24 -0
  2. package/@types/activity/ActivityType.ts +3 -0
  3. package/@types/activity/ExtraValue.d.ts +1 -0
  4. package/@types/activity/Intent.ts +14 -0
  5. package/@types/{AlphaAnimation.d.ts → animation/AlphaAnimation.d.ts} +1 -1
  6. package/@types/{Animation.d.ts → animation/Animation.d.ts} +3 -3
  7. package/@types/{AnimationSet.d.ts → animation/AnimationSet.d.ts} +1 -1
  8. package/@types/{Interpolator.d.ts → animation/Interpolator.d.ts} +1 -1
  9. package/@types/{LayoutAnimationController.d.ts → animation/LayoutAnimationController.d.ts} +3 -3
  10. package/@types/{RotateAnimation.d.ts → animation/RotateAnimation.d.ts} +1 -1
  11. package/@types/{ScaleAnimation.d.ts → animation/ScaleAnimation.d.ts} +1 -1
  12. package/@types/{Transformation.d.ts → animation/Transformation.d.ts} +2 -2
  13. package/@types/{TranslateAnimation.d.ts → animation/TranslateAnimation.d.ts} +1 -1
  14. package/@types/{Animator.d.ts → animator/Animator.d.ts} +1 -1
  15. package/@types/{ValueAnimator.d.ts → animator/ValueAnimator.d.ts} +1 -1
  16. package/@types/app/Application.d.ts +11 -0
  17. package/@types/app/ApplicationConfig.d.ts +5 -0
  18. package/@types/app/ApplicationCreator.d.ts +9 -0
  19. package/@types/app/ApplicationCreatorConfig.d.ts +10 -0
  20. package/@types/{Canvas.d.ts → canvas/Canvas.d.ts} +1 -1
  21. package/@types/{Color.d.ts → canvas/Color.d.ts} +2 -2
  22. package/@types/{CornerPathEffect.d.ts → canvas/CornerPathEffect.d.ts} +1 -1
  23. package/@types/{LinearGradient.d.ts → canvas/LinearGradient.d.ts} +1 -1
  24. package/@types/{Matrix.d.ts → canvas/Matrix.d.ts} +1 -1
  25. package/@types/canvas/Paint.d.ts +475 -0
  26. package/@types/{Path.d.ts → canvas/Path.d.ts} +1 -1
  27. package/@types/{Picture.d.ts → canvas/Picture.d.ts} +2 -2
  28. package/@types/{Rect.d.ts → canvas/Rect.d.ts} +1 -1
  29. package/@types/{Shadow.d.ts → canvas/Shadow.d.ts} +1 -1
  30. package/@types/{Surface.d.ts → canvas/Surface.d.ts} +2 -2
  31. package/@types/{TypefaceFactory.d.ts → canvas/TypefaceFactory.d.ts} +1 -1
  32. package/@types/{ArrayAdapter.d.ts → content/ArrayAdapter.d.ts} +2 -2
  33. package/@types/{AttributeSet.d.ts → content/AttributeSet.d.ts} +3 -3
  34. package/@types/{BaseAdapter.d.ts → content/BaseAdapter.d.ts} +3 -3
  35. package/@types/content/Context.d.ts +28 -0
  36. package/@types/content/ContextWrapper.d.ts +29 -0
  37. package/@types/{LayoutInflater.ts → content/LayoutInflater.ts} +2 -2
  38. package/@types/{Resources.d.ts → content/Resources.d.ts} +3 -6
  39. package/@types/{XMLViewFactoryRegistry.d.ts → content/ViewFactoryRegistry.d.ts} +10 -10
  40. package/@types/{MouseCursor.ts → display/MouseCursor.ts} +1 -1
  41. package/@types/{SurfaceProvider.d.ts → display/SurfaceProvider.d.ts} +2 -2
  42. package/@types/{ColorDrawable.d.ts → drawable/ColorDrawable.d.ts} +2 -2
  43. package/@types/{CornersDrawable.d.ts → drawable/CornersDrawable.d.ts} +2 -2
  44. package/@types/{Drawable.d.ts → drawable/Drawable.d.ts} +7 -7
  45. package/@types/{ImageDrawable.ts → drawable/ImageDrawable.ts} +3 -3
  46. package/@types/{LayerDrawable.d.ts → drawable/LayerDrawable.d.ts} +3 -3
  47. package/@types/{LinearGradientDrawable.d.ts → drawable/LinearGradientDrawable.d.ts} +1 -1
  48. package/@types/{PictureDrawable.d.ts → drawable/PictureDrawable.d.ts} +4 -4
  49. package/@types/{Resolver.ts → evaluate/Resolver.ts} +1 -1
  50. package/@types/host/CanvaskitPlatformHostConfig.d.ts +3 -0
  51. package/@types/host/NodePlatformHostConfig.d.ts +4 -0
  52. package/@types/host/WebPlatformHostConfig.d.ts +3 -0
  53. package/@types/imm/InputMethod.d.ts +3 -0
  54. package/@types/{AbsoluteLayout.d.ts → layout/AbsoluteLayout.d.ts} +1 -1
  55. package/@types/{FrameLayout.d.ts → layout/FrameLayout.d.ts} +1 -1
  56. package/@types/{GridLayout.d.ts → layout/GridLayout.d.ts} +1 -1
  57. package/@types/{GridLayoutAnimationController.d.ts → layout/GridLayoutAnimationController.d.ts} +1 -1
  58. package/@types/{LinearLayout.d.ts → layout/LinearLayout.d.ts} +1 -1
  59. package/@types/{RelativeLayout.d.ts → layout/RelativeLayout.d.ts} +1 -1
  60. package/@types/{TabBarLayout.d.ts → layout/TabBarLayout.d.ts} +1 -1
  61. package/@types/{TableLayout.d.ts → layout/TableLayout.d.ts} +1 -1
  62. package/@types/{TableRow.d.ts → layout/TableRow.d.ts} +1 -1
  63. package/@types/{DoubleClick.d.ts → misc/DoubleClick.d.ts} +2 -2
  64. package/@types/{DoubleClickListener.d.ts → misc/DoubleClickListener.d.ts} +2 -2
  65. package/@types/{ContextUtils.d.ts → shared/ContextUtils.d.ts} +1 -1
  66. package/@types/view/Gravity.d.ts +41 -0
  67. package/@types/{Outline.d.ts → view/Outline.d.ts} +2 -2
  68. package/@types/{View.d.ts → view/View.d.ts} +477 -15
  69. package/@types/{ViewGroup.d.ts → view/ViewGroup.d.ts} +4 -4
  70. package/@types/{ViewGroupOverlay.d.ts → view/ViewGroupOverlay.d.ts} +1 -1
  71. package/@types/{ViewOverlay.d.ts → view/ViewOverlay.d.ts} +1 -1
  72. package/@types/{ViewSlot.d.ts → view/ViewSlot.d.ts} +2 -2
  73. package/@types/{ViewTreeObserver.d.ts → view/ViewTreeObserver.d.ts} +1 -1
  74. package/@types/{Adapter.d.ts → widget/Adapter.d.ts} +2 -2
  75. package/@types/widget/DecorView.ts +5 -0
  76. package/@types/{EditRichText.d.ts → widget/EditRichText.d.ts} +4 -4
  77. package/@types/{EditText.d.ts → widget/EditText.d.ts} +1 -1
  78. package/@types/{FreezeLayoutViewGroup.d.ts → widget/FreezeLayoutViewGroup.d.ts} +1 -1
  79. package/@types/{GridView.d.ts → widget/GridView.d.ts} +1 -1
  80. package/@types/{HorizontalScrollView.ts → widget/HorizontalScrollView.ts} +1 -1
  81. package/@types/{Image.d.ts → widget/Image.d.ts} +1 -1
  82. package/@types/{ImageView.d.ts → widget/ImageView.d.ts} +1 -1
  83. package/@types/{ListView.d.ts → widget/ListView.d.ts} +1 -1
  84. package/@types/{ScrollView.d.ts → widget/ScrollView.d.ts} +1 -1
  85. package/@types/{Slot.d.ts → widget/Slot.d.ts} +1 -1
  86. package/@types/{TextView.d.ts → widget/TextView.d.ts} +1 -1
  87. package/@types/window/ApplicationWindow.ts +12 -0
  88. package/@types/window/PopupWindow.d.ts +41 -0
  89. package/@types/window/Window.d.ts +24 -0
  90. package/@types/{WindowManager.d.ts → window/WindowManager.d.ts} +8 -6
  91. package/index.d.ts +118 -111
  92. package/package.json +1 -1
  93. package/@types/Application.d.ts +0 -58
  94. package/@types/ApplicationWindow.d.ts +0 -47
  95. package/@types/Assets.d.ts +0 -6
  96. package/@types/Context.d.ts +0 -29
  97. package/@types/Gravity.d.ts +0 -41
  98. package/@types/InputMethodService.d.ts +0 -6
  99. package/@types/Paint.d.ts +0 -202
  100. package/@types/PopupWindow.d.ts +0 -73
  101. package/@types/ResourcesInflater.d.ts +0 -13
  102. package/@types/Window.d.ts +0 -45
  103. package/@types/XMLLayoutParser.d.ts +0 -12
  104. package/@types/XMLResourcesParser.d.ts +0 -11
  105. /package/@types/{AccelerateDecelerateInterpolator.d.ts → animation/AccelerateDecelerateInterpolator.d.ts} +0 -0
  106. /package/@types/{AccelerateInterpolator.d.ts → animation/AccelerateInterpolator.d.ts} +0 -0
  107. /package/@types/{BounceInterpolator.d.ts → animation/BounceInterpolator.d.ts} +0 -0
  108. /package/@types/{CycleInterpolator.d.ts → animation/CycleInterpolator.d.ts} +0 -0
  109. /package/@types/{DecelerateInterpolator.d.ts → animation/DecelerateInterpolator.d.ts} +0 -0
  110. /package/@types/{LinearInterpolator.d.ts → animation/LinearInterpolator.d.ts} +0 -0
  111. /package/@types/{PropertyValuesHolder.d.ts → animator/PropertyValuesHolder.d.ts} +0 -0
  112. /package/@types/{TimeInterpolator.d.ts → animator/TimeInterpolator.d.ts} +0 -0
  113. /package/@types/{TypeEvaluator.d.ts → animator/TypeEvaluator.d.ts} +0 -0
  114. /package/@types/{BlendMode.ts → canvas/BlendMode.ts} +0 -0
  115. /package/@types/{ColorFilter.ts → canvas/ColorFilter.ts} +0 -0
  116. /package/@types/{ImageFilter.ts → canvas/ImageFilter.ts} +0 -0
  117. /package/@types/{PathEffect.ts → canvas/PathEffect.ts} +0 -0
  118. /package/@types/{RendererBackend.ts → canvas/RendererBackend.ts} +0 -0
  119. /package/@types/{Shader.d.ts → canvas/Shader.d.ts} +0 -0
  120. /package/@types/{Typeface.d.ts → canvas/Typeface.d.ts} +0 -0
  121. /package/@types/{Configuration.d.ts → content/Configuration.d.ts} +0 -0
  122. /package/@types/{DisplayMetrics.d.ts → content/DisplayMetrics.d.ts} +0 -0
  123. /package/@types/{PixelFormat.ts → content/PixelFormat.ts} +0 -0
  124. /package/@types/{Theme.d.ts → content/Theme.d.ts} +0 -0
  125. /package/@types/{Environment.ts → evaluate/Environment.ts} +0 -0
  126. /package/@types/{KeyEvent.d.ts → event/KeyEvent.d.ts} +0 -0
  127. /package/@types/{MotionEvent.d.ts → event/MotionEvent.d.ts} +0 -0
  128. /package/@types/{Editable.d.ts → text/Editable.d.ts} +0 -0
  129. /package/@types/{ViewOutlineProvider.d.ts → view/ViewOutlineProvider.d.ts} +0 -0
  130. /package/@types/{ViewParent.d.ts → view/ViewParent.d.ts} +0 -0
  131. /package/@types/{Button.d.ts → widget/Button.d.ts} +0 -0
  132. /package/@types/{FreezeAbsoluteLayout.d.ts → widget/FreezeAbsoluteLayout.d.ts} +0 -0
  133. /package/@types/{ListAdapter.d.ts → widget/ListAdapter.d.ts} +0 -0
@@ -0,0 +1,475 @@
1
+ import { CharSequence, InterfaceTemplate } from "@compass-framework/library";
2
+ import { Shader } from "./Shader";
3
+ import { Shadow } from "./Shadow";
4
+ import { Rect } from "./Rect";
5
+ import { Typeface } from "./Typeface";
6
+ import { PathEffect } from "./PathEffect";
7
+ import { Context } from "../content/Context";
8
+ import { ColorFilter } from "./ColorFilter";
9
+ import { BlendMode } from "./BlendMode";
10
+ import { ImageFilter } from "./ImageFilter";
11
+
12
+ /**
13
+ * 画笔,描述颜色、样式、字体等绘制属性。
14
+ */
15
+ export interface Paint {
16
+ /**
17
+ * 测量整段文本的绘制宽度。
18
+ */
19
+ measureText(text: CharSequence): number;
20
+
21
+ /**
22
+ * 测量指定区间文本的绘制宽度。
23
+ */
24
+ measureText(text: CharSequence, start: number, end: number): number;
25
+
26
+ /**
27
+ * 从另一支画笔复制全部属性,并返回自身。
28
+ */
29
+ set(paint: Paint): Paint
30
+
31
+ /**
32
+ * 按像素对齐调整描边位置,使线条绘制更锐利。
33
+ */
34
+ adjustForPixelPerfectLine(pixel: number): void;
35
+
36
+ /**
37
+ * 返回是否启用抗锯齿。
38
+ */
39
+ isAntiAlias(): boolean;
40
+
41
+ /**
42
+ * 返回文本是否应用了水平倾斜。
43
+ */
44
+ isTextSkewX(): boolean;
45
+
46
+ /**
47
+ * 返回像素对齐描边的调整值。
48
+ */
49
+ getPixelPerfectLine(): number
50
+
51
+ /**
52
+ * 返回字体度量信息。
53
+ */
54
+ getFontMetrics(): Paint.FontMetrics
55
+
56
+ /**
57
+ * 将字体度量写入指定对象,并返回行距。
58
+ */
59
+ getFontMetrics(fontMetrics: Paint.FontMetrics): number
60
+
61
+ /**
62
+ * 获取整段文本中每个字符的宽度,返回测量的字符数。
63
+ */
64
+ getTextWidths(text: CharSequence, widths: number[]): number
65
+
66
+ /**
67
+ * 获取指定区间文本中每个字符的宽度,返回测量的字符数。
68
+ */
69
+ getTextWidths(text: CharSequence, start: number, end: number, widths: number[]): number
70
+
71
+ /**
72
+ * 从字符串数组指定位置起测量字符宽度,返回测量的字符数。
73
+ */
74
+ getTextWidths(text: string[], index:number, count:number, widths: number[]): number
75
+
76
+ /**
77
+ * 将整段文本的包围盒写入指定矩形。
78
+ */
79
+ getTextBounds(text: CharSequence, bounds: Rect): void
80
+
81
+ /**
82
+ * 将指定区间文本的包围盒写入指定矩形。
83
+ */
84
+ getTextBounds(text: CharSequence, start: number, end: number, bounds: Rect): void
85
+
86
+ /**
87
+ * 在最大宽度内截断文本,返回实际测量的字符数。
88
+ */
89
+ breakText(text: CharSequence, measureForwards: boolean, maxWidth: number, measuredWidth: number[]): number
90
+
91
+ /**
92
+ * 在最大宽度内截断指定区间文本,返回实际测量的字符数。
93
+ */
94
+ breakText(text: CharSequence, start: number, end: number, measureForwards: boolean, maxWidth: number, measuredWidth: number[]): number
95
+
96
+ /**
97
+ * 返回填充/描边绘制样式。
98
+ */
99
+ getStyle(): Paint.Style;
100
+
101
+ /**
102
+ * 复制当前画笔并返回新实例。
103
+ */
104
+ copy(): Paint;
105
+
106
+ /**
107
+ * 返回图像滤镜。
108
+ */
109
+ getImageFilter(): ImageFilter;
110
+
111
+ /**
112
+ * 返回画笔标志位。
113
+ */
114
+ getFlags(): number
115
+
116
+ /**
117
+ * 返回透明度,取值范围为 0–255。
118
+ */
119
+ getAlpha(): number
120
+
121
+ /**
122
+ * 返回当前颜色(ARGB 数值)。
123
+ */
124
+ getColor(): number
125
+
126
+ /**
127
+ * 返回当前颜色的字符串表示。
128
+ */
129
+ getColorString(): string
130
+
131
+ /**
132
+ * 返回描边转角连接样式。
133
+ */
134
+ getStrokeJoin(): Paint.Join
135
+
136
+ /**
137
+ * 返回描边端点样式。
138
+ */
139
+ getStrokeCap(): Paint.Cap
140
+
141
+ /**
142
+ * 返回阴影效果。
143
+ */
144
+ getShadow(): Shadow
145
+
146
+ /**
147
+ * 返回文本字号。
148
+ */
149
+ getTextSize(): number
150
+
151
+ /**
152
+ * 返回颜色滤镜。
153
+ */
154
+ getColorFilter(): ColorFilter;
155
+
156
+ /**
157
+ * 返回文本水平对齐方式。
158
+ */
159
+ getTextAlign(): Paint.Align
160
+
161
+ /**
162
+ * 返回着色器。
163
+ */
164
+ getShader(): Shader;
165
+
166
+ /**
167
+ * 返回描边宽度。
168
+ */
169
+ getStrokeWidth(): number
170
+
171
+ /**
172
+ * 返回文本水平倾斜值。
173
+ */
174
+ getTextSkewX(): number;
175
+
176
+ /**
177
+ * 返回是否启用伪粗体。
178
+ */
179
+ getFakeBoldText(): boolean;
180
+
181
+ /**
182
+ * 返回混合模式。
183
+ */
184
+ getBlendMode(): BlendMode;
185
+
186
+ /**
187
+ * 返回当前字体。
188
+ */
189
+ getTypeface(): Typeface;
190
+
191
+ /**
192
+ * 返回路径效果。
193
+ */
194
+ getPathEffect(): PathEffect
195
+
196
+ /**
197
+ * 返回文本水平缩放比例。
198
+ */
199
+ getTextScaleX(): number;
200
+
201
+ /**
202
+ * 设置描边宽度。
203
+ */
204
+ setStrokeWidth(width: number): void
205
+
206
+ /**
207
+ * 设置路径效果。
208
+ */
209
+ setPathEffect(pathEffect: PathEffect): void
210
+
211
+ /**
212
+ * 设置是否启用抗锯齿。
213
+ */
214
+ setAntiAlias(aa: boolean): void;
215
+
216
+ /**
217
+ * 设置颜色(ARGB 数值)。
218
+ */
219
+ setColor(color: number): void
220
+
221
+ /**
222
+ * 设置描边转角连接样式。
223
+ */
224
+ setStrokeJoin(join: Paint.Join): void
225
+
226
+ /**
227
+ * 设置文本字号。
228
+ */
229
+ setTextSize(textSize: number): void
230
+
231
+ /**
232
+ * 设置描边端点样式。
233
+ */
234
+ setStrokeCap(cap: Paint.Cap): void
235
+
236
+ /**
237
+ * 返回推荐行距。
238
+ */
239
+ getFontSpacing(): number;
240
+
241
+ /**
242
+ * 设置文本水平对齐方式。
243
+ */
244
+ setTextAlign(textAlign: Paint.Align): void
245
+
246
+ /**
247
+ * 设置画笔标志位。
248
+ */
249
+ setFlags(flags: number): void
250
+
251
+ /**
252
+ * 设置图像滤镜。
253
+ */
254
+ setImageFilter(imageFilter: ImageFilter): void;
255
+
256
+ /**
257
+ * 设置填充/描边绘制样式。
258
+ */
259
+ setStyle(style: Paint.Style): void
260
+
261
+ /**
262
+ * 设置透明度,取值范围为 0–255。
263
+ */
264
+ setAlpha(a: number): void
265
+
266
+ /**
267
+ * 设置阴影效果。
268
+ */
269
+ setShadow(shadow: Shadow): void
270
+
271
+ /**
272
+ * 设置着色器。
273
+ */
274
+ setShader(shader: Shader): void
275
+
276
+ /**
277
+ * 设置颜色滤镜。
278
+ */
279
+ setColorFilter(filter: ColorFilter): void;
280
+
281
+ /**
282
+ * 按 Alpha、红、绿、蓝分量设置颜色。
283
+ */
284
+ setARGB(a: number, r: number, g: number, b: number): void
285
+
286
+ /**
287
+ * 设置字体。
288
+ */
289
+ setTypeface(typeface: Typeface): void;
290
+
291
+ /**
292
+ * 设置文本水平缩放比例。
293
+ */
294
+ setTextScaleX(scaleX: number): void;
295
+
296
+ /**
297
+ * 设置文本水平倾斜值。
298
+ */
299
+ setTextSkewX(value: number): void;
300
+
301
+ /**
302
+ * 设置是否启用伪粗体。
303
+ */
304
+ setFakeBoldText(value: boolean): void;
305
+
306
+ /**
307
+ * 设置混合模式。
308
+ */
309
+ setBlendMode(mode: BlendMode): void;
310
+
311
+ /**
312
+ * 设置是否绘制删除线。
313
+ */
314
+ setStrikeThruText(value: boolean): void;
315
+
316
+ /**
317
+ * 释放画笔占用的资源。
318
+ */
319
+ dispose(): void;
320
+
321
+ /**
322
+ * 返回画笔属性的字符串描述。
323
+ */
324
+ toString(): CharSequence;
325
+ }
326
+
327
+ /**
328
+ * Paint 接口的实现基类。
329
+ */
330
+ export abstract class Paint extends InterfaceTemplate {}
331
+
332
+ /**
333
+ * Paint 相关类型与工厂方法。
334
+ */
335
+ export namespace Paint {
336
+ /**
337
+ * 下划线文本标志位。
338
+ */
339
+ export const UNDERLINE_TEXT_FLAG: number;
340
+
341
+ /**
342
+ * 删除线文本标志位。
343
+ */
344
+ export const STRIKE_THRU_TEXT_FLAG: number;
345
+
346
+ /**
347
+ * 字体度量信息。
348
+ */
349
+ export class FontMetrics {
350
+ /**
351
+ * 基线以上的推荐上升距离(通常为负)。
352
+ */
353
+ public ascent: number;
354
+
355
+ /**
356
+ * 基线以下的推荐下降距离(通常为正)。
357
+ */
358
+ public descent: number;
359
+
360
+ /**
361
+ * 基线以上的最大上升距离(通常为负)。
362
+ */
363
+ public top: number;
364
+
365
+ /**
366
+ * 基线以下的最大下降距离(通常为正)。
367
+ */
368
+ public bottom: number;
369
+
370
+ /**
371
+ * 额外行距。
372
+ */
373
+ public leading: number;
374
+
375
+ /**
376
+ * 字形相对绘制原点的最左边界。
377
+ */
378
+ public left: number;
379
+
380
+ /**
381
+ * 字形相对绘制原点的最右边界。
382
+ */
383
+ public right: number;
384
+
385
+ /**
386
+ * 从另一组度量复制全部字段,并返回自身。
387
+ */
388
+ public set(metrics: FontMetrics): FontMetrics;
389
+ }
390
+
391
+ /**
392
+ * 描边转角连接样式。
393
+ */
394
+ export enum Join {
395
+ /**
396
+ * 斜角连接。
397
+ */
398
+ BEVEL = "bevel",
399
+
400
+ /**
401
+ * 尖角连接。
402
+ */
403
+ MITER = "miter",
404
+
405
+ /**
406
+ * 圆角连接。
407
+ */
408
+ ROUND = "round",
409
+ }
410
+
411
+ /**
412
+ * 描边端点样式。
413
+ */
414
+ export enum Cap {
415
+ /**
416
+ * 平端,精确停在路径端点。
417
+ */
418
+ BUTT = "butt",
419
+
420
+ /**
421
+ * 圆端,以端点为圆心向外延伸半个线宽。
422
+ */
423
+ ROUND = "round",
424
+
425
+ /**
426
+ * 方端,向外延伸半个线宽的矩形。
427
+ */
428
+ SQUARE = "square",
429
+ }
430
+
431
+ /**
432
+ * 填充与描边绘制样式。
433
+ */
434
+ export enum Style {
435
+ /**
436
+ * 仅填充内部。
437
+ */
438
+ FILL,
439
+
440
+ /**
441
+ * 仅描边轮廓。
442
+ */
443
+ STROKE,
444
+
445
+ /**
446
+ * 同时填充内部并描边轮廓。
447
+ */
448
+ FILL_AND_STROKE,
449
+ }
450
+
451
+ /**
452
+ * 文本水平对齐方式。
453
+ */
454
+ export enum Align {
455
+ /**
456
+ * 左对齐。
457
+ */
458
+ LEFT = 'left',
459
+
460
+ /**
461
+ * 居中对齐。
462
+ */
463
+ CENTER = 'center',
464
+
465
+ /**
466
+ * 右对齐。
467
+ */
468
+ RIGHT = 'right',
469
+ }
470
+
471
+ /**
472
+ * 创建 Paint 实例。
473
+ */
474
+ export function create(context: Context): Paint;
475
+ }
@@ -2,7 +2,7 @@ import { InterfaceTemplate } from "@compass-framework/library";
2
2
  import { Rect } from "./Rect";
3
3
  import { Matrix } from "./Matrix";
4
4
  import { PathEffect } from "./PathEffect";
5
- import { Context } from "./Context";
5
+ import { Context } from "../content/Context";
6
6
 
7
7
  /**
8
8
  * 矢量路径,用于描述可绘制的几何轮廓。
@@ -1,6 +1,6 @@
1
1
  import { Consumer } from "@compass-framework/library";
2
- import { Image } from "./Image";
3
- import { Context } from "./Context";
2
+ import { Image } from "../widget/Image";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 图片资源,异步加载并提供位图图像。
@@ -1,5 +1,5 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { Context } from "./Context";
2
+ import { Context } from "../content/Context";
3
3
 
4
4
  /**
5
5
  * 矩形区域,表示轴对齐的边界框。
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  InterfaceTemplate,
3
3
  } from "@compass-framework/library";
4
- import { Context } from "./Context";
4
+ import { Context } from "../content/Context";
5
5
 
6
6
  /**
7
7
  * 阴影效果,描述偏移、模糊半径与颜色。
@@ -1,7 +1,7 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { Image } from "./Image";
2
+ import { Image } from "../widget/Image";
3
3
  import { Canvas } from "./Canvas";
4
- import { Context } from "./Context";
4
+ import { Context } from "../content/Context";
5
5
 
6
6
  /**
7
7
  * 离屏绘制表面,可获取 Canvas 并生成图像快照。
@@ -1,5 +1,5 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { Context } from "./Context";
2
+ import { Context } from "../content/Context";
3
3
  import { Typeface } from "./Typeface";
4
4
 
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  import { ArrayList, List, Comparator } from "@compass-framework/library";
2
- import { View } from "./View";
2
+ import { View } from "../view/View";
3
3
  import { BaseAdapter } from "./BaseAdapter";
4
4
  import { Context } from "./Context";
5
- import { ViewGroup } from "./ViewGroup";
5
+ import { ViewGroup } from "../view/ViewGroup";
6
6
 
7
7
  /**
8
8
  * 基于数组/列表数据的通用适配器,支持增删排序与变更通知。
@@ -1,8 +1,8 @@
1
1
  import { CharSequence, Influence, Nullable } from "@compass-framework/library";
2
2
  import { Resources } from "./Resources";
3
- import { PictureDrawable } from "./PictureDrawable";
4
- import { Drawable } from "./Drawable";
5
- import { ColorDrawable } from "./ColorDrawable";
3
+ import { PictureDrawable } from "../drawable/PictureDrawable";
4
+ import { Drawable } from "../drawable/Drawable";
5
+ import { ColorDrawable } from "../drawable/ColorDrawable";
6
6
 
7
7
  /**
8
8
  * 属性集合,从资源或布局中按名称读取类型化属性值。
@@ -1,7 +1,7 @@
1
1
  import { Implements } from "@compass-framework/library";
2
- import { ListAdapter } from "./ListAdapter";
3
- import { View } from "./View";
4
- import { ViewGroup } from "./ViewGroup";
2
+ import { ListAdapter } from "../widget/ListAdapter";
3
+ import { View } from "../view/View";
4
+ import { ViewGroup } from "../view/ViewGroup";
5
5
 
6
6
  /**
7
7
  * 列表适配器基类,提供 ListAdapter 的默认实现骨架。
@@ -0,0 +1,28 @@
1
+ import { Environment } from "../evaluate/Environment";
2
+ import { Resources } from "./Resources";
3
+ import { MouseCursor } from "../display/MouseCursor";
4
+ import { RendererBackend } from "../canvas/RendererBackend";
5
+ import { WindowManager } from "../window/WindowManager";
6
+ import { SurfaceProvider } from "../display/SurfaceProvider";
7
+ import { ViewFactoryRegistry } from "./ViewFactoryRegistry";
8
+
9
+ /**
10
+ * 全局运行时上下文,提供资源、环境与窗口管理等服务。
11
+ */
12
+ export declare interface Context {
13
+ startActivity(intent: Intent): void;
14
+
15
+ getSurfaceProvider(): SurfaceProvider
16
+
17
+ getEnvironment(): Environment;
18
+
19
+ getMouseCursor(): MouseCursor;
20
+
21
+ getWindowManager(): WindowManager
22
+
23
+ getResources(): Resources
24
+
25
+ getRendererBackend(): RendererBackend
26
+
27
+ getViewFactoryRegistry() :ViewFactoryRegistry
28
+ }
@@ -0,0 +1,29 @@
1
+ import { Context } from "./Context";
2
+ import { Environment } from "../evaluate/Environment";
3
+ import { MouseCursor } from "../display/MouseCursor";
4
+ import { RendererBackend } from "../canvas/RendererBackend";
5
+ import { Resources } from "./Resources";
6
+ import { SurfaceProvider } from "../display/SurfaceProvider";
7
+ import { ViewFactoryRegistry } from "./ViewFactoryRegistry";
8
+ import { WindowManager } from "../window/WindowManager";
9
+ import { Intent } from "../activity/Intent";
10
+
11
+ export declare class ContextWrapper implements Context {
12
+ attachBaseContext(context: Context): void;
13
+
14
+ startActivity(intent: Intent): void;
15
+
16
+ getEnvironment(): Environment;
17
+
18
+ getMouseCursor(): MouseCursor;
19
+
20
+ getRendererBackend(): RendererBackend;
21
+
22
+ getResources(): Resources;
23
+
24
+ getWindowManager(): WindowManager;
25
+
26
+ getSurfaceProvider(): SurfaceProvider;
27
+
28
+ getViewFactoryRegistry(): ViewFactoryRegistry;
29
+ }
@@ -1,7 +1,7 @@
1
1
  import { XML } from "@compass-framework/library";
2
2
  import { Context } from "./Context";
3
- import { View } from "./View";
4
- import { ViewGroup } from "./ViewGroup";
3
+ import { View } from "../view/View";
4
+ import { ViewGroup } from "../view/ViewGroup";
5
5
 
6
6
  /**
7
7
  * 布局填充器,将 XML 布局膨胀为视图树。
@@ -1,10 +1,9 @@
1
1
  import { CharSequence, RefValue, XML } from "@compass-framework/library";
2
- import { Drawable } from "./Drawable";
2
+ import { Drawable } from "../drawable/Drawable";
3
3
  import { DisplayMetrics } from "./DisplayMetrics";
4
- import { Assets } from "./Assets";
5
- import { ColorDrawable } from "./ColorDrawable";
6
- import { Configuration } from "./Configuration";
4
+ import { ColorDrawable } from "../drawable/ColorDrawable";
7
5
  import { AttributeSet } from "./AttributeSet";
6
+ import { Configuration } from "./Configuration";
8
7
 
9
8
  /**
10
9
  * 资源管理器,提供布局、drawable、字符串等资源读写。
@@ -12,8 +11,6 @@ import { AttributeSet } from "./AttributeSet";
12
11
  export declare class Resources {
13
12
  public getDisplayMetrics(): DisplayMetrics;
14
13
 
15
- public getAssets(): Assets;
16
-
17
14
  public getConfiguration(): Configuration;
18
15
 
19
16
  /// ///////////////////////////////////////////////////////////////////////////////////////////////////////