@compass-framework/core 1.2.60 → 1.2.62

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 (134) 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/{CornerPathEffect.d.ts → canvas/CornerPathEffect.d.ts} +1 -1
  22. package/@types/{LinearGradient.d.ts → canvas/LinearGradient.d.ts} +1 -1
  23. package/@types/{Matrix.d.ts → canvas/Matrix.d.ts} +1 -1
  24. package/@types/{Paint.d.ts → canvas/Paint.d.ts} +1 -1
  25. package/@types/{Path.d.ts → canvas/Path.d.ts} +1 -1
  26. package/@types/{Picture.d.ts → canvas/Picture.d.ts} +2 -2
  27. package/@types/{Rect.d.ts → canvas/Rect.d.ts} +1 -1
  28. package/@types/{Shadow.d.ts → canvas/Shadow.d.ts} +1 -1
  29. package/@types/{Surface.d.ts → canvas/Surface.d.ts} +2 -2
  30. package/@types/{TypefaceFactory.d.ts → canvas/TypefaceFactory.d.ts} +1 -1
  31. package/@types/{ArrayAdapter.d.ts → content/ArrayAdapter.d.ts} +2 -2
  32. package/@types/{AttributeSet.d.ts → content/AttributeSet.d.ts} +3 -3
  33. package/@types/{BaseAdapter.d.ts → content/BaseAdapter.d.ts} +3 -3
  34. package/@types/content/Context.d.ts +28 -0
  35. package/@types/content/ContextWrapper.d.ts +29 -0
  36. package/@types/{LayoutInflater.ts → content/LayoutInflater.ts} +2 -2
  37. package/@types/{Resources.d.ts → content/Resources.d.ts} +3 -6
  38. package/@types/{XMLViewFactoryRegistry.d.ts → content/ViewFactoryRegistry.d.ts} +10 -10
  39. package/@types/{MouseCursor.ts → display/MouseCursor.ts} +1 -1
  40. package/@types/{SurfaceProvider.d.ts → display/SurfaceProvider.d.ts} +2 -2
  41. package/@types/{ColorDrawable.d.ts → drawable/ColorDrawable.d.ts} +2 -2
  42. package/@types/{CornersDrawable.d.ts → drawable/CornersDrawable.d.ts} +2 -2
  43. package/@types/{Drawable.d.ts → drawable/Drawable.d.ts} +7 -7
  44. package/@types/{ImageDrawable.ts → drawable/ImageDrawable.ts} +3 -3
  45. package/@types/{LayerDrawable.d.ts → drawable/LayerDrawable.d.ts} +3 -3
  46. package/@types/{LinearGradientDrawable.d.ts → drawable/LinearGradientDrawable.d.ts} +1 -1
  47. package/@types/{PictureDrawable.d.ts → drawable/PictureDrawable.d.ts} +4 -4
  48. package/@types/{Resolver.ts → evaluate/Resolver.ts} +1 -1
  49. package/@types/host/EditContext.d.ts +179 -0
  50. package/@types/host/backend/CanvaskitPlatformHostConfig.d.ts +3 -0
  51. package/@types/host/backend/NodePlatformHostConfig.d.ts +4 -0
  52. package/@types/host/backend/WebPlatformHostConfig.d.ts +3 -0
  53. package/@types/imm/InputConnection.ts +17 -0
  54. package/@types/imm/InputMethod.d.ts +3 -0
  55. package/@types/{AbsoluteLayout.d.ts → layout/AbsoluteLayout.d.ts} +1 -1
  56. package/@types/{FrameLayout.d.ts → layout/FrameLayout.d.ts} +1 -1
  57. package/@types/{GridLayout.d.ts → layout/GridLayout.d.ts} +1 -1
  58. package/@types/{GridLayoutAnimationController.d.ts → layout/GridLayoutAnimationController.d.ts} +1 -1
  59. package/@types/{LinearLayout.d.ts → layout/LinearLayout.d.ts} +1 -1
  60. package/@types/{RelativeLayout.d.ts → layout/RelativeLayout.d.ts} +1 -1
  61. package/@types/{TabBarLayout.d.ts → layout/TabBarLayout.d.ts} +1 -1
  62. package/@types/{TableLayout.d.ts → layout/TableLayout.d.ts} +1 -1
  63. package/@types/{TableRow.d.ts → layout/TableRow.d.ts} +1 -1
  64. package/@types/{DoubleClick.d.ts → misc/DoubleClick.d.ts} +2 -2
  65. package/@types/{DoubleClickListener.d.ts → misc/DoubleClickListener.d.ts} +2 -2
  66. package/@types/{ContextUtils.d.ts → shared/ContextUtils.d.ts} +1 -1
  67. package/@types/text/EditorInfo.d.ts +7 -0
  68. package/@types/{Gravity.d.ts → view/Gravity.d.ts} +1 -1
  69. package/@types/{Outline.d.ts → view/Outline.d.ts} +2 -2
  70. package/@types/{View.d.ts → view/View.d.ts} +14 -14
  71. package/@types/{ViewGroup.d.ts → view/ViewGroup.d.ts} +4 -4
  72. package/@types/{ViewGroupOverlay.d.ts → view/ViewGroupOverlay.d.ts} +1 -1
  73. package/@types/{ViewOverlay.d.ts → view/ViewOverlay.d.ts} +1 -1
  74. package/@types/{ViewSlot.d.ts → view/ViewSlot.d.ts} +2 -2
  75. package/@types/{ViewTreeObserver.d.ts → view/ViewTreeObserver.d.ts} +1 -1
  76. package/@types/{Adapter.d.ts → widget/Adapter.d.ts} +2 -2
  77. package/@types/widget/DecorView.ts +5 -0
  78. package/@types/{EditRichText.d.ts → widget/EditRichText.d.ts} +4 -4
  79. package/@types/{EditText.d.ts → widget/EditText.d.ts} +1 -1
  80. package/@types/{FreezeLayoutViewGroup.d.ts → widget/FreezeLayoutViewGroup.d.ts} +1 -1
  81. package/@types/{GridView.d.ts → widget/GridView.d.ts} +1 -1
  82. package/@types/{HorizontalScrollView.ts → widget/HorizontalScrollView.ts} +1 -1
  83. package/@types/{Image.d.ts → widget/Image.d.ts} +1 -1
  84. package/@types/{ImageView.d.ts → widget/ImageView.d.ts} +1 -1
  85. package/@types/{ListView.d.ts → widget/ListView.d.ts} +1 -1
  86. package/@types/{ScrollView.d.ts → widget/ScrollView.d.ts} +1 -1
  87. package/@types/{Slot.d.ts → widget/Slot.d.ts} +1 -1
  88. package/@types/{TextView.d.ts → widget/TextView.d.ts} +1 -1
  89. package/@types/window/ApplicationWindow.ts +12 -0
  90. package/@types/window/PopupWindow.d.ts +41 -0
  91. package/@types/window/Window.d.ts +24 -0
  92. package/@types/{WindowManager.d.ts → window/WindowManager.d.ts} +8 -6
  93. package/index.d.ts +128 -111
  94. package/package.json +1 -1
  95. package/@types/Application.d.ts +0 -58
  96. package/@types/ApplicationWindow.d.ts +0 -46
  97. package/@types/Assets.d.ts +0 -6
  98. package/@types/Context.d.ts +0 -29
  99. package/@types/InputMethodService.d.ts +0 -6
  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/{Color.d.ts → canvas/Color.d.ts} +0 -0
  116. /package/@types/{ColorFilter.ts → canvas/ColorFilter.ts} +0 -0
  117. /package/@types/{ImageFilter.ts → canvas/ImageFilter.ts} +0 -0
  118. /package/@types/{PathEffect.ts → canvas/PathEffect.ts} +0 -0
  119. /package/@types/{RendererBackend.ts → canvas/RendererBackend.ts} +0 -0
  120. /package/@types/{Shader.d.ts → canvas/Shader.d.ts} +0 -0
  121. /package/@types/{Typeface.d.ts → canvas/Typeface.d.ts} +0 -0
  122. /package/@types/{Configuration.d.ts → content/Configuration.d.ts} +0 -0
  123. /package/@types/{DisplayMetrics.d.ts → content/DisplayMetrics.d.ts} +0 -0
  124. /package/@types/{PixelFormat.ts → content/PixelFormat.ts} +0 -0
  125. /package/@types/{Theme.d.ts → content/Theme.d.ts} +0 -0
  126. /package/@types/{Environment.ts → evaluate/Environment.ts} +0 -0
  127. /package/@types/{KeyEvent.d.ts → event/KeyEvent.d.ts} +0 -0
  128. /package/@types/{MotionEvent.d.ts → event/MotionEvent.d.ts} +0 -0
  129. /package/@types/{Editable.d.ts → text/Editable.d.ts} +0 -0
  130. /package/@types/{ViewOutlineProvider.d.ts → view/ViewOutlineProvider.d.ts} +0 -0
  131. /package/@types/{ViewParent.d.ts → view/ViewParent.d.ts} +0 -0
  132. /package/@types/{Button.d.ts → widget/Button.d.ts} +0 -0
  133. /package/@types/{FreezeAbsoluteLayout.d.ts → widget/FreezeAbsoluteLayout.d.ts} +0 -0
  134. /package/@types/{ListAdapter.d.ts → widget/ListAdapter.d.ts} +0 -0
