@revideo/2d 0.4.0 → 0.4.1-cat.995

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 (123) hide show
  1. package/editor/editor/tsconfig.build.tsbuildinfo +1 -1
  2. package/editor/index.js +380 -151
  3. package/editor/index.js.map +1 -1
  4. package/lib/code/CodeCursor.d.ts +74 -74
  5. package/lib/code/CodeDiffer.d.ts +21 -16
  6. package/lib/code/CodeDiffer.js +39 -41
  7. package/lib/code/CodeFragment.d.ts +16 -8
  8. package/lib/code/CodeFragment.js +36 -36
  9. package/lib/code/CodeHighlighter.d.ts +59 -59
  10. package/lib/code/CodeHighlighter.js +1 -1
  11. package/lib/code/CodeMetrics.d.ts +12 -8
  12. package/lib/code/CodeMetrics.js +26 -24
  13. package/lib/code/CodeRange.d.ts +21 -5
  14. package/lib/code/CodeRange.js +131 -124
  15. package/lib/code/CodeScope.d.ts +18 -8
  16. package/lib/code/CodeSelection.d.ts +9 -4
  17. package/lib/code/CodeSelection.js +8 -8
  18. package/lib/code/CodeSignal.d.ts +74 -47
  19. package/lib/code/CodeTokenizer.d.ts +1 -1
  20. package/lib/code/CodeTokenizer.js +41 -41
  21. package/lib/code/DefaultHighlightStyle.d.ts +2 -2
  22. package/lib/code/DefaultHighlightStyle.js +96 -96
  23. package/lib/code/LezerHighlighter.d.ts +21 -19
  24. package/lib/code/diff.d.ts +12 -9
  25. package/lib/code/diff.js +218 -205
  26. package/lib/code/extractRange.d.ts +7 -4
  27. package/lib/code/extractRange.js +79 -71
  28. package/lib/code/index.d.ts +1 -1
  29. package/lib/code/index.js +1 -1
  30. package/lib/components/Audio.d.ts +11 -11
  31. package/lib/components/Bezier.d.ts +18 -18
  32. package/lib/components/Circle.d.ts +95 -90
  33. package/lib/components/Code.d.ts +244 -211
  34. package/lib/components/CodeBlock.d.ts +1 -1
  35. package/lib/components/CubicBezier.d.ts +36 -36
  36. package/lib/components/Curve.d.ts +208 -198
  37. package/lib/components/Grid.d.ts +47 -42
  38. package/lib/components/Icon.d.ts +55 -50
  39. package/lib/components/Img.d.ts +86 -79
  40. package/lib/components/Knot.d.ts +97 -78
  41. package/lib/components/Latex.d.ts +12 -12
  42. package/lib/components/Layout.d.ts +455 -413
  43. package/lib/components/Line.d.ts +61 -49
  44. package/lib/components/Node.d.ts +1 -1
  45. package/lib/components/Path.d.ts +1 -1
  46. package/lib/components/Polygon.d.ts +60 -55
  47. package/lib/components/QuadBezier.d.ts +29 -29
  48. package/lib/components/Ray.d.ts +28 -28
  49. package/lib/components/Rect.d.ts +115 -108
  50. package/lib/components/SVG.d.ts +1 -1
  51. package/lib/components/Shape.d.ts +1 -1
  52. package/lib/components/Spline.d.ts +46 -40
  53. package/lib/components/Txt.d.ts +55 -44
  54. package/lib/components/TxtLeaf.d.ts +20 -16
  55. package/lib/components/View2D.d.ts +22 -22
  56. package/lib/components/index.d.ts +1 -1
  57. package/lib/components/types.d.ts +22 -9
  58. package/lib/curves/ArcSegment.d.ts +36 -24
  59. package/lib/curves/CircleSegment.d.ts +26 -16
  60. package/lib/curves/CubicBezierSegment.d.ts +18 -13
  61. package/lib/curves/CurveDrawingInfo.d.ts +9 -9
  62. package/lib/curves/CurvePoint.d.ts +13 -13
  63. package/lib/curves/CurveProfile.d.ts +5 -5
  64. package/lib/curves/CurveProfile.js +1 -1
  65. package/lib/curves/KnotInfo.d.ts +8 -8
  66. package/lib/curves/LineSegment.d.ts +19 -14
  67. package/lib/curves/Polynomial.d.ts +110 -110
  68. package/lib/curves/Polynomial2D.d.ts +20 -20
  69. package/lib/curves/PolynomialSegment.d.ts +42 -37
  70. package/lib/curves/QuadBezierSegment.d.ts +12 -12
  71. package/lib/curves/Segment.d.ts +12 -7
  72. package/lib/curves/UniformPolynomialCurveSampler.d.ts +34 -34
  73. package/lib/curves/createCurveProfileLerp.d.ts +17 -6
  74. package/lib/curves/getBezierSplineProfile.d.ts +8 -4
  75. package/lib/curves/getCircleProfile.d.ts +10 -4
  76. package/lib/curves/getPathProfile.d.ts +2 -2
  77. package/lib/curves/getPointAtDistance.d.ts +7 -4
  78. package/lib/curves/getPolylineProfile.d.ts +8 -4
  79. package/lib/curves/getRectProfile.d.ts +9 -4
  80. package/lib/curves/index.d.ts +1 -1
  81. package/lib/curves/index.js +1 -1
  82. package/lib/decorators/canvasStyleSignal.d.ts +3 -3
  83. package/lib/decorators/colorSignal.d.ts +1 -1
  84. package/lib/decorators/compound.d.ts +4 -2
  85. package/lib/decorators/computed.d.ts +1 -1
  86. package/lib/decorators/defaultStyle.d.ts +5 -2
  87. package/lib/decorators/filtersSignal.d.ts +28 -8
  88. package/lib/decorators/index.d.ts +1 -1
  89. package/lib/decorators/index.js +1 -1
  90. package/lib/decorators/initializers.d.ts +5 -2
  91. package/lib/decorators/initializers.js +18 -19
  92. package/lib/decorators/nodeName.d.ts +1 -1
  93. package/lib/decorators/nodeName.js +4 -4
  94. package/lib/decorators/signal.d.ts +40 -20
  95. package/lib/decorators/spacingSignal.d.ts +1 -1
  96. package/lib/decorators/vector2Signal.d.ts +13 -7
  97. package/lib/index.d.ts +1 -1
  98. package/lib/index.js +1 -1
  99. package/lib/jsx-dev-runtime.d.ts +3 -3
  100. package/lib/jsx-dev-runtime.js +3 -3
  101. package/lib/jsx-runtime.d.ts +19 -9
  102. package/lib/jsx-runtime.js +18 -18
  103. package/lib/partials/Filter.d.ts +24 -16
  104. package/lib/partials/Gradient.d.ts +30 -24
  105. package/lib/partials/Pattern.d.ts +14 -9
  106. package/lib/partials/ShaderConfig.d.ts +81 -74
  107. package/lib/partials/index.d.ts +1 -1
  108. package/lib/partials/index.js +1 -1
  109. package/lib/partials/types.d.ts +19 -6
  110. package/lib/scenes/Scene2D.d.ts +42 -23
  111. package/lib/scenes/index.d.ts +1 -1
  112. package/lib/scenes/index.js +1 -1
  113. package/lib/scenes/makeScene2D.d.ts +7 -5
  114. package/lib/scenes/useScene2D.d.ts +2 -2
  115. package/lib/tsconfig.build.tsbuildinfo +1 -1
  116. package/lib/utils/diff.d.ts +25 -18
  117. package/lib/utils/diff.js +84 -87
  118. package/lib/utils/index.d.ts +1 -1
  119. package/lib/utils/index.js +1 -1
  120. package/lib/utils/is.d.ts +4 -2
  121. package/lib/utils/is.js +2 -2
  122. package/lib/utils/makeSignalExtensions.d.ts +11 -4
  123. package/package.json +5 -5
