@compass-framework/core 1.2.55 → 1.2.57
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/@types/AbsoluteLayout.d.ts +6 -0
- package/@types/AccelerateDecelerateInterpolator.d.ts +3 -0
- package/@types/AccelerateInterpolator.d.ts +3 -0
- package/@types/Adapter.d.ts +6 -0
- package/@types/AlphaAnimation.d.ts +6 -1
- package/@types/Animation.d.ts +15 -2
- package/@types/AnimationSet.d.ts +5 -1
- package/@types/Animator.d.ts +12 -0
- package/@types/Application.d.ts +49 -11
- package/@types/ApplicationWindow.d.ts +9 -5
- package/@types/ArrayAdapter.d.ts +3 -0
- package/@types/Assets.d.ts +3 -0
- package/@types/AttributeSet.d.ts +5 -2
- package/@types/BaseAdapter.d.ts +3 -0
- package/@types/BlendMode.ts +150 -0
- package/@types/BounceInterpolator.d.ts +3 -0
- package/@types/Button.d.ts +3 -0
- package/@types/Canvas.d.ts +46 -60
- package/@types/Color.d.ts +40 -30
- package/@types/ColorDrawable.d.ts +5 -1
- package/@types/ColorFilter.ts +15 -0
- package/@types/Configuration.d.ts +3 -0
- package/@types/Context.d.ts +21 -3
- package/@types/ContextUtils.d.ts +3 -0
- package/@types/CornerPathEffect.d.ts +26 -0
- package/@types/CornersDrawable.d.ts +15 -6
- package/@types/CycleInterpolator.d.ts +3 -0
- package/@types/DecelerateInterpolator.d.ts +3 -0
- package/@types/DisplayMetrics.d.ts +3 -0
- package/@types/DoubleClick.d.ts +3 -0
- package/@types/DoubleClickListener.d.ts +6 -0
- package/@types/Drawable.d.ts +20 -5
- package/@types/EditRichText.d.ts +3 -0
- package/@types/EditText.d.ts +3 -0
- package/@types/Editable.d.ts +6 -0
- package/@types/Environment.ts +3 -0
- package/@types/FrameLayout.d.ts +11 -1
- package/@types/FreezeAbsoluteLayout.d.ts +6 -0
- package/@types/FreezeLayoutViewGroup.d.ts +3 -0
- package/@types/Gravity.d.ts +3 -0
- package/@types/GridLayout.d.ts +6 -0
- package/@types/GridLayoutAnimationController.d.ts +3 -0
- package/@types/GridView.d.ts +3 -0
- package/@types/HorizontalScrollView.ts +3 -0
- package/@types/Image.d.ts +28 -0
- package/@types/ImageDrawable.ts +43 -0
- package/@types/ImageFilter.ts +13 -0
- package/@types/ImageView.d.ts +9 -0
- package/@types/InputMethodService.d.ts +6 -0
- package/@types/Interpolator.d.ts +6 -0
- package/@types/KeyEvent.d.ts +3 -0
- package/@types/LayerDrawable.d.ts +6 -2
- package/@types/LayoutAnimationController.d.ts +9 -0
- package/@types/LayoutInflater.ts +3 -0
- package/@types/LinearGradient.d.ts +22 -2
- package/@types/LinearGradientDrawable.d.ts +3 -0
- package/@types/LinearInterpolator.d.ts +3 -0
- package/@types/LinearLayout.d.ts +6 -0
- package/@types/ListAdapter.d.ts +6 -0
- package/@types/ListView.d.ts +3 -0
- package/@types/Matrix.d.ts +110 -53
- package/@types/MotionEvent.d.ts +9 -0
- package/@types/{ICursor.d.ts → MouseCursor.ts} +18 -7
- package/@types/Outline.d.ts +6 -2
- package/@types/Paint.d.ts +141 -76
- package/@types/Path.d.ts +86 -44
- package/@types/PathEffect.ts +7 -1
- package/@types/Picture.d.ts +24 -15
- package/@types/PictureDrawable.d.ts +7 -5
- package/@types/PixelFormat.ts +3 -0
- package/@types/PopupWindow.d.ts +9 -6
- package/@types/PropertyValuesHolder.d.ts +3 -0
- package/@types/Rect.d.ts +66 -43
- package/@types/RelativeLayout.d.ts +6 -0
- package/@types/RendererBackend.ts +8 -0
- package/@types/Resolver.ts +7 -2
- package/@types/Resources.d.ts +3 -0
- package/@types/ResourcesInflater.d.ts +3 -0
- package/@types/RotateAnimation.d.ts +7 -3
- package/@types/ScaleAnimation.d.ts +7 -3
- package/@types/ScrollView.d.ts +3 -0
- package/@types/Shader.d.ts +15 -1
- package/@types/Shadow.d.ts +32 -6
- package/@types/Slot.d.ts +9 -0
- package/@types/Surface.d.ts +32 -0
- package/@types/SurfaceProvider.d.ts +25 -0
- package/@types/TabBarLayout.d.ts +12 -0
- package/@types/TableLayout.d.ts +6 -0
- package/@types/TableRow.d.ts +6 -0
- package/@types/TextView.d.ts +3 -0
- package/@types/Theme.d.ts +9 -0
- package/@types/TimeInterpolator.d.ts +6 -0
- package/@types/Transformation.d.ts +6 -0
- package/@types/TranslateAnimation.d.ts +6 -2
- package/@types/TypeEvaluator.d.ts +3 -0
- package/@types/Typeface.d.ts +21 -3
- package/@types/TypefaceFactory.d.ts +40 -4
- package/@types/ValueAnimator.d.ts +12 -0
- package/@types/View.d.ts +66 -0
- package/@types/ViewGroup.d.ts +9 -0
- package/@types/ViewGroupOverlay.d.ts +3 -0
- package/@types/ViewOutlineProvider.d.ts +3 -0
- package/@types/ViewOverlay.d.ts +3 -0
- package/@types/ViewParent.d.ts +6 -0
- package/@types/ViewSlot.d.ts +3 -0
- package/@types/ViewTreeObserver.d.ts +27 -0
- package/@types/{IWindow.d.ts → Window.d.ts} +10 -4
- package/@types/WindowManager.d.ts +14 -6
- package/@types/XMLLayoutParser.d.ts +3 -0
- package/@types/XMLResourcesParser.d.ts +3 -0
- package/@types/XMLViewFactoryRegistry.d.ts +18 -0
- package/index.d.ts +111 -113
- package/package.json +2 -2
- package/@types/ApplicationBoot.ts +0 -10
- package/@types/ApplicationContext.d.ts +0 -3
- package/@types/ApplicationFrame.d.ts +0 -33
- package/@types/ApplicationFrameContext.ts +0 -5
- package/@types/ApplicationFrameObserver.d.ts +0 -17
- package/@types/ApplicationFrameSettings.ts +0 -5
- package/@types/ApplicationManifest.d.ts +0 -5
- package/@types/Bitmap.d.ts +0 -7
- package/@types/BitmapDrawable.d.ts +0 -31
- package/@types/CornerPathEffect.ts +0 -7
- package/@types/InputMethodServer.ts +0 -1
- package/@types/Readying.ts +0 -3
- package/@types/StackLayout.d.ts +0 -9
- package/@types/WindowContext.d.ts +0 -9
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ViewGroup } from "./ViewGroup";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* 绝对定位布局,子视图按指定坐标放置。
|
|
5
|
+
*/
|
|
3
6
|
export declare class AbsoluteLayout extends ViewGroup {}
|
|
4
7
|
|
|
5
8
|
export declare namespace AbsoluteLayout {
|
|
9
|
+
/**
|
|
10
|
+
* AbsoluteLayout 的布局参数,包含子视图的 X/Y 坐标。
|
|
11
|
+
*/
|
|
6
12
|
export class LayoutParams extends ViewGroup.LayoutParams {
|
|
7
13
|
public getX(): number;
|
|
8
14
|
|
package/@types/Adapter.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { InterfaceTemplate } from "@compass-framework/library";
|
|
|
2
2
|
import { View } from "./View";
|
|
3
3
|
import { ViewGroup } from "./ViewGroup";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 适配器接口,为列表类控件提供数据与视图绑定。
|
|
7
|
+
*/
|
|
5
8
|
export declare interface Adapter {
|
|
6
9
|
getCount(): number;
|
|
7
10
|
|
|
@@ -20,6 +23,9 @@ export declare interface Adapter {
|
|
|
20
23
|
getItemViewType(position: number): number;
|
|
21
24
|
}
|
|
22
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Adapter 的接口模板实现。
|
|
28
|
+
*/
|
|
23
29
|
export class Adapter extends InterfaceTemplate {
|
|
24
30
|
|
|
25
31
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Transformation } from "./Transformation";
|
|
2
|
+
import { Animation } from "./Animation";
|
|
3
|
+
import { Context } from "./Context";
|
|
2
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 透明度动画。
|
|
7
|
+
*/
|
|
3
8
|
export declare class AlphaAnimation extends Animation {
|
|
4
|
-
public constructor(fromAlpha: number, toAlpha: number);
|
|
9
|
+
public constructor(context: Context, fromAlpha: number, toAlpha: number) ;
|
|
5
10
|
|
|
6
11
|
public applyTransformation(interpolatedTime: number, t: Transformation): void;
|
|
7
12
|
|
package/@types/Animation.d.ts
CHANGED
|
@@ -3,7 +3,11 @@ import { Rect } from './Rect';
|
|
|
3
3
|
import { Transformation } from './Transformation';
|
|
4
4
|
import { Interpolator } from './Interpolator';
|
|
5
5
|
import { AttributeSet } from "./AttributeSet";
|
|
6
|
+
import { Context } from "./Context";
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* 视图动画的基类。
|
|
10
|
+
*/
|
|
7
11
|
export declare abstract class Animation {
|
|
8
12
|
public static INFINITE: number;
|
|
9
13
|
public static RESTART: number;
|
|
@@ -16,8 +20,8 @@ export declare abstract class Animation {
|
|
|
16
20
|
public static ZORDER_TOP: number;
|
|
17
21
|
public static ZORDER_BOTTOM: number;
|
|
18
22
|
|
|
19
|
-
protected constructor();
|
|
20
|
-
protected constructor(attribute: AttributeSet);
|
|
23
|
+
protected constructor(context: Context);
|
|
24
|
+
protected constructor(context: Context, attribute: AttributeSet);
|
|
21
25
|
|
|
22
26
|
public clone(): Animation;
|
|
23
27
|
|
|
@@ -107,7 +111,13 @@ export declare abstract class Animation {
|
|
|
107
111
|
public initializeInvalidateRegion(left: number, top: number, right: number, bottom: number): void;
|
|
108
112
|
}
|
|
109
113
|
|
|
114
|
+
/**
|
|
115
|
+
* 视图动画相关类型。
|
|
116
|
+
*/
|
|
110
117
|
export declare namespace Animation {
|
|
118
|
+
/**
|
|
119
|
+
* 动画生命周期监听器。
|
|
120
|
+
*/
|
|
111
121
|
export interface AnimationListener {
|
|
112
122
|
onAnimationStart(animation: Animation): void
|
|
113
123
|
|
|
@@ -116,6 +126,9 @@ export declare namespace Animation {
|
|
|
116
126
|
onAnimationRepeat(animation: Animation): void;
|
|
117
127
|
}
|
|
118
128
|
|
|
129
|
+
/**
|
|
130
|
+
* 动画生命周期监听器实现类。
|
|
131
|
+
*/
|
|
119
132
|
export class AnimationListener extends InterfaceTemplate {
|
|
120
133
|
|
|
121
134
|
}
|
package/@types/AnimationSet.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
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
5
|
|
|
6
|
+
/**
|
|
7
|
+
* 动画集合,可组合多个动画同时播放。
|
|
8
|
+
*/
|
|
5
9
|
export declare class AnimationSet extends Animation {
|
|
6
10
|
public static PROPERTY_FILL_AFTER_MASK: number;
|
|
7
11
|
public static PROPERTY_FILL_BEFORE_MASK: number;
|
|
@@ -12,7 +16,7 @@ export declare class AnimationSet extends Animation {
|
|
|
12
16
|
public static PROPERTY_MORPH_MATRIX_MASK: number;
|
|
13
17
|
public static PROPERTY_CHANGE_BOUNDS_MASK: number;
|
|
14
18
|
|
|
15
|
-
public constructor(shareInterpolator: boolean);
|
|
19
|
+
public constructor(context: Context, shareInterpolator: boolean) ;
|
|
16
20
|
|
|
17
21
|
public clone(): AnimationSet;
|
|
18
22
|
|
package/@types/Animator.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { ArrayList, InterfaceTemplate } from "@compass-framework/library";
|
|
|
2
2
|
import { Context } from "./Context";
|
|
3
3
|
import { TimeInterpolator } from "./TimeInterpolator";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 属性动画的基类。
|
|
7
|
+
*/
|
|
5
8
|
export declare abstract class Animator {
|
|
6
9
|
public constructor(context: Context);
|
|
7
10
|
|
|
@@ -40,7 +43,13 @@ export declare abstract class Animator {
|
|
|
40
43
|
public setupStartValues(): void;
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
/**
|
|
47
|
+
* 属性动画相关类型。
|
|
48
|
+
*/
|
|
43
49
|
export declare namespace Animator {
|
|
50
|
+
/**
|
|
51
|
+
* 动画器生命周期监听器。
|
|
52
|
+
*/
|
|
44
53
|
export interface AnimatorListener {
|
|
45
54
|
onAnimationStart(animation: Animator): void;
|
|
46
55
|
|
|
@@ -51,5 +60,8 @@ export declare namespace Animator {
|
|
|
51
60
|
onAnimationRepeat(animation: Animator): void;
|
|
52
61
|
}
|
|
53
62
|
|
|
63
|
+
/**
|
|
64
|
+
* 动画器生命周期监听器实现类。
|
|
65
|
+
*/
|
|
54
66
|
export class AnimatorListener extends InterfaceTemplate {}
|
|
55
67
|
}
|
package/@types/Application.d.ts
CHANGED
|
@@ -1,19 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Consumer } from "@compass-framework/library";
|
|
2
|
+
import { Context } from "./Context";
|
|
3
|
+
import { RendererBackend } from "./RendererBackend";
|
|
4
|
+
import { InputMethodService } from "./InputMethodService";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Web 端应用启动配置。
|
|
8
|
+
*/
|
|
9
|
+
export interface WebApplicationConfig {
|
|
10
|
+
ime?: () => InputMethodService
|
|
11
|
+
container?: string | HTMLElement
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* CanvasKit 渲染后端的应用启动配置。
|
|
16
|
+
*/
|
|
17
|
+
export interface CanvaskitApplicationConfig extends WebApplicationConfig {
|
|
18
|
+
|
|
19
|
+
}
|
|
7
20
|
|
|
8
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Node 端应用启动配置。
|
|
23
|
+
*/
|
|
24
|
+
export interface NodeApplicationConfig {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}
|
|
9
28
|
|
|
10
|
-
|
|
29
|
+
/**
|
|
30
|
+
* 应用程序入口与生命周期管理。
|
|
31
|
+
*/
|
|
32
|
+
export declare interface Application {
|
|
33
|
+
onReady(consumer: Consumer<Context>): void;
|
|
11
34
|
|
|
12
|
-
|
|
35
|
+
addWindow(window: Window): void;
|
|
13
36
|
|
|
14
|
-
|
|
37
|
+
removeWindow(window: Window): void;
|
|
38
|
+
}
|
|
15
39
|
|
|
16
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Application 工厂与配置映射。
|
|
42
|
+
*/
|
|
43
|
+
export namespace Application {
|
|
44
|
+
/**
|
|
45
|
+
* 按渲染后端区分的应用配置映射。
|
|
46
|
+
*/
|
|
47
|
+
export interface ApplicationConfig {
|
|
48
|
+
[RendererBackend.CanvasKit]: CanvaskitApplicationConfig,
|
|
49
|
+
[RendererBackend.Web]: WebApplicationConfig,
|
|
50
|
+
[RendererBackend.Node]: NodeApplicationConfig,
|
|
51
|
+
}
|
|
17
52
|
|
|
18
|
-
|
|
53
|
+
/**
|
|
54
|
+
* 按渲染后端创建应用实例。
|
|
55
|
+
*/
|
|
56
|
+
export function create<T extends keyof ApplicationConfig>(render: RendererBackend, config: ApplicationConfig[T]): Application;
|
|
19
57
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { ArrayList, Implements, XML } from "@compass-framework/library";
|
|
2
|
-
import { IWindow } from "./IWindow";
|
|
3
2
|
import { Resources } from "./Resources";
|
|
4
3
|
import { View } from "./View";
|
|
5
4
|
import { WindowContext } from "./WindowContext";
|
|
6
|
-
import { ViewGroup } from "./ViewGroup";
|
|
7
5
|
import { WindowManager } from "./WindowManager";
|
|
6
|
+
import { ViewGroup } from "./ViewGroup";
|
|
7
|
+
import { Context } from "./Context";
|
|
8
|
+
import { Window } from "./Window";
|
|
8
9
|
import { Configuration } from "./Configuration";
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* 应用程序主窗口,承载内容视图与窗口生命周期。
|
|
13
|
+
*/
|
|
14
|
+
@Implements(Window)
|
|
15
|
+
export declare class ApplicationWindow implements Window {
|
|
12
16
|
public constructor();
|
|
13
17
|
public constructor(context: WindowContext);
|
|
14
18
|
|
|
@@ -35,7 +39,7 @@ export declare class ApplicationWindow implements IWindow {
|
|
|
35
39
|
|
|
36
40
|
public getResources(): Resources;
|
|
37
41
|
|
|
38
|
-
public
|
|
42
|
+
public getContext(): Context;
|
|
39
43
|
|
|
40
44
|
public setContentXML(xml: XML): void;
|
|
41
45
|
|
package/@types/ArrayAdapter.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { BaseAdapter } from "./BaseAdapter";
|
|
|
4
4
|
import { Context } from "./Context";
|
|
5
5
|
import { ViewGroup } from "./ViewGroup";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* 基于数组/列表数据的通用适配器,支持增删排序与变更通知。
|
|
9
|
+
*/
|
|
7
10
|
export declare class ArrayAdapter<T> extends BaseAdapter {
|
|
8
11
|
public constructor(context: Context, textViewResourceId: number);
|
|
9
12
|
public constructor(context: Context, resource: number, textViewResourceId: number);
|
package/@types/Assets.d.ts
CHANGED
package/@types/AttributeSet.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { PictureDrawable } from "./PictureDrawable";
|
|
|
4
4
|
import { Drawable } from "./Drawable";
|
|
5
5
|
import { ColorDrawable } from "./ColorDrawable";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* 属性集合,从资源或布局中按名称读取类型化属性值。
|
|
9
|
+
*/
|
|
7
10
|
export declare abstract class AttributeSet {
|
|
8
11
|
public abstract getNumber(name: string, defaultValue?: number): number;
|
|
9
12
|
|
|
@@ -17,8 +20,6 @@ export declare abstract class AttributeSet {
|
|
|
17
20
|
|
|
18
21
|
public abstract getResources(): Resources;
|
|
19
22
|
|
|
20
|
-
public abstract getConvert<T, R>(name: string, action: Influence<string, Nullable<R>>, defaultValue?: R): R;
|
|
21
|
-
|
|
22
23
|
public abstract getText(name: string, defaultValue?: CharSequence): CharSequence;
|
|
23
24
|
|
|
24
25
|
public abstract getDimension(name: string, defaultValue?: number): number;
|
|
@@ -29,6 +30,8 @@ export declare abstract class AttributeSet {
|
|
|
29
30
|
|
|
30
31
|
public abstract getString(name: string, defaultValue?: string): string;
|
|
31
32
|
|
|
33
|
+
public abstract getConvert<T, R>(name: string, action: Influence<string, Nullable<R>>, defaultValue?: R): R;
|
|
34
|
+
|
|
32
35
|
public abstract getDrawable(name: string, defaultValue?: Drawable): Drawable;
|
|
33
36
|
|
|
34
37
|
public abstract getAttributeCount(): number;
|
package/@types/BaseAdapter.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { ListAdapter } from "./ListAdapter";
|
|
|
3
3
|
import { View } from "./View";
|
|
4
4
|
import { ViewGroup } from "./ViewGroup";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* 列表适配器基类,提供 ListAdapter 的默认实现骨架。
|
|
8
|
+
*/
|
|
6
9
|
@Implements(ListAdapter)
|
|
7
10
|
export declare abstract class BaseAdapter implements ListAdapter {
|
|
8
11
|
protected constructor();
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 混合模式,控制源像素与目标像素的合成方式。
|
|
3
|
+
*/
|
|
4
|
+
export enum BlendMode {
|
|
5
|
+
/**
|
|
6
|
+
* Clears the destination.
|
|
7
|
+
*/
|
|
8
|
+
Clear = "clear",
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Replaces the destination with the source.
|
|
12
|
+
*/
|
|
13
|
+
Src = "src",
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Preserves the destination and discards the source.
|
|
17
|
+
*/
|
|
18
|
+
Dst = "dst",
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Source over destination.
|
|
22
|
+
*/
|
|
23
|
+
SrcOver = "src-over",
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Destination over source.
|
|
27
|
+
*/
|
|
28
|
+
DstOver = "dst-over",
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Source inside destination.
|
|
32
|
+
*/
|
|
33
|
+
SrcIn = "src-in",
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Destination inside source.
|
|
37
|
+
*/
|
|
38
|
+
DstIn = "dst-in",
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Source outside destination.
|
|
42
|
+
*/
|
|
43
|
+
SrcOut = "src-out",
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Destination outside source.
|
|
47
|
+
*/
|
|
48
|
+
DstOut = "dst-out",
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Source atop destination.
|
|
52
|
+
*/
|
|
53
|
+
SrcATop = "src-atop",
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Destination atop source.
|
|
57
|
+
*/
|
|
58
|
+
DstATop = "dst-atop",
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Exclusive-or source and destination.
|
|
62
|
+
*/
|
|
63
|
+
Xor = "xor",
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Adds source and destination.
|
|
67
|
+
*/
|
|
68
|
+
Plus = "plus",
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Multiplies source and destination.
|
|
72
|
+
*/
|
|
73
|
+
Modulate = "modulate",
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Multiplies source and destination colors.
|
|
77
|
+
*/
|
|
78
|
+
Multiply = "multiply",
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Produces the inverse of multiply.
|
|
82
|
+
*/
|
|
83
|
+
Screen = "screen",
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Combines multiply and screen.
|
|
87
|
+
*/
|
|
88
|
+
Overlay = "overlay",
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Selects the darker color.
|
|
92
|
+
*/
|
|
93
|
+
Darken = "darken",
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Selects the lighter color.
|
|
97
|
+
*/
|
|
98
|
+
Lighten = "lighten",
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Brightens the destination to reflect the source.
|
|
102
|
+
*/
|
|
103
|
+
ColorDodge = "color-dodge",
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Darkens the destination to reflect the source.
|
|
107
|
+
*/
|
|
108
|
+
ColorBurn = "color-burn",
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Multiplies or screens depending on the source.
|
|
112
|
+
*/
|
|
113
|
+
HardLight = "hard-light",
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Soft-light blend.
|
|
117
|
+
*/
|
|
118
|
+
SoftLight = "soft-light",
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Subtracts the darker color from the lighter color.
|
|
122
|
+
*/
|
|
123
|
+
Difference = "difference",
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Similar to difference but with lower contrast.
|
|
127
|
+
*/
|
|
128
|
+
Exclusion = "exclusion",
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Preserves the hue of the source.
|
|
132
|
+
*/
|
|
133
|
+
Hue = "hue",
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Preserves the saturation of the source.
|
|
137
|
+
*/
|
|
138
|
+
Saturation = "saturation",
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Uses the hue and saturation of the source and
|
|
142
|
+
* the luminosity of the destination.
|
|
143
|
+
*/
|
|
144
|
+
Color = "color",
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Preserves the luminosity of the source.
|
|
148
|
+
*/
|
|
149
|
+
Luminosity = "luminosity",
|
|
150
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Implements } from "@compass-framework/library";
|
|
2
2
|
import { Interpolator } from "./Interpolator";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 弹跳插值器。
|
|
6
|
+
*/
|
|
4
7
|
@Implements(Interpolator)
|
|
5
8
|
export declare class BounceInterpolator implements Interpolator {
|
|
6
9
|
public getInterpolation(t: number): number;
|
package/@types/Button.d.ts
CHANGED
package/@types/Canvas.d.ts
CHANGED
|
@@ -1,110 +1,96 @@
|
|
|
1
1
|
import { CharSequence } from "@compass-framework/library";
|
|
2
|
-
import { Paint } from "./Paint";
|
|
3
|
-
import { Path } from "./Path";
|
|
4
|
-
import { Picture } from "./Picture";
|
|
5
2
|
import { Rect } from "./Rect";
|
|
3
|
+
import { Paint } from "./Paint";
|
|
6
4
|
import { Matrix } from "./Matrix";
|
|
7
|
-
import {
|
|
5
|
+
import { Path } from "./Path";
|
|
6
|
+
import { Image } from "./Image";
|
|
7
|
+
import { ImageFilter } from "./ImageFilter";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 画布,提供路径、文本、图像等绘制能力。
|
|
11
|
+
*/
|
|
12
|
+
export interface Canvas {
|
|
13
|
+
translate(dx: number, dy: number): void;
|
|
12
14
|
|
|
13
15
|
rotate(degrees: number): void;
|
|
14
16
|
rotate(degrees: number, px: number, py: number): void;
|
|
15
17
|
|
|
16
18
|
scale(sx: number, sy: number): void;
|
|
17
19
|
|
|
18
|
-
concat(matrix: Matrix): void;
|
|
19
|
-
|
|
20
|
-
translate(dx: number, dy: number): void;
|
|
21
|
-
|
|
22
20
|
save(): number;
|
|
23
21
|
|
|
24
22
|
restore(): void;
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
clipRRect(rect: Rect, radius: number): void;
|
|
25
|
+
clipRRect(rect: Rect, ltr: number, lbr: number, rtr: number, rbr: number): void;
|
|
26
|
+
clipRRect(left: number, top: number, right: number, bottom: number, ltr: number, lbr: number, rtr: number, rbr: number): void
|
|
27
|
+
|
|
28
|
+
saveLayer(paint: Paint, filter?: ImageFilter): number;
|
|
29
|
+
saveLayer(left: number, top: number, right: number, bottom: number, paint: Paint): number;
|
|
30
|
+
saveLayer(left:number, top:number, right:number, bottom:number, paint: Paint, filter?: ImageFilter): number;
|
|
31
|
+
|
|
32
|
+
restoreToCount(count: number): void
|
|
33
|
+
|
|
27
34
|
clearCanvas(rect: Rect): void;
|
|
28
|
-
clearCanvas(
|
|
35
|
+
clearCanvas(left: number, top: number, right: number, bottom: number): void;
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
getMatrix(): Matrix;
|
|
31
38
|
|
|
32
39
|
getClipBounds(): Rect;
|
|
33
40
|
getClipBounds(rect: Rect): boolean;
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
getSaveCount(): number
|
|
43
|
+
|
|
44
|
+
clipPath(path: Path): void;
|
|
36
45
|
|
|
37
46
|
getWidth(): number;
|
|
38
47
|
|
|
39
48
|
getHeight(): number;
|
|
40
49
|
|
|
41
|
-
clipRRect(rect: Rect, radius: number): void;
|
|
42
|
-
clipRRect(rect: Rect, ltr: number, lbr: number, rtr: number, rbr: number): void;
|
|
43
|
-
clipRRect(left: number, top: number, right: number, bottom: number, ltr: number, lbr: number, rtr: number, rbr: number): void;
|
|
44
|
-
|
|
45
|
-
clipPath(path: Path): void;
|
|
46
|
-
|
|
47
50
|
clipRect(rect: Rect): void;
|
|
48
51
|
clipRect(left: number, top: number, right: number, bottom: number): void;
|
|
49
52
|
|
|
53
|
+
concat(matrix: Matrix): void;
|
|
54
|
+
|
|
50
55
|
quickReject(rect: Rect): boolean;
|
|
51
|
-
quickReject(
|
|
56
|
+
quickReject(rect: Path): boolean;
|
|
52
57
|
quickReject(left: number, top: number, right: number, bottom: number): boolean;
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
drawArc(oval: Rect, startAngle: number, sweepAngle: number, useCenter: boolean, paint: Paint): void;
|
|
60
|
+
drawArc(left: number, top: number, right: number, bottom: number, startAngle: number, sweepAngle: number, useCenter: boolean, paint: Paint): void;
|
|
61
|
+
|
|
62
|
+
drawDashLines(pts: number[], dash: number[], offset: number, paint: Paint): void;
|
|
56
63
|
|
|
57
64
|
drawRect(rect: Rect, paint: Paint): void;
|
|
58
65
|
drawRect(left: number, top: number, right: number, bottom: number, paint: Paint): void;
|
|
59
66
|
|
|
60
|
-
drawLine(sx: number, sy: number, ex: number, ey: number, paint: Paint): void;
|
|
61
|
-
|
|
62
|
-
drawLines(pts: number[], paint: Paint): void;
|
|
63
|
-
|
|
64
67
|
drawPath(path: Path, paint: Paint): void;
|
|
65
68
|
|
|
66
|
-
drawRRect(rect: Rect, radius: number, paint: Paint): void;
|
|
67
|
-
drawRRect(rect: Rect, ltr: number, lbr: number, rtr: number, rbr: number, paint: Paint): void;
|
|
68
|
-
drawRRect(left: number, top: number, right: number, bottom: number, ltr: number, lbr: number, rtr: number, rbr: number, paint: Paint): void;
|
|
69
|
-
|
|
70
|
-
drawPicture(canvas: Picture): void;
|
|
71
|
-
drawPicture(canvas: Picture, dst: Rect): void;
|
|
72
|
-
drawPicture(canvas: Picture, dst: Rect, paint: Paint): void;
|
|
73
|
-
|
|
74
69
|
drawText(text: CharSequence, x: number, y: number, paint: Paint): void;
|
|
75
70
|
drawText(text: CharSequence, start: number, end: number, x: number, y: number, paint: Paint): void;
|
|
76
71
|
|
|
77
|
-
|
|
72
|
+
drawCircle(cx: number, cy: number, radius: number, paint: Paint): void;
|
|
78
73
|
|
|
79
|
-
|
|
74
|
+
drawLine(sx: number, sy: number, ex: number, ey: number, paint: Paint): void;
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
drawBitmap(bitmap: Bitmap, left: number, top: number, paint: Paint): void;
|
|
83
|
-
drawBitmap(bitmap: Bitmap, src: Rect, dst: Rect, paint: Paint): void;
|
|
76
|
+
drawLines(pts: number[], paint: Paint): void;
|
|
84
77
|
|
|
85
|
-
|
|
78
|
+
drawOval(oval: Rect, paint: Paint): void;
|
|
79
|
+
drawOval(left: number, top: number, right: number, bottom: number, paint: Paint): void;
|
|
86
80
|
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
drawImage(image: Image, paint: Paint): void;
|
|
82
|
+
drawImage(image: Image, dst: Rect, paint: Paint): void;
|
|
83
|
+
drawImage(image: Image, src: Rect, dst: Rect, paint: Paint): void
|
|
89
84
|
|
|
90
|
-
|
|
91
|
-
drawRGB(rect: Rect, r: number, g: number, b: number, paint: Paint): void;
|
|
92
|
-
drawRGB(left: number, top: number, right: number, bottom: number, r: number, g: number, b: number): void;
|
|
93
|
-
drawRGB(left: number, top: number, right: number, bottom: number, r: number, g: number, b: number, paint: Paint): void;
|
|
85
|
+
drawColor(color: number): void;
|
|
94
86
|
|
|
95
|
-
|
|
96
|
-
drawARGB(rect: Rect, a: number, r: number, g: number, b: number, paint: Paint): void;
|
|
97
|
-
drawARGB(left: number, top: number, right: number, bottom: number, a: number, r: number, g: number, b: number): void;
|
|
98
|
-
drawARGB(left: number, top: number, right: number, bottom: number, a: number, r: number, g: number, b: number, paint: Paint): void;
|
|
87
|
+
drawRGB(r: number, g: number, b: number): void;
|
|
99
88
|
|
|
100
|
-
|
|
101
|
-
drawColor(rect: Rect, color: number, paint: Paint): void;
|
|
102
|
-
drawColor(left: number, top: number, right: number, bottom: number, color: number): void;
|
|
103
|
-
drawColor(left: number, top: number, right: number, bottom: number, color: number, paint: Paint): void;
|
|
104
|
-
}
|
|
89
|
+
drawARGB(a: number, r: number, g: number, b: number): void;
|
|
105
90
|
|
|
106
|
-
|
|
107
|
-
|
|
91
|
+
drawRRect(rect: Rect, radius: number, paint: Paint): void;
|
|
92
|
+
drawRRect(rect: Rect, ltr: number, lbr: number, rtr: number, rbr: number, paint: Paint): void
|
|
93
|
+
drawRRect(left: number, top: number, right: number, bottom: number, ltr: number, lbr: number, rtr: number, rbr: number, paint: Paint): void
|
|
108
94
|
|
|
109
|
-
|
|
95
|
+
drawDashLine(sx: number, sy: number, ex: number, ey: number, dash: number[], offset: number, paint: Paint): void;
|
|
110
96
|
}
|