@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,24 @@
1
+ import { ContextWrapper } from "../content/ContextWrapper";
2
+ import { View } from "../view/View";
3
+ import { DecorView } from "../widget/DecorView";
4
+ import { ApplicationWindow } from "../window/ApplicationWindow";
5
+
6
+ export declare class Activity extends ContextWrapper {
7
+ public onCreate(): void;
8
+
9
+ public onStart(): void;
10
+
11
+ public onResume(): void;
12
+
13
+ public onPause(): void;
14
+
15
+ public onStop(): void;
16
+
17
+ public onDestroy(): void;
18
+
19
+ public setContentView(viewOrXml: View | string): void;
20
+
21
+ public getDecorView(): DecorView;
22
+
23
+ public getWindow(): ApplicationWindow;
24
+ }
@@ -0,0 +1,3 @@
1
+ import { Activity } from "./Activity";
2
+
3
+ export type ActivityType = new () => Activity;
@@ -0,0 +1 @@
1
+ export type ExtraValue = string | number | boolean;
@@ -0,0 +1,14 @@
1
+ import { ExtraValue } from "./ExtraValue";
2
+ import { ActivityType } from "./ActivityType";
3
+
4
+ export declare class Intent {
5
+ public constructor(component?: ActivityType);
6
+
7
+ public getStringExtra(key: string, fallback?: string): string;
8
+
9
+ public putExtra(key: string, value: ExtraValue): this;
10
+
11
+ public getIntExtra(key: string, fallback?: string): number;
12
+
13
+ public getBooleanExtra(key: string, fallback?: string): boolean;
14
+ }
@@ -1,6 +1,6 @@
1
1
  import { Transformation } from "./Transformation";
2
2
  import { Animation } from "./Animation";
3
- import { Context } from "./Context";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 透明度动画。
@@ -1,9 +1,9 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { Rect } from './Rect';
2
+ import { Rect } from '../canvas/Rect';
3
3
  import { Transformation } from './Transformation';
4
4
  import { Interpolator } from './Interpolator';
5
- import { AttributeSet } from "./AttributeSet";
6
- import { Context } from "./Context";
5
+ import { AttributeSet } from "../content/AttributeSet";
6
+ import { Context } from "../content/Context";
7
7
 