@@ -1,15 +1,23 @@
1
- import { BBox, PossibleVector2, SignalValue, SimpleSignal, ThreadGenerator, TimingFunction, Vector2 } from '@revideo/core';
2
- import { CurveProfile } from '../curves';
3
- import { Curve, CurveProps } from './Curve';
1
+ import {
2
+ BBox,
3
+ PossibleVector2,
4
+ SignalValue,
5
+ SimpleSignal,
6
+ ThreadGenerator,
7
+ TimingFunction,
8
+ Vector2,
9
+ } from '@revideo/core';
10
+ import {CurveProfile} from '../curves';
11
+ import {Curve, CurveProps} from './Curve';
4
12
  export interface LineProps extends CurveProps {
5
- /**
6
- * {@inheritDoc Line.radius}
7
- */
8
- radius?: SignalValue<number>;
9
- /**
10
- * {@inheritDoc Line.points}
11
- */
12
- points?: SignalValue<SignalValue<PossibleVector2>[]>;
13
+ /**
14
+ * {@inheritDoc Line.radius}
15
+ */
16
+ radius?: SignalValue<number>;
17
+ /**
18
+ * {@inheritDoc Line.points}
19
+ */
20
+ points?: SignalValue<SignalValue<PossibleVector2>[]>;
13
21
  }