@@ -0,0 +1,179 @@
1
+ /**
2
+ * EditContext API contract
3
+ *
4
+ * Aligned with W3C EditContext IDL: https://w3c.github.io/edit-context/
5
+ *
6
+ * Portable TypeScript surface for the upcoming cross-platform C++ implementation.
7
+ * Index units are UTF-16 code units. Ranges are [start, end).
8
+ */
9
+
10
+ /* =============================================================================
11
+ * Geometry
12
+ * ============================================================================= */
13
+
14
+ /** Axis-aligned rect in client / viewport coordinates. */
15
+ export interface DOMRectLike {
16
+ x?: number;
17
+ y?: number;
18
+ width?: number;
19
+ height?: number;
20
+ }
21
+
22
+ export type RectInput = DOMRectLike;
23
+
24
+ /* =============================================================================
25
+ * Enums (W3C)
26
+ * ============================================================================= */
27
+
28
+ export type UnderlineStyle = "none" | "solid" | "dotted" | "dashed" | "wavy";
29
+ export type UnderlineThickness = "none" | "thin" | "thick";
30
+
31
+ /* =============================================================================
32
+ * Init dictionaries
33
+ * ============================================================================= */
34
+
35
+ export interface EditContextInit {
36
+ text?: string;
37
+ selectionStart?: number;
38
+ selectionEnd?: number;
39
+ }
40
+
41
+ export interface TextUpdateEventInit {
42
+ updateRangeStart?: number;
43
+ updateRangeEnd?: number;
44
+ text?: string;
45
+ selectionStart?: number;
46
+ selectionEnd?: number;
47
+ }
48
+
49
+ export interface TextFormatInit {
50
+ rangeStart?: number;
51
+ rangeEnd?: number;
52
+ underlineStyle?: UnderlineStyle;
53
+ underlineThickness?: UnderlineThickness;
54
+ }
55
+
56
+ export interface TextFormatUpdateEventInit {
57
+ textFormats?: TextFormat[];
58
+ }
59
+
60
+ export interface CharacterBoundsUpdateEventInit {
61
+ rangeStart?: number;
62
+ rangeEnd?: number;
63
+ }
64
+
65
+ /* =============================================================================
66
+ * Formats & events
67
+ * ============================================================================= */
68
+
69
+ export interface TextFormat {
70
+ readonly rangeStart: number;
71
+ readonly rangeEnd: number;
72
+ readonly underlineStyle: UnderlineStyle;
73
+ readonly underlineThickness: UnderlineThickness;
74
+ }
75
+
76
+ export interface TextUpdateEvent {
77
+ readonly updateRangeStart: number;
78
+ readonly updateRangeEnd: number;
79
+ readonly text: string;
80
+ readonly selectionStart: number;
81
+ readonly selectionEnd: number;
82
+ }
83
+
84
+ export interface TextFormatUpdateEvent {
85
+ getTextFormats(): TextFormat[];
86
+ }
87
+
88
+ export interface CharacterBoundsUpdateEvent {
89
+ readonly rangeStart: number;
90
+ readonly rangeEnd: number;
91
+ }
92
+
93
+ export interface CompositionEvent {
94
+ readonly type: "compositionstart" | "compositionend";
95
+ readonly data: string;
96
+ }
97
+
98
+ export interface EditContextEventMap {
99
+ textupdate: TextUpdateEvent;
100
+ textformatupdate: TextFormatUpdateEvent;
101
+ characterboundsupdate: CharacterBoundsUpdateEvent;
102
+ compositionstart: CompositionEvent;
103
+ compositionend: CompositionEvent;
104
+ }
105
+
106
+ export type EditContextEventType = keyof EditContextEventMap;
107
+
108
+ export type EditContextEventListener<K extends EditContextEventType> = (ev: EditContextEventMap[K],) => void;
109
+
110
+ /* =============================================================================
111
+ * Host element
112
+ * ============================================================================= */
113
+
114
+ export interface EditContextHostElement {
115
+ readonly id?: string;
116
+ }
117
+
118
+ /* =============================================================================
119
+ * EditContext
120
+ * ============================================================================= */
121
+
122
+ export declare class EditContext {
123
+ readonly text: string;
124
+ readonly selectionStart: number;
125
+ readonly selectionEnd: number;
126
+ readonly characterBoundsRangeStart: number;
127
+ readonly isComposing: boolean;
128
+
129
+ startInput(): void;
130
+
131
+ updateText(rangeStart: number, rangeEnd: number, text: string): void;
132
+
133
+ updateSelection(start: number, end: number): void;
134
+
135
+ updateControlBounds(controlBounds: RectInput): void;
136
+
137
+ updateSelectionBounds(selectionBounds: RectInput): void;
138
+
139
+ updateCharacterBounds(rangeStart: number, characterBounds: readonly RectInput[]): void;
140
+
141
+ finishInput(): void;
142
+
143
+ characterBounds(): DOMRectLike[];
144
+
145
+ /** Associated host view(s); empty if not attached. */
146
+ attachedElements(): EditContextHostElement[];
147
+
148
+ addEventListener<K extends EditContextEventType>(type: K, listener: EditContextEventListener<K>): void;
149
+
150
+ removeEventListener<K extends EditContextEventType>(type: K, listener: EditContextEventListener<K>): void;
151
+
152
+ ontextupdate: EditContextEventListener<"textupdate"> | null;
153
+ oncompositionstart: EditContextEventListener<"compositionstart"> | null;
154
+ oncompositionend: EditContextEventListener<"compositionend"> | null;
155
+ ontextformatupdate: EditContextEventListener<"textformatupdate"> | null;
156
+ oncharacterboundsupdate: EditContextEventListener<"characterboundsupdate"> | null;
157
+ }
158
+
159
+ export interface EditContextConstructor {
160
+ new(options?: EditContextInit): EditContext;
161
+ }
162
+
163
+ export type EditContextCompositionPhase =
164
+ | "idle"
165
+ | "composing"
166
+ | "awaiting-character-bounds";
167
+
168
+ /* =============================================================================
169
+ * Virtual Keyboard (mobile companion; optional)
170
+ * ============================================================================= */
171
+
172
+ export interface VirtualKeyboard {
173
+ readonly boundingRect: DOMRectLike;
174
+ overlaysContent: boolean;
175
+ show(): void;
176
+ hide(): void;
177
+ addEventListener(type: "geometrychange", listener: () => void): void;
178
+ removeEventListener(type: "geometrychange", listener: () => void): void;
179
+ }
@@ -0,0 +1,3 @@
1
+ export interface CanvaskitPlatformHostConfig {
2
+ container?: string | HTMLElement
3
+ }
@@ -0,0 +1,4 @@
1
+ export interface NodePlatformHostConfig {
2
+ width: number;
3
+ height: number;
4
+ }
@@ -0,0 +1,3 @@
1
+ export interface WebPlatformHostConfig {
2
+ container?: string | HTMLElement
3
+ }
@@ -0,0 +1,17 @@
1
+ import { CharSequence } from "@compass-framework/library";
2
+ import { Rect } from "../canvas/Rect";
3
+ import { KeyEvent } from "../event/KeyEvent";
4
+
5
+ export interface InputConnection {
6
+ getCursor(flags: number): Rect;
7
+
8
+ setSelection(start: number, end: number): boolean;
9
+
10
+ getInputRect(): Rect;
11
+
12
+ sendKeyEvent(event: KeyEvent): boolean;
13
+
14
+ finishComposingText(): boolean
15
+
16
+ setComposingText(text: CharSequence, newCursorPosition: number): boolean;
17
+ }
@@ -0,0 +1,3 @@
1
+ export interface InputMethod {
2
+
3
+ }
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
 