8
8
  /**
9
9
  * 视图动画的基类。
@@ -1,7 +1,7 @@
1
1
  import { List } from "@compass-framework/library";
2
2
  import { Animation } from "./Animation";
3
3
  import { Transformation } from "./Transformation";
4
- import { Context } from "./Context";
4
+ import { Context } from "../content/Context";
5
5
 
6
6
  /**
7
7
  * 动画集合,可组合多个动画同时播放。
@@ -2,7 +2,7 @@ import { Implements, InterfaceTemplate } from "@compass-framework/library";
2
2
 
3
3
  import {
4
4
  TimeInterpolator,
5
- } from "./TimeInterpolator";
5
+ } from "../animator/TimeInterpolator";
6
6
 
7
7
  /**
8
8
  * 插值器接口。
@@ -1,6 +1,6 @@
1
- import { AttributeSet } from "./AttributeSet";
2
- import { Context } from "./Context";
3
- import { View } from "./View";
1
+ import { AttributeSet } from "../content/AttributeSet";
2
+ import { Context } from "../content/Context";
3
+ import { View } from "../view/View";
4
4
  import { Interpolator } from "./Interpolator";
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { Animation } from "./Animation";
2
2
  import { Transformation } from "./Transformation";
3
- import { Context } from "./Context";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 旋转动画。
@@ -1,6 +1,6 @@
1
1
  import { Animation } from "./Animation";
2
2
  import { Transformation } from "./Transformation";
3
- import { Context } from "./Context";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 缩放动画。
@@ -1,5 +1,5 @@
1
- import { Matrix } from './Matrix';
2
- import { Context } from "./Context";
1
+ import { Matrix } from '../canvas/Matrix';
2
+ import { Context } from "../content/Context";
3
3
 
4
4
  /**
5
5
  * 变换信息,组合透明度与矩阵用于动画插值结果。
@@ -1,6 +1,6 @@
1
1
  import { Animation } from "./Animation";
2
2
  import { Transformation } from "./Transformation";
3
- import { Context } from "./Context";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 平移动画。
@@ -1,5 +1,5 @@
1
1
  import { ArrayList, InterfaceTemplate } from "@compass-framework/library";
2
- import { Context } from "./Context";
2
+ import { Context } from "../content/Context";
3
3
  import { TimeInterpolator } from "./TimeInterpolator";
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
2
  import { Animator } from "./Animator";
3
- import { Context } from "./Context";
3
+ import { Context } from "../content/Context";
4
4
  import { PropertyValuesHolder } from "./PropertyValuesHolder";
5
5
  import { TimeInterpolator } from "./TimeInterpolator";
6
6
  import { TypeEvaluator } from "./TypeEvaluator";
@@ -0,0 +1,11 @@
1
+ import { ContextWrapper } from "../content/ContextWrapper";
2
+ import { InputMethod } from "../imm/InputMethod";
3
+
4
+ /**
5
+ * 应用程序入口与生命周期管理。
6
+ */
7
+ export class Application extends ContextWrapper {
8
+ public constructor();
9
+
10
+ public setInputMethod(inputMethod: InputMethod): void;
11
+ }
@@ -0,0 +1,5 @@
1
+ import { ActivityType } from "../activity/ActivityType";
2
+
3
+ export interface ApplicationConfig {
4
+ launcher: ActivityType;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { ApplicationCreatorConfig } from "./ApplicationCreatorConfig";
2
+ import { ApplicationConfig } from "./ApplicationConfig";
3
+ import { Application } from "./Application";
4
+
5
+ export declare class ApplicationCreator<T extends keyof ApplicationCreatorConfig> {
6
+ public constructor(backend: T, creatorConfig: ApplicationCreatorConfig[T]);
7
+
8
+ public create(appConfig: ApplicationConfig): Promise<Application>;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { RendererBackend } from "../canvas/RendererBackend";
2
+ import { CanvaskitPlatformHostConfig } from "../host/backend/CanvaskitPlatformHostConfig";
3
+ import { WebPlatformHostConfig } from "../host/backend/WebPlatformHostConfig";
4
+ import { NodePlatformHostConfig } from "../host/backend/NodePlatformHostConfig";
5
+
6
+ export interface ApplicationCreatorConfig {
7
+ [RendererBackend.CanvasKit]: CanvaskitPlatformHostConfig,
8
+ [RendererBackend.Web]: WebPlatformHostConfig,
9
+ [RendererBackend.Node]: NodePlatformHostConfig,
10
+ }
@@ -3,7 +3,7 @@ import { Rect } from "./Rect";
3
3
  import { Paint } from "./Paint";
4
4
  import { Matrix } from "./Matrix";
5
5
  import { Path } from "./Path";
6
- import { Image } from "./Image";
6
+ import { Image } from "../widget/Image";
7
7
  import { ImageFilter } from "./ImageFilter";
8
8
 
9
9
  /**
@@ -1,5 +1,5 @@
1
1
  import { Implements, InterfaceTemplate } from "@compass-framework/library";
2
- import { Context } from "./Context";
2
+ import { Context } from "../content/Context";
3
3
  import { PathEffect } from "./PathEffect";
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
2
  import { Shader } from "./Shader";
3
- import { Context } from "./Context";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 线性渐变着色器。
@@ -1,6 +1,6 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
2
  import { Rect } from "./Rect";
3
- import { Context } from "./Context";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 二维变换矩阵,用于平移、缩放、旋转等几何变换。
@@ -4,7 +4,7 @@ import { Shadow } from "./Shadow";
4
4
  import { Rect } from "./Rect";
5
5
  import { Typeface } from "./Typeface";
6
6
  import { PathEffect } from "./PathEffect";
7
- import { Context } from "./Context";
7
+ import { Context } from "../content/Context";
8
8
  import { ColorFilter } from "./ColorFilter";
9
9
  import { BlendMode } from "./BlendMode";
10
10
  import { ImageFilter } from "./ImageFilter";
@@ -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
  /// ///////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,33 +1,33 @@
1
1
  import { BiFunction, Class } from "@compass-framework/library";
2
2
  import { Context } from "./Context";
3
- import { View } from "./View";
3
+ import { View } from "../view/View";
4
4
  import { AttributeSet } from "./AttributeSet";
5
5
 
6
6
  /**
7
7
  * XML 视图工厂注册表,按标签名创建视图实例。
8
8
  */
9
- export declare class XMLViewFactoryRegistry {
10
- public registryViewFactory<T extends View>(name: string, factory: XMLViewFactoryRegistry.Factory<T>, overwrite?: boolean): XMLViewFactoryRegistry;
9
+ export declare class ViewFactoryRegistry {
10
+ public registryViewFactory<T extends View>(name: string, factory: ViewFactoryRegistry.Factory<T>, overwrite?: boolean): ViewFactoryRegistry;
11
11
 
12
- public removeViewFactory(name: string): XMLViewFactoryRegistry;
12
+ public removeViewFactory(name: string): ViewFactoryRegistry;
13
13
 
14
- public registryViewClass<T extends View>(name: string, clazz: Class<T>, overwrite?: boolean): XMLViewFactoryRegistry;
14
+ public registryViewClass<T extends View>(name: string, clazz: Class<T>, overwrite?: boolean): ViewFactoryRegistry;
15
15
 
16
16
  public hasViewFactory(name: string): boolean;
17
17
 
18
- public setDefaultAttribute(name: string, value: string): XMLViewFactoryRegistry;
18
+ public setDefaultAttribute(name: string, value: string): ViewFactoryRegistry;
19
19
 
20
- public removeDefaultAttribute(name: string): XMLViewFactoryRegistry;
20
+ public removeDefaultAttribute(name: string): ViewFactoryRegistry;
21
21
 
22
- public getViewFactory<T extends View>(name: string): XMLViewFactoryRegistry.Factory<T>;
22
+ public getViewFactory<T extends View>(name: string): ViewFactoryRegistry.Factory<T>;
23
23
 
24
- public getDefaultAttribute(attr?: XMLViewFactoryRegistry.Attribute): XMLViewFactoryRegistry.Attribute;
24
+ public getDefaultAttribute(attr?: ViewFactoryRegistry.Attribute): ViewFactoryRegistry.Attribute;
25
25
  }
26
26
 
27
27
  /**
28
28
  * XMLViewFactoryRegistry 相关工厂与属性类型。
29
29
  */
30
- export declare namespace XMLViewFactoryRegistry {
30
+ export declare namespace ViewFactoryRegistry {
31
31
  /**
32
32
  * 默认属性键值映射。
33
33
  */
@@ -1,4 +1,4 @@
1
- import { View } from "./View";
1
+ import { View } from "../view/View";
2
2
 
3
3
  /**
4
4
  * 鼠标光标控制,支持锁定、悬停与重置。
@@ -1,6 +1,6 @@
1
1
  import { InterfaceTemplate } from "@compass-framework/library";
2
- import { Context } from "./Context";
3
- import { Surface } from "./Surface";
2
+ import { Context } from "../content/Context";
3
+ import { Surface } from "../canvas/Surface";
4
4
 
5
5
  /**
6
6
  * Surface 提供者,按设备尺寸创建绘制表面。
@@ -1,6 +1,6 @@
1
1
  import { Drawable } from "./Drawable";
2
- import { Canvas } from "./Canvas";
3
- import { Context } from "./Context";
2
+ import { Canvas } from "../canvas/Canvas";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 纯色 Drawable,用单一颜色填充自身边界。
@@ -1,6 +1,6 @@
1
1
  import { Drawable } from "./Drawable";
2
- import { Canvas } from "./Canvas";
3
- import { Context } from "./Context";
2
+ import { Canvas } from "../canvas/Canvas";
3
+ import { Context } from "../content/Context";
4
4
 
5
5
  /**
6
6
  * 圆角矩形 Drawable,支持填充色与描边。
@@ -1,11 +1,11 @@
1
1
  import { InterfaceTemplate, Runnable } from "@compass-framework/library";
2
- import { Resources } from "./Resources";
3
- import { Canvas } from "./Canvas";
4
- import { Outline } from "./Outline";
5
- import { Rect } from "./Rect";
6
- import { Configuration } from "./Configuration";
7
- import { Context } from "./Context";
8
- import { DisplayMetrics } from "./DisplayMetrics";
2
+ import { Resources } from "../content/Resources";
3
+ import { Canvas } from "../canvas/Canvas";
4
+ import { Outline } from "../view/Outline";
5
+ import { Rect } from "../canvas/Rect";
6
+ import { Configuration } from "../content/Configuration";
7
+ import { Context } from "../content/Context";
8
+ import { DisplayMetrics } from "../content/DisplayMetrics";
9
9
 
10
10
  /**
11
11
  * 可绘制对象的基类,封装边界、透明度与绘制回调。
@@ -1,7 +1,7 @@
1
1
  import { Drawable } from "./Drawable";
2
- import { Image } from "./Image";
3
- import { Canvas } from "./Canvas";
4
- import { Context } from "./Context";
2
+ import { Image } from "../widget/Image";
3
+ import { Canvas } from "../canvas/Canvas";
4
+ import { Context } from "../content/Context";
5
5
 
6
6
  /**
7
7
  * 图像 Drawable,将 Image 按重力对齐绘制到边界内。
@@ -1,8 +1,8 @@
1
1
  import { Implements, Runnable } from "@compass-framework/library";
2
2
  import { Drawable } from "./Drawable";
3
- import { Canvas } from "./Canvas";
4
- import { Resources } from "./Resources";
5
- import { Context } from "./Context";
3
+ import { Canvas } from "../canvas/Canvas";
4
+ import { Resources } from "../content/Resources";
5
+ import { Context } from "../content/Context";
6
6
 
7
7
  /**
8
8
  * 图层 Drawable,按顺序叠加绘制多个子 Drawable。
@@ -1,4 +1,4 @@
1
- import { Canvas } from "./Canvas";
1
+ import { Canvas } from "../canvas/Canvas";
2
2
 
3
3
  /**
4
4
  * 线性渐变 Drawable,按角度或方向填充渐变色。
@@ -1,9 +1,9 @@
1
1
  import { Consumer, Implements } from "@compass-framework/library";
2
- import { Paint } from "./Paint";
2
+ import { Paint } from "../canvas/Paint";
3
3
  import { ImageDrawable } from "./ImageDrawable";
4
- import { Picture } from "./Picture";
5
- import { ImageView } from "./ImageView";
6
- import { Context } from "./Context";
4
+ import { Picture } from "../canvas/Picture";
5
+ import { ImageView } from "../widget/ImageView";
6
+ import { Context } from "../content/Context";
7
7
 
8
8
  /**
9
9
  * 基于 Picture 的图像 Drawable,支持加载状态通知。
@@ -1,4 +1,4 @@
1
- import { Context } from "./Context";
1
+ import { Context } from "../content/Context";
2
2
 
3
3
  /**
4
4
  * 环境解析器,在 Context 挂载后解析命名参数。