14
22
  /**
15
23
  * A node for drawing lines and polygons.
@@ -117,42 +125,46 @@ export interface LineProps extends CurveProps {
117
125
  * ```
118
126
  */
119
127
  export declare class Line extends Curve {
120
- /**
121
- * Rotate the points to minimize the overall distance traveled when tweening.
122
- *
123
- * @param points - The points to rotate.
124
- * @param reference - The reference points to which the distance is measured.
125
- * @param closed - Whether the points form a closed polygon.
126
- */
127
- private static rotatePoints;
128
- /**
129
- * Distribute additional points along the polyline.
130
- *
131
- * @param points - The points of a polyline along which new points should be
132
- * distributed.
133
- * @param count - The number of points to add.
134
- */
135
- private static distributePoints;
136
- /**
137
- * The radius of the line's corners.
138
- */
139
- readonly radius: SimpleSignal<number, this>;
140
- /**
141
- * The points of the line.
142
- *
143
- * @remarks
144
- * When set to `null`, the Line will use the positions of its children as
145
- * points.
146
- */
147
- readonly points: SimpleSignal<SignalValue<PossibleVector2>[] | null, this>;
148
- protected tweenPoints(value: SignalValue<SignalValue<PossibleVector2>[] | null>, time: number, timingFunction: TimingFunction): ThreadGenerator;
149
- private tweenedPoints;
150
- constructor(props: LineProps);
151
- protected childrenBBox(): BBox;
152
- parsedPoints(): Vector2[];
153
- profile(): CurveProfile;
154
- protected lineWidthCoefficient(): number;
155
- drawOverlay(context: CanvasRenderingContext2D, matrix: DOMMatrix): void;
156
- private parsePoints;
128
+ /**
129
+ * Rotate the points to minimize the overall distance traveled when tweening.
130
+ *
131
+ * @param points - The points to rotate.
132
+ * @param reference - The reference points to which the distance is measured.
133
+ * @param closed - Whether the points form a closed polygon.
134
+ */
135
+ private static rotatePoints;
136
+ /**
137
+ * Distribute additional points along the polyline.
138
+ *
139
+ * @param points - The points of a polyline along which new points should be
140
+ * distributed.
141
+ * @param count - The number of points to add.
142
+ */
143
+ private static distributePoints;
144
+ /**
145
+ * The radius of the line's corners.
146
+ */
147
+ readonly radius: SimpleSignal<number, this>;
148
+ /**
149
+ * The points of the line.
150
+ *
151
+ * @remarks
152
+ * When set to `null`, the Line will use the positions of its children as
153
+ * points.
154
+ */
155
+ readonly points: SimpleSignal<SignalValue<PossibleVector2>[] | null, this>;
156
+ protected tweenPoints(
157
+ value: SignalValue<SignalValue<PossibleVector2>[] | null>,
158
+ time: number,
159
+ timingFunction: TimingFunction,
160
+ ): ThreadGenerator;
161
+ private tweenedPoints;
162
+ constructor(props: LineProps);
163
+ protected childrenBBox(): BBox;
164
+ parsedPoints(): Vector2[];
165
+ profile(): CurveProfile;
166
+ protected lineWidthCoefficient(): number;
167
+ drawOverlay(context: CanvasRenderingContext2D, matrix: DOMMatrix): void;
168
+ private parsePoints;
157
169
  }