3
3
  /**
4
4
  * 绝对定位布局,子视图按指定坐标放置。
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
 
3
3
  /**
4
4
  * 帧布局,子视图按添加顺序叠放,可通过 gravity 对齐。
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
 
3
3
  /**
4
4
  * 网格布局,按行与列排列子视图。
@@ -1,4 +1,4 @@
1
- import { LayoutAnimationController } from "./LayoutAnimationController";
1
+ import { LayoutAnimationController } from "../animation/LayoutAnimationController";
2
2
 
3
3
  /**
4
4
  * 网格布局动画控制器。
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
 
3
3
  /**
4
4
  * 线性布局,按水平或垂直方向依次排列子视图。
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
 
3
3
  /**
4
4
  * 相对布局,按相对关系定位子视图。
@@ -1,5 +1,5 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { View } from "./View";
2
+ import { View } from "../view/View";
3
3
  import { LinearLayout } from "./LinearLayout";
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
  import { LinearLayout } from "./LinearLayout";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
  import { LinearLayout } from "./LinearLayout";
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { Implements } from "@compass-framework/library";
2
2
  import { DoubleClickListener } from "./DoubleClickListener";
3
- import { View } from "./View";
4
- import { MotionEvent } from "./MotionEvent";
3
+ import { View } from "../view/View";
4
+ import { MotionEvent } from "../event/MotionEvent";
5
5
 
6
6
  /**
7
7
  * 双击手势识别器,将触摸事件转换为单击/双击回调。
@@ -1,6 +1,6 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { View } from "./View";
3
- import { MotionEvent } from "./MotionEvent";
2
+ import { View } from "../view/View";
3
+ import { MotionEvent } from "../event/MotionEvent";
4
4
 
5
5
  /**
6
6
  * 双击监听器,处理单击、双击与指针触摸回调。
@@ -1,4 +1,4 @@
1
- import { Context } from "./Context";
1
+ import { Context } from "../content/Context";
2
2
 
3
3
  /**
4
4
  * Context 工具类,用于创建子作用域上下文。
@@ -0,0 +1,7 @@
1
+ import { EditContext } from "../host/EditContext";
2
+
3
+ export interface EditorInfo {
4
+ initialSelStart: number
5
+ initialSelEnd: number
6
+ editContext: EditContext;
7
+ }
@@ -1,4 +1,4 @@
1
- import { Rect } from "./Rect";
1
+ import { Rect } from "../canvas/Rect";
2
2
 
3
3
  /**
4
4
  * 重力对齐常量与布局定位工具。
@@ -1,5 +1,5 @@
1
- import { Rect } from "./Rect";
2
- import { Context } from "./Context";
1
+ import { Rect } from "../canvas/Rect";
2
+ import { Context } from "../content/Context";
3
3
 
4
4
  /**
5
5
  * 轮廓,用于描述视图或 Drawable 的外形边界。
@@ -5,25 +5,25 @@ import {
5
5
  } from "@compass-framework/library";
6
6
 
7
7
  import { ViewOverlay } from "./ViewOverlay";
8
- import { Context } from "./Context";
9
- import { Configuration } from "./Configuration";
10
- import { Rect } from "./Rect";
11
- import { AttributeSet } from "./AttributeSet";
12
- import { Canvas } from "./Canvas";
13
- import { Transformation } from "./Transformation";
14
- import { KeyEvent } from "./KeyEvent";
15
- import { Drawable } from "./Drawable";
8
+ import { Context } from "../content/Context";
9
+ import { Configuration } from "../content/Configuration";
10
+ import { Rect } from "../canvas/Rect";
11
+ import { AttributeSet } from "../content/AttributeSet";
12
+ import { Canvas } from "../canvas/Canvas";
13
+ import { Transformation } from "../animation/Transformation";
14
+ import { KeyEvent } from "../event/KeyEvent";
15
+ import { Drawable } from "../drawable/Drawable";
16
16
  import { Outline } from "./Outline";
17
17
  import { ViewTreeObserver } from "./ViewTreeObserver";
18
18
  import { ViewGroup } from "./ViewGroup";
19
- import { Animation } from "./Animation";
20
- import { MotionEvent } from "./MotionEvent";
21
- import { Matrix } from "./Matrix";
22
- import { Resources } from "./Resources";
19
+ import { Animation } from "../animation/Animation";
20
+ import { MotionEvent } from "../event/MotionEvent";
21
+ import { Matrix } from "../canvas/Matrix";
22
+ import { Resources } from "../content/Resources";
23
23
  import { ViewParent } from "./ViewParent";
24
24
  import { ViewOutlineProvider } from "./ViewOutlineProvider";
25
- import { DisplayMetrics } from "./DisplayMetrics";
26
- import { Window } from "./Window";
25
+ import { DisplayMetrics } from "../content/DisplayMetrics";
26
+ import { Window } from "../window/Window";
27
27
 
28
28
  /**
29
29
  * 基础视图,负责测量、布局、绘制与事件分发。
@@ -1,10 +1,10 @@
1
1
  import { Implements } from "@compass-framework/library";
2
2
  import { View } from "./View";
3
- import { AttributeSet } from "./AttributeSet";
4
- import { Configuration } from "./Configuration";
3
+ import { AttributeSet } from "../content/AttributeSet";
4
+ import { Configuration } from "../content/Configuration";
5
5
  import { ViewParent } from "./ViewParent";
6
- import { MotionEvent } from "./MotionEvent";
7
- import { DisplayMetrics } from "./DisplayMetrics";
6
+ import { MotionEvent } from "../event/MotionEvent";
7
+ import { DisplayMetrics } from "../content/DisplayMetrics";
8
8
 
9
9
  /**
10
10
  * 视图组,可容纳并管理子视图的测量、布局与触摸分发。
@@ -1,5 +1,5 @@
1
1
  import { ViewOverlay } from "./ViewOverlay";
2
- import { Drawable } from "./Drawable";
2
+ import { Drawable } from "../drawable/Drawable";
3
3
  import { View } from "./View";
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { Drawable } from "./Drawable";
1
+ import { Drawable } from "../drawable/Drawable";
2
2
  import { ViewGroup } from "./ViewGroup";
3
3
 
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { Implements } from "@compass-framework/library";
2
- import { FrameLayout } from "./FrameLayout";
3
- import { Slot } from "./Slot";
2
+ import { FrameLayout } from "../layout/FrameLayout";
3
+ import { Slot } from "../widget/Slot";
4
4
  import { View } from "./View";
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
2
  import { View } from "./View";
3
- import { MotionEvent } from "./MotionEvent";
3
+ import { MotionEvent } from "../event/MotionEvent";
4
4
 
5
5
  /**
6
6
  * 视图树观察者,监听全局布局、绘制前与焦点/触摸变化。
@@ -1,6 +1,6 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { View } from "./View";
3
- import { ViewGroup } from "./ViewGroup";
2
+ import { View } from "../view/View";
3
+ import { ViewGroup } from "../view/ViewGroup";
4
4
 
5
5
  /**
6
6
  * 适配器接口,为列表类控件提供数据与视图绑定。
@@ -0,0 +1,5 @@
1
+ import { FrameLayout } from "../layout/FrameLayout";
2
+
3
+ export interface DecorView extends FrameLayout {
4
+
5
+ }
@@ -1,7 +1,7 @@
1
- import { FrameLayout } from "./FrameLayout";
2
- import { Context } from "./Context";
3
- import { AttributeSet } from "./AttributeSet";
4
- import { View } from "./View";
1
+ import { FrameLayout } from "../layout/FrameLayout";
2
+ import { Context } from "../content/Context";
3
+ import { AttributeSet } from "../content/AttributeSet";
4
+ import { View } from "../view/View";
5
5
 
6
6
  /**
7
7
  * 富文本编辑器,支持 HTML 互转与选区样式操作。
@@ -1,5 +1,5 @@
1
1
  import { TextView } from "./TextView";
2
- import { Editable } from "./Editable";
2
+ import { Editable } from "../text/Editable";
3
3
 
4
4
  /**
5
5
  * 可编辑文本框,支持输入、选区与只读控制。
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
 
3
3
  /**
4
4
  * 支持顶部/左侧区域冻结与独立滚动的视图组基类。
@@ -1,4 +1,4 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
2
  import { ListAdapter } from "./ListAdapter";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { FrameLayout } from "./FrameLayout";
1
+ import { FrameLayout } from "../layout/FrameLayout";
2
2
 
3
3
  /**
4
4
  * 水平滚动视图,可横向滚动显示超出范围的内容。
@@ -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
  * 位图图像,封装像素缓冲及其尺寸。
@@ -5,7 +5,7 @@ import {
5
5
 
6
6
  import {
7
7
  View,
8
- } from "./View";
8
+ } from "../view/View";
9
9
 
10
10
  /**
11
11
  * 图片视图,用于展示图像内容。
@@ -1,5 +1,5 @@
1
1
  import { ListAdapter } from "./ListAdapter";
2
- import { ViewGroup } from "./ViewGroup";
2
+ import { ViewGroup } from "../view/ViewGroup";
3
3
 
4
4
  /**
5
5
  * 列表视图,通过适配器展示可滚动的条目列表。
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FrameLayout,
3
- } from "./FrameLayout";
3
+ } from "../layout/FrameLayout";
4
4
 
5
5
  /**
6
6
  * 垂直滚动视图,可滚动显示超出范围的内容。
@@ -1,5 +1,5 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { View } from "./View";
2
+ import { View } from "../view/View";
3
3
 
4
4
  /**
5
5
  * 插槽接口,用于替换目标视图内容。
@@ -1,5 +1,5 @@
1
1
  import { CharSequence } from "@compass-framework/library";
2
- import { View } from "./View";
2
+ import { View } from "../view/View";
3
3
 
4
4
  /**
5
5
  * 文本视图,负责显示与样式化文本内容。
@@ -0,0 +1,12 @@
1
+ import { Context } from "../content/Context";
2
+ import { View } from "../view/View";
3
+ import { DecorView } from "../widget/DecorView";
4
+ import { Window } from "./Window";
5
+
6
+ export declare class ApplicationWindow extends Window {
7
+ public getCurrentFocus(): View;
8
+
9
+ public getContext(): Context;
10
+
11
+ public getDecorView(): DecorView;
12
+ }
@@ -0,0 +1,41 @@
1
+ import { WindowManager } from "./WindowManager";
2
+ import { View } from "../view/View";
3
+ import { Context } from "../content/Context";
4
+ import { DecorView } from "../widget/DecorView";
5
+
6
+ /**
7
+ * 弹出窗口,在指定位置展示浮动内容视图。
8
+ */
9
+ export declare class PopupWindow {
10
+ public constructor();
11
+
12
+ public showAtLocation(parent: View, gravity: number, x: number, y: number): void;
13
+
14
+ public isShowing() : boolean;
15
+
16
+ public isOutsideTouchable():boolean;
17
+
18
+ public dismiss(): void;
19
+
20
+ public update(x: number, y: number, width: number, height: number): void;
21
+
22
+ public getDecorView(): DecorView;
23
+
24
+ public getContentView(): View;
25
+
26
+ public getOnGenericMotionListener(): View.OnGenericMotionListener;
27
+
28
+ public getOnTouchListener(): View.OnTouchListener;
29
+
30
+ public getContext(): Context;
31
+
32
+ public getLayoutParams(): WindowManager.LayoutParams;
33
+
34
+ public setOnTouchListener(l: View.OnTouchListener): void;
35
+
36
+ public setContentView(contentView: View): void;
37
+
38
+ public setOutsideTouchable(touchable: boolean):void;
39
+
40
+ public setOnGenericMotionListener(l: View.OnGenericMotionListener): void;
41
+ }
@@ -0,0 +1,24 @@
1
+ import { ArrayList } from "@compass-framework/library";
2
+ import { View } from "../view/View";
3
+ import { DecorView } from "../widget/DecorView";
4
+ import { Context } from "../content/Context";
5
+ import { WindowManager } from "./WindowManager";
6
+
7
+ export declare abstract class Window {
8
+ public findViewById(id: number): View;
9
+ public findViewById(id: string): View;
10
+
11
+ public findViewByTag(tag: string): View;
12
+
13
+ public findViewsByTag(tag: string): ArrayList<View>;
14
+
15
+ public abstract getCurrentFocus(): View;
16
+
17
+ public abstract getContext(): Context;
18
+
19
+ public abstract getDecorView(): DecorView;
20
+
21
+ public getAttributes(): WindowManager.LayoutParams;
22
+
23
+ public setAttributes(a: WindowManager.LayoutParams): void;
24
+ }
@@ -1,16 +1,18 @@
1
- import { ViewGroup } from "./ViewGroup";
1
+ import { ViewGroup } from "../view/ViewGroup";
2
+ import { View } from "../view/View";
2
3
 
3
4
  /**
4
5
  * 窗口管理器,负责添加、移除与更新窗口布局。
5
6
  */
6
7
  export declare class WindowManager {
7
- public addWindow(window: Window): void;
8
- public addWindow(window: Window, params: WindowManager.LayoutParams): void;
8
+ public addView(view: View): void;
9
+ public addView(view: View, params: WindowManager.LayoutParams): void;
10
+ public addView(view: View, params: WindowManager.LayoutParams, nest: boolean): void;
9
11
 
10
- public removeWindow(window: Window): void;
12
+ public removeView(view: View): void;
11
13
 
12
- public updateWindowLayout(window: Window): void;
13
- public updateWindowLayout(window: Window, params: WindowManager.LayoutParams): void;
14
+ public updateViewLayout(view: View): void;
15
+ public updateViewLayout(view: View, params: WindowManager.LayoutParams): void;
14
16
  }
15
17
 
16
18
  /**