@compass-framework/core 1.2.22 → 1.2.23

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.
@@ -1,10 +1,10 @@
1
- import { DensityMetrics } from "./DensityMetrics";
2
1
  import { Theme } from "./Theme";
2
+ import { DisplayMetrics } from "./DisplayMetrics";
3
3
 
4
4
  export declare class Configuration {
5
5
  constructor(config: Configuration);
6
6
 
7
7
  getTheme(): Theme;
8
8
 
9
- getDensityMetrics(): DensityMetrics;
9
+ getDisplayMetrics(): DisplayMetrics;
10
10
  }
@@ -2,19 +2,8 @@ import { Drawable } from "./Drawable";
2
2
  import { Canvas } from "./Canvas";
3
3
  import { Resources } from "./Resources";
4
4
 
5
- export declare interface CornersInfo {
6
- leftTopRadius?: number,
7
- leftBottomRadius?: number,
8
- rightTopRadius?: number,
9
- rightBottomRadius?: number,
10
- radius?: number,
11
- borderStrokeColor?: number,
12
- backgroundColor?: number,
13
- borderStrokeWidth?: number
14
- }
15
-
16
5
  export declare class CornersDrawable extends Drawable {
17
- public constructor(info: CornersInfo, resources?: Resources);
6
+ public constructor(info: CornersDrawable.CornersInfo, resources?: Resources);
18
7
 
19
8
  public draw(canvas: Canvas): void;
20
9
 
@@ -46,3 +35,16 @@ export declare class CornersDrawable extends Drawable {
46
35
 
47
36
  public setRightBottomRadius(radius: number): void;
48
37
  }
38
+
39
+ export namespace CornersDrawable {
40
+ export interface CornersInfo {
41
+ leftTopRadius?: number,
42
+ leftBottomRadius?: number,
43
+ rightTopRadius?: number,
44
+ rightBottomRadius?: number,
45
+ radius?: number,
46
+ borderStrokeColor?: number,
47
+ backgroundColor?: number,
48
+ borderStrokeWidth?: number
49
+ }
50
+ }
@@ -1,7 +1,13 @@
1
- import { DensityMetrics } from "./DensityMetrics";
1
+ export class DisplayMetrics {
2
+ public dp2px(dp: number): number;
3
+
4
+ public px2dp(px: number): number;
5
+
6
+ public set(dm: DisplayMetrics): void;
2
7
 
3
- export class DisplayMetrics extends DensityMetrics {
4
8
  public getWidth(): number;
5
9
 
6
10
  public getHeight(): number;
11
+
12
+ public getDensity(): number;
7
13
  }
@@ -4,7 +4,7 @@ import { Canvas } from "./Canvas";
4
4
  import { Configuration } from "./Configuration";
5
5
  import { Outline } from "./Outline";
6
6
  import { Resources } from "./Resources";
7
- import { DensityMetrics } from "./DensityMetrics";
7
+ import { DisplayMetrics } from "./DisplayMetrics";
8
8
 
9
9
  export declare abstract class Drawable {
10
10
  protected constructor();
@@ -39,7 +39,7 @@ export declare abstract class Drawable {
39
39
 
40
40
  public getIntrinsicHeight():number;
41
41
 
42
- public getDensityMetrics(): DensityMetrics;
42
+ public getDisplayMetrics(): DisplayMetrics;
43
43
 
44
44
  public setBounds(bounds: Rect): void;
45
45
  public setBounds(left: number, top: number, right: number, bottom: number): void;
package/@types/View.d.ts CHANGED
@@ -7,7 +7,6 @@ import {
7
7
  import { ViewOverlay } from "./ViewOverlay";
8
8
  import { Context } from "./Context";
9
9
  import { Configuration } from "./Configuration";
10
- import { DensityMetrics } from "./DensityMetrics";
11
10
  import { Rect } from "./Rect";
12
11
  import { AttributeSet } from "./AttributeSet";
13
12
  import { Canvas } from "./Canvas";
@@ -23,6 +22,7 @@ import { Matrix } from "./Matrix";
23
22
  import { Resources } from "./Resources";
24
23
  import { ViewParent } from "./ViewParent";
25
24
  import { ViewOutlineProvider } from "./ViewOutlineProvider";
25
+ import { DisplayMetrics } from "./DisplayMetrics";
26
26
 
27
27
  export declare class View implements Drawable.Callback {
28
28
  public static resolveSize(size: number, measureSpec: number): number;
@@ -123,7 +123,7 @@ export declare class View implements Drawable.Callback {
123
123
 
124
124
  public getY(): number;
125
125
 
126
- public getDensityMetrics(): DensityMetrics;
126
+ public getDisplayMetrics(): DisplayMetrics;
127
127
 
128
128
  public getScrollX(): number;
129
129
 
@@ -4,7 +4,7 @@ import { AttributeSet } from "./AttributeSet";
4
4
  import { Configuration } from "./Configuration";
5
5
  import { ViewParent } from "./ViewParent";
6
6
  import { MotionEvent } from "./MotionEvent";
7
- import { DensityMetrics } from "./DensityMetrics";
7
+ import { DisplayMetrics } from "./DisplayMetrics";
8
8
 
9
9
  @Implements(ViewParent)
10
10
  export declare abstract class ViewGroup extends View implements ViewParent {
@@ -66,7 +66,7 @@ export declare namespace ViewGroup {
66
66
 
67
67
  public onDensityMetricsChanged(newConfig: Configuration): void;
68
68
 
69
- public getDensityMetrics(): DensityMetrics;
69
+ public getDisplayMetrics(): DisplayMetrics;
70
70
 
71
71
  public getWidth(): number;
72
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-framework/core",
3
- "version": "1.2.22",
3
+ "version": "1.2.23",
4
4
  "description": "@compass-framework/core public api",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./index.js",
@@ -1,11 +0,0 @@
1
- export declare class DensityMetrics {
2
- public constructor(density?: number);
3
-
4
- public dp2px(dp: number): number;
5
-
6
- public px2dp(px: number): number;
7
-
8
- public set(dm: DensityMetrics): void;
9
-
10
- public getDensity(): number;
11
- }