158
- //# sourceMappingURL=Line.d.ts.map
170
+ //# sourceMappingURL=Line.d.ts.map
@@ -231,7 +231,7 @@ export declare class Node implements Promisable<Node> {
231
231
  readonly composite: SimpleSignal<boolean, this>;
232
232
  readonly compositeOperation: SimpleSignal<GlobalCompositeOperation, this>;
233
233
  private readonly compositeOverride;
234
- protected tweenCompositeOperation(value: SignalValue<GlobalCompositeOperation>, time: number, timingFunction: TimingFunction): Generator<void | ThreadGenerator | Promise<any> | Promisable<any>, void, any>;
234
+ protected tweenCompositeOperation(value: SignalValue<GlobalCompositeOperation>, time: number, timingFunction: TimingFunction): Generator<void | Promise<any> | ThreadGenerator | Promisable<any>, void, any>;
235
235
  /**
236
236
  * Represents the opacity of this node in the range 0-1.
237
237
  *
@@ -12,7 +12,7 @@ export declare class Path extends Curve {
12
12
  protected childrenBBox(): BBox;
13
13
  protected lineWidthCoefficient(): number;
14
14
  protected processSubpath(path: Path2D, startPoint: Vector2 | null, endPoint: Vector2 | null): void;
15
- protected tweenData(newPath: SignalValue<string>, time: number, timingFunction: TimingFunction): Generator<void | import("@revideo/core").ThreadGenerator | Promise<any> | import("@revideo/core").Promisable<any>, void, any>;
15
+ protected tweenData(newPath: SignalValue<string>, time: number, timingFunction: TimingFunction): Generator<void | Promise<any> | import("@revideo/core").ThreadGenerator | import("@revideo/core").Promisable<any>, void, any>;
16
16
  drawOverlay(context: CanvasRenderingContext2D, matrix: DOMMatrix): void;
17
17
  }
18
18
  //# sourceMappingURL=Path.d.ts.map
@@ -1,16 +1,21 @@
1
- import { BBox, SerializedVector2, SignalValue, SimpleSignal } from '@revideo/core';
2
- import { CurveProfile } from '../curves';
3
- import { DesiredLength } from '../partials';
4
- import { Curve, CurveProps } from './Curve';
1
+ import {
2
+ BBox,
3
+ SerializedVector2,
4
+ SignalValue,
5
+ SimpleSignal,
6
+ } from '@revideo/core';
7
+ import {CurveProfile} from '../curves';
8
+ import {DesiredLength} from '../partials';
9
+ import {Curve, CurveProps} from './Curve';
5
10
  export interface PolygonProps extends CurveProps {
6
- /**
7
- * {@inheritDoc Polygon.sides}
8
- */
9
- sides?: SignalValue<number>;
10
- /**
11
- * {@inheritDoc Polygon.radius}
12
- */
13
- radius?: SignalValue<number>;
11
+ /**
12
+ * {@inheritDoc Polygon.sides}
13
+ */
14
+ sides?: SignalValue<number>;
15
+ /**
16
+ * {@inheritDoc Polygon.radius}
17
+ */
18
+ radius?: SignalValue<number>;
14
19
  }
15
20
  /**
16
21
  * A node for drawing regular polygons.
@@ -65,47 +70,47 @@ export interface PolygonProps extends CurveProps {
65
70
  * ```
66
71
  */
67
72
  export declare class Polygon extends Curve {
68
- /**
69
- * The number of sides of the polygon.
70
- *
71
- * @remarks
72
- * For example, a value of 6 creates a hexagon.
73
- *
74
- * @example
75
- * ```tsx
76
- * <Polygon
77
- * size={320}
78
- * sides={7}
79
- * stroke={'#fff'}
80
- * lineWidth={8}
81
- * fill={'lightseagreen'}
82
- * />
83
- * ```
84
- */
85
- readonly sides: SimpleSignal<number, this>;
86
- /**
87
- * The radius of the polygon's corners.
88
- *
89
- * @example
90
- * ```tsx
91
- * <Polygon
92
- * radius={30}
93
- * size={320}
94
- * sides={3}
95
- * stroke={'#fff'}
96
- * lineWidth={8}
97
- * />
98
- * ```
99
- */
100
- readonly radius: SimpleSignal<number, this>;
101
- constructor(props: PolygonProps);
102
- profile(): CurveProfile;
103
- protected desiredSize(): SerializedVector2<DesiredLength>;
104
- protected offsetComputedLayout(box: BBox): BBox;
105
- protected childrenBBox(): BBox;
106
- protected requiresProfile(): boolean;
107
- protected getPath(): Path2D;
108
- protected getRipplePath(): Path2D;
109
- protected createPath(expand?: number): Path2D;
73
+ /**
74
+ * The number of sides of the polygon.
75
+ *
76
+ * @remarks
77
+ * For example, a value of 6 creates a hexagon.
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * <Polygon
82
+ * size={320}
83
+ * sides={7}
84
+ * stroke={'#fff'}
85
+ * lineWidth={8}
86
+ * fill={'lightseagreen'}
87
+ * />
88
+ * ```
89
+ */
90
+ readonly sides: SimpleSignal<number, this>;
91
+ /**
92
+ * The radius of the polygon's corners.
93
+ *
94
+ * @example
95
+ * ```tsx
96
+ * <Polygon
97
+ * radius={30}
98
+ * size={320}
99
+ * sides={3}
100
+ * stroke={'#fff'}
101
+ * lineWidth={8}
102
+ * />
103
+ * ```
104
+ */
105
+ readonly radius: SimpleSignal<number, this>;
106
+ constructor(props: PolygonProps);
107
+ profile(): CurveProfile;
108
+ protected desiredSize(): SerializedVector2<DesiredLength>;
109
+ protected offsetComputedLayout(box: BBox): BBox;
110
+ protected childrenBBox(): BBox;
111
+ protected requiresProfile(): boolean;
112
+ protected getPath(): Path2D;
113
+ protected getRipplePath(): Path2D;
114
+ protected createPath(expand?: number): Path2D;
110
115
  }
111
- //# sourceMappingURL=Polygon.d.ts.map
116
+ //# sourceMappingURL=Polygon.d.ts.map
@@ -1,17 +1,17 @@
1
- import { PossibleVector2, SignalValue, Vector2Signal } from '@revideo/core';
2
- import { PolynomialSegment } from '../curves/PolynomialSegment';
3
- import { Bezier, BezierOverlayInfo } from './Bezier';
4
- import { CurveProps } from './Curve';
1
+ import {PossibleVector2, SignalValue, Vector2Signal} from '@revideo/core';
2
+ import {PolynomialSegment} from '../curves/PolynomialSegment';
3
+ import {Bezier, BezierOverlayInfo} from './Bezier';
4
+ import {CurveProps} from './Curve';
5
5
  export interface QuadBezierProps extends CurveProps {
6
- p0?: SignalValue<PossibleVector2>;
7
- p0X?: SignalValue<number>;
8
- p0Y?: SignalValue<number>;
9
- p1?: SignalValue<PossibleVector2>;
10
- p1X?: SignalValue<number>;
11
- p1Y?: SignalValue<number>;
12
- p2?: SignalValue<PossibleVector2>;
13
- p2X?: SignalValue<number>;
14
- p2Y?: SignalValue<number>;
6
+ p0?: SignalValue<PossibleVector2>;
7
+ p0X?: SignalValue<number>;
8
+ p0Y?: SignalValue<number>;
9
+ p1?: SignalValue<PossibleVector2>;
10
+ p1X?: SignalValue<number>;
11
+ p1Y?: SignalValue<number>;
12
+ p2?: SignalValue<PossibleVector2>;
13
+ p2X?: SignalValue<number>;
14
+ p2Y?: SignalValue<number>;
15
15
  }
16
16
  /**
17
17
  * A node for drawing a quadratic Bézier curve.
@@ -42,20 +42,20 @@ export interface QuadBezierProps extends CurveProps {
42
42
  * ```
43
43
  */
44
44
  export declare class QuadBezier extends Bezier {
45
- /**
46
- * The start point of the Bézier curve.
47
- */
48
- readonly p0: Vector2Signal<this>;
49
- /**
50
- * The control point of the Bézier curve.
51
- */
52
- readonly p1: Vector2Signal<this>;
53
- /**
54
- * The end point of the Bézier curve.
55
- */
56
- readonly p2: Vector2Signal<this>;
57
- constructor(props: QuadBezierProps);
58
- protected segment(): PolynomialSegment;
59
- protected overlayInfo(matrix: DOMMatrix): BezierOverlayInfo;
45
+ /**
46
+ * The start point of the Bézier curve.
47
+ */
48
+ readonly p0: Vector2Signal<this>;
49
+ /**
50
+ * The control point of the Bézier curve.
51
+ */
52
+ readonly p1: Vector2Signal<this>;
53
+ /**
54
+ * The end point of the Bézier curve.
55
+ */
56
+ readonly p2: Vector2Signal<this>;
57
+ constructor(props: QuadBezierProps);
58
+ protected segment(): PolynomialSegment;
59
+ protected overlayInfo(matrix: DOMMatrix): BezierOverlayInfo;
60
60
  }
61
- //# sourceMappingURL=QuadBezier.d.ts.map
61
+ //# sourceMappingURL=QuadBezier.d.ts.map
@@ -1,19 +1,19 @@
1
- import { BBox, PossibleVector2, SignalValue, Vector2Signal } from '@revideo/core';
2
- import { CurveProfile } from '../curves';
3
- import { Curve, CurveProps } from './Curve';
1
+ import {BBox, PossibleVector2, SignalValue, Vector2Signal} from '@revideo/core';
2
+ import {CurveProfile} from '../curves';
3
+ import {Curve, CurveProps} from './Curve';
4
4
  export interface RayProps extends CurveProps {
5
- /**
6
- * {@inheritDoc Ray.from}
7
- */
8
- from?: SignalValue<PossibleVector2>;
9
- fromX?: SignalValue<number>;
10
- fromY?: SignalValue<number>;
11
- /**
12
- * {@inheritDoc Ray.to}
13
- */
14
- to?: SignalValue<PossibleVector2>;
15
- toX?: SignalValue<number>;
16
- toY?: SignalValue<number>;
5
+ /**
6
+ * {@inheritDoc Ray.from}
7
+ */
8
+ from?: SignalValue<PossibleVector2>;
9
+ fromX?: SignalValue<number>;
10
+ fromY?: SignalValue<number>;
11
+ /**
12
+ * {@inheritDoc Ray.to}
13
+ */
14
+ to?: SignalValue<PossibleVector2>;
15
+ toX?: SignalValue<number>;
16
+ toY?: SignalValue<number>;
17
17
  }
18
18
  /**
19
19
  * A node for drawing an individual line segment.
@@ -44,17 +44,17 @@ export interface RayProps extends CurveProps {
44
44
  * ```
45
45
  */
46
46
  export declare class Ray extends Curve {
47
- /**
48
- * The starting point of the ray.
49
- */
50
- readonly from: Vector2Signal<this>;
51
- /**
52
- * The ending point of the ray.
53
- */
54
- readonly to: Vector2Signal<this>;
55
- constructor(props: RayProps);
56
- protected childrenBBox(): BBox;
57
- profile(): CurveProfile;
58
- drawOverlay(context: CanvasRenderingContext2D, matrix: DOMMatrix): void;
47
+ /**
48
+ * The starting point of the ray.
49
+ */
50
+ readonly from: Vector2Signal<this>;
51
+ /**
52
+ * The ending point of the ray.
53
+ */
54
+ readonly to: Vector2Signal<this>;
55
+ constructor(props: RayProps);
56
+ protected childrenBBox(): BBox;
57
+ profile(): CurveProfile;
58
+ drawOverlay(context: CanvasRenderingContext2D, matrix: DOMMatrix): void;
59
59
  }
60
- //# sourceMappingURL=Ray.d.ts.map
60
+ //# sourceMappingURL=Ray.d.ts.map
@@ -1,112 +1,119 @@
1
- import { BBox, PossibleSpacing, SerializedVector2, SignalValue, SimpleSignal, SpacingSignal } from '@revideo/core';
2
- import { DesiredLength } from '../partials';
3
- import { Curve, CurveProps } from './Curve';
1
+ import {
2
+ BBox,
3
+ PossibleSpacing,
4
+ SerializedVector2,
5
+ SignalValue,
6
+ SimpleSignal,
7
+ SpacingSignal,
8
+ } from '@revideo/core';
9
+ import {DesiredLength} from '../partials';
10
+ import {Curve, CurveProps} from './Curve';
4
11
  export interface RectProps extends CurveProps {
5
- /**
6
- * {@inheritDoc Rect.radius}
7
- */
8
- radius?: SignalValue<PossibleSpacing>;
9
- /**
10
- * {@inheritDoc Rect.smoothCorners}
11
- */
12
- smoothCorners?: SignalValue<boolean>;
13
- /**
14
- * {@inheritDoc Rect.cornerSharpness}
15
- */
16
- cornerSharpness?: SignalValue<number>;
12
+ /**
13
+ * {@inheritDoc Rect.radius}
14
+ */
15
+ radius?: SignalValue<PossibleSpacing>;
16
+ /**
17
+ * {@inheritDoc Rect.smoothCorners}
18
+ */
19
+ smoothCorners?: SignalValue<boolean>;
20
+ /**
21
+ * {@inheritDoc Rect.cornerSharpness}
22
+ */
23
+ cornerSharpness?: SignalValue<number>;
17
24
  }
18
25
  export declare class Rect extends Curve {
19
- /**
20
- * Rounds the corners of this rectangle.
21
- *
22
- * @remarks
23
- * The value represents the radius of the quarter circle that is used to round
24
- * the corners. If the value is a number, the same radius is used for all
25
- * corners. Passing an array of two to four numbers will set individual radii
26
- * for each corner. Individual radii correspond to different corners depending
27
- * on the number of values passed:
28
- *
29
- * ```ts
30
- * // top-left-and-bottom-right | top-right-and-bottom-left
31
- * [10, 30]
32
- * // top-left | top-right-and-bottom-left | bottom-right
33
- * [10, 20, 30]
34
- * // top-left | top-right | bottom-right | bottom-left
35
- * [10, 20, 30, 40]
36
- * ```
37
- *
38
- * @example
39
- * One uniform radius:
40
- * ```tsx
41
- * <Rect
42
- * size={320}
43
- * radius={40}
44
- * fill={'white'}
45
- * />
46
- * ```
47
- * @example
48
- * Individual radii for each corner:
49
- * ```tsx
50
- * <Rect
51
- * size={320}
52
- * radius={[10, 20, 30, 40]}
53
- * fill={'white'}
54
- * />
55
- * ```
56
- */
57
- readonly radius: SpacingSignal<this>;
58
- /**
59
- * Enables corner smoothing.
60
- *
61
- * @remarks
62
- * This property only affects the way rounded corners are drawn. To control
63
- * the corner radius use the {@link radius} property.
64
- *
65
- * When enabled, rounded corners are drawn continuously using Bézier curves
66
- * rather than quarter circles. The sharpness of the curve can be controlled
67
- * with {@link cornerSharpness}.
68
- *
69
- * You can read more about corner smoothing in
70
- * [this article by Nick Lawrence](https://uxplanet.org/ui-ux-design-corner-smoothing-720509d1ae48).
71
- *
72
- * @example
73
- * ```tsx
74
- * <Rect
75
- * width={300}
76
- * height={300}
77
- * smoothCorners={true}
78
- * />
79
- * ```
80
- */
81
- readonly smoothCorners: SimpleSignal<boolean, this>;
82
- /**
83
- * Controls the sharpness of {@link smoothCorners}.
84
- *
85
- * @remarks
86
- * This property only affects the way rounded corners are drawn. To control
87
- * the corner radius use the {@link radius} property.
88
- *
89
- * Requires {@link smoothCorners} to be enabled to have any effect.
90
- * By default, corner sharpness is set to `0.6` which represents a smooth,
91
- * circle-like rounding. At `0` the edges are squared off.
92
- *
93
- * @example
94
- * ```tsx
95
- * <Rect
96
- * size={300}
97
- * smoothCorners={true}
98
- * cornerSharpness={0.7}
99
- * />
100
- * ```
101
- */
102
- readonly cornerSharpness: SimpleSignal<number, this>;
103
- constructor(props: RectProps);
104
- profile(): import("..").CurveProfile;
105
- protected desiredSize(): SerializedVector2<DesiredLength>;
106
- protected offsetComputedLayout(box: BBox): BBox;
107
- protected childrenBBox(): BBox;
108
- protected getPath(): Path2D;
109
- protected getCacheBBox(): BBox;
110
- protected getRipplePath(): Path2D;
26
+ /**
27
+ * Rounds the corners of this rectangle.
28
+ *
29
+ * @remarks
30
+ * The value represents the radius of the quarter circle that is used to round
31
+ * the corners. If the value is a number, the same radius is used for all
32
+ * corners. Passing an array of two to four numbers will set individual radii
33
+ * for each corner. Individual radii correspond to different corners depending
34
+ * on the number of values passed:
35
+ *
36
+ * ```ts
37
+ * // top-left-and-bottom-right | top-right-and-bottom-left
38
+ * [10, 30]
39
+ * // top-left | top-right-and-bottom-left | bottom-right
40
+ * [10, 20, 30]
41
+ * // top-left | top-right | bottom-right | bottom-left
42
+ * [10, 20, 30, 40]
43
+ * ```
44
+ *
45
+ * @example
46
+ * One uniform radius:
47
+ * ```tsx
48
+ * <Rect
49
+ * size={320}
50
+ * radius={40}
51
+ * fill={'white'}
52
+ * />
53
+ * ```
54
+ * @example
55
+ * Individual radii for each corner:
56
+ * ```tsx
57
+ * <Rect
58
+ * size={320}
59
+ * radius={[10, 20, 30, 40]}
60
+ * fill={'white'}
61
+ * />
62
+ * ```
63
+ */
64
+ readonly radius: SpacingSignal<this>;
65
+ /**
66
+ * Enables corner smoothing.
67
+ *
68
+ * @remarks
69
+ * This property only affects the way rounded corners are drawn. To control
70
+ * the corner radius use the {@link radius} property.
71
+ *
72
+ * When enabled, rounded corners are drawn continuously using Bézier curves
73
+ * rather than quarter circles. The sharpness of the curve can be controlled
74
+ * with {@link cornerSharpness}.
75
+ *
76
+ * You can read more about corner smoothing in
77
+ * [this article by Nick Lawrence](https://uxplanet.org/ui-ux-design-corner-smoothing-720509d1ae48).
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * <Rect
82
+ * width={300}
83
+ * height={300}
84
+ * smoothCorners={true}
85
+ * />
86
+ * ```
87
+ */
88
+ readonly smoothCorners: SimpleSignal<boolean, this>;
89
+ /**
90
+ * Controls the sharpness of {@link smoothCorners}.
91
+ *
92
+ * @remarks
93
+ * This property only affects the way rounded corners are drawn. To control
94
+ * the corner radius use the {@link radius} property.
95
+ *
96
+ * Requires {@link smoothCorners} to be enabled to have any effect.
97
+ * By default, corner sharpness is set to `0.6` which represents a smooth,
98
+ * circle-like rounding. At `0` the edges are squared off.
99
+ *
100
+ * @example
101
+ * ```tsx
102
+ * <Rect
103
+ * size={300}
104
+ * smoothCorners={true}
105
+ * cornerSharpness={0.7}
106
+ * />
107
+ * ```
108
+ */
109
+ readonly cornerSharpness: SimpleSignal<number, this>;
110
+ constructor(props: RectProps);
111
+ profile(): import('..').CurveProfile;
112
+ protected desiredSize(): SerializedVector2<DesiredLength>;
113
+ protected offsetComputedLayout(box: BBox): BBox;
114
+ protected childrenBBox(): BBox;
115
+ protected getPath(): Path2D;
116
+ protected getCacheBBox(): BBox;
117
+ protected getRipplePath(): Path2D;
111
118
  }
112
- //# sourceMappingURL=Rect.d.ts.map
119
+ //# sourceMappingURL=Rect.d.ts.map
@@ -95,7 +95,7 @@ export declare class SVG extends Shape {
95
95
  * @param timing - The timing function.
96
96
  */
97
97
  protected generateTransformer(from: Node, to: Node, duration: number, timing: TimingFunction): Generator<ThreadGenerator>;
98
- protected tweenSvg(value: SignalValue<string>, time: number, timingFunction: TimingFunction): Generator<void | ThreadGenerator | Promise<any> | import("@revideo/core").Promisable<any>, void, any>;
98
+ protected tweenSvg(value: SignalValue<string>, time: number, timingFunction: TimingFunction): Generator<void | Promise<any> | ThreadGenerator | import("@revideo/core").Promisable<any>, void, any>;
99
99
  private wrapperScale;
100
100
  /**
101
101
  * Get the current `SVGDocument`.
@@ -34,6 +34,6 @@ export declare abstract class Shape extends Layout {
34
34
  protected getPath(): Path2D;
35
35
  protected getRipplePath(): Path2D;
36
36
  protected drawRipple(context: CanvasRenderingContext2D): void;
37
- ripple(duration?: number): Generator<void | import("@revideo/core").ThreadGenerator | Promise<any> | import("@revideo/core").Promisable<any>, void, any>;
37
+ ripple(duration?: number): Generator<void | Promise<any> | import("@revideo/core").ThreadGenerator | import("@revideo/core").Promisable<any>, void, any>;
38
38
  }
39
39
  //# sourceMappingURL=Shape.d.ts.map