@revideo/2d 0.3.5-yellow.968 → 0.3.5

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 (119) hide show
  1. package/editor/editor/tsconfig.build.tsbuildinfo +1 -1
  2. package/editor/index.js +151 -380
  3. package/editor/index.js.map +1 -1
  4. package/lib/code/CodeCursor.d.ts +74 -74
  5. package/lib/code/CodeDiffer.d.ts +16 -21
  6. package/lib/code/CodeDiffer.js +41 -39
  7. package/lib/code/CodeFragment.d.ts +8 -16
  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 +8 -12
  12. package/lib/code/CodeMetrics.js +24 -26
  13. package/lib/code/CodeRange.d.ts +5 -21
  14. package/lib/code/CodeRange.js +124 -131
  15. package/lib/code/CodeScope.d.ts +8 -18
  16. package/lib/code/CodeSelection.d.ts +4 -9
  17. package/lib/code/CodeSelection.js +8 -8
  18. package/lib/code/CodeSignal.d.ts +47 -74
  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 +19 -21
  24. package/lib/code/diff.d.ts +9 -12
  25. package/lib/code/diff.js +205 -218
  26. package/lib/code/extractRange.d.ts +4 -7
  27. package/lib/code/extractRange.js +71 -79
  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 +90 -95
  33. package/lib/components/Code.d.ts +211 -244
  34. package/lib/components/CubicBezier.d.ts +36 -36
  35. package/lib/components/Curve.d.ts +198 -208
  36. package/lib/components/Grid.d.ts +42 -47
  37. package/lib/components/Icon.d.ts +50 -55
  38. package/lib/components/Img.d.ts +79 -86
  39. package/lib/components/Knot.d.ts +78 -97
  40. package/lib/components/Latex.d.ts +12 -12
  41. package/lib/components/Layout.d.ts +413 -455
  42. package/lib/components/Line.d.ts +49 -61
  43. package/lib/components/Media.d.ts +36 -36
  44. package/lib/components/Polygon.d.ts +55 -60
  45. package/lib/components/QuadBezier.d.ts +29 -29
  46. package/lib/components/Ray.d.ts +28 -28
  47. package/lib/components/Rect.d.ts +108 -115
  48. package/lib/components/Spline.d.ts +40 -46
  49. package/lib/components/Txt.d.ts +44 -55
  50. package/lib/components/TxtLeaf.d.ts +16 -20
  51. package/lib/components/View2D.d.ts +22 -22
  52. package/lib/components/index.d.ts +1 -1
  53. package/lib/components/types.d.ts +9 -22
  54. package/lib/curves/ArcSegment.d.ts +24 -36
  55. package/lib/curves/CircleSegment.d.ts +16 -26
  56. package/lib/curves/CubicBezierSegment.d.ts +13 -18
  57. package/lib/curves/CurveDrawingInfo.d.ts +9 -9
  58. package/lib/curves/CurvePoint.d.ts +13 -13
  59. package/lib/curves/CurveProfile.d.ts +5 -5
  60. package/lib/curves/CurveProfile.js +1 -1
  61. package/lib/curves/KnotInfo.d.ts +8 -8
  62. package/lib/curves/LineSegment.d.ts +14 -19
  63. package/lib/curves/Polynomial.d.ts +110 -110
  64. package/lib/curves/Polynomial2D.d.ts +20 -20
  65. package/lib/curves/PolynomialSegment.d.ts +37 -42
  66. package/lib/curves/QuadBezierSegment.d.ts +12 -12
  67. package/lib/curves/Segment.d.ts +7 -12
  68. package/lib/curves/UniformPolynomialCurveSampler.d.ts +34 -34
  69. package/lib/curves/createCurveProfileLerp.d.ts +6 -17
  70. package/lib/curves/getBezierSplineProfile.d.ts +4 -8
  71. package/lib/curves/getCircleProfile.d.ts +4 -10
  72. package/lib/curves/getPathProfile.d.ts +2 -2
  73. package/lib/curves/getPointAtDistance.d.ts +4 -7
  74. package/lib/curves/getPolylineProfile.d.ts +4 -8
  75. package/lib/curves/getRectProfile.d.ts +4 -9
  76. package/lib/curves/index.d.ts +1 -1
  77. package/lib/curves/index.js +1 -1
  78. package/lib/decorators/canvasStyleSignal.d.ts +3 -3
  79. package/lib/decorators/colorSignal.d.ts +1 -1
  80. package/lib/decorators/compound.d.ts +2 -4
  81. package/lib/decorators/computed.d.ts +1 -1
  82. package/lib/decorators/defaultStyle.d.ts +2 -5
  83. package/lib/decorators/filtersSignal.d.ts +8 -28
  84. package/lib/decorators/index.d.ts +1 -1
  85. package/lib/decorators/index.js +1 -1
  86. package/lib/decorators/initializers.d.ts +2 -5
  87. package/lib/decorators/initializers.js +19 -18
  88. package/lib/decorators/nodeName.d.ts +1 -1
  89. package/lib/decorators/nodeName.js +4 -4
  90. package/lib/decorators/signal.d.ts +20 -40
  91. package/lib/decorators/spacingSignal.d.ts +1 -1
  92. package/lib/decorators/vector2Signal.d.ts +7 -13
  93. package/lib/index.d.ts +1 -1
  94. package/lib/index.js +1 -1
  95. package/lib/jsx-dev-runtime.d.ts +3 -3
  96. package/lib/jsx-dev-runtime.js +3 -3
  97. package/lib/jsx-runtime.d.ts +9 -19
  98. package/lib/jsx-runtime.js +18 -18
  99. package/lib/partials/Filter.d.ts +16 -24
  100. package/lib/partials/Gradient.d.ts +24 -30
  101. package/lib/partials/Pattern.d.ts +9 -14
  102. package/lib/partials/ShaderConfig.d.ts +74 -81
  103. package/lib/partials/index.d.ts +1 -1
  104. package/lib/partials/index.js +1 -1
  105. package/lib/partials/types.d.ts +6 -19
  106. package/lib/scenes/Scene2D.d.ts +23 -42
  107. package/lib/scenes/index.d.ts +1 -1
  108. package/lib/scenes/index.js +1 -1
  109. package/lib/scenes/makeScene2D.d.ts +5 -7
  110. package/lib/scenes/useScene2D.d.ts +2 -2
  111. package/lib/tsconfig.build.tsbuildinfo +1 -1
  112. package/lib/utils/diff.d.ts +18 -25
  113. package/lib/utils/diff.js +87 -84
  114. package/lib/utils/index.d.ts +1 -1
  115. package/lib/utils/index.js +1 -1
  116. package/lib/utils/is.d.ts +2 -4
  117. package/lib/utils/is.js +2 -2
  118. package/lib/utils/makeSignalExtensions.d.ts +4 -11
  119. package/package.json +5 -5
@@ -1,119 +1,112 @@
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';
1
+ import { BBox, PossibleSpacing, SerializedVector2, SignalValue, SimpleSignal, SpacingSignal } from '@revideo/core';
2
+ import { DesiredLength } from '../partials';
3
+ import { Curve, CurveProps } from './Curve';
11
4
  export interface RectProps extends CurveProps {
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>;
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>;
24
17
  }
25
18
  export declare class Rect extends Curve {
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;
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;
118
111
  }
119
- //# sourceMappingURL=Rect.d.ts.map
112
+ //# sourceMappingURL=Rect.d.ts.map
@@ -1,22 +1,16 @@
1
- import {
2
- BBox,
3
- PossibleVector2,
4
- SerializedVector2,
5
- SignalValue,
6
- SimpleSignal,
7
- } from '@revideo/core';
8
- import {CurveProfile, KnotInfo} from '../curves';
9
- import {DesiredLength} from '../partials';
10
- import {Curve, CurveProps} from './Curve';
1
+ import { BBox, PossibleVector2, SerializedVector2, SignalValue, SimpleSignal } from '@revideo/core';
2
+ import { CurveProfile, KnotInfo } from '../curves';
3
+ import { DesiredLength } from '../partials';
4
+ import { Curve, CurveProps } from './Curve';
11
5
  export interface SplineProps extends CurveProps {
12
- /**
13
- * {@inheritDoc Spline.smoothness}
14
- */
15
- smoothness?: SignalValue<number>;
16
- /**
17
- * {@inheritDoc Spline.points}
18
- */
19
- points?: SignalValue<SignalValue<PossibleVector2[]>>;
6
+ /**
7
+ * {@inheritDoc Spline.smoothness}
8
+ */
9
+ smoothness?: SignalValue<number>;
10
+ /**
11
+ * {@inheritDoc Spline.points}
12
+ */
13
+ points?: SignalValue<SignalValue<PossibleVector2[]>>;
20
14
  }
21
15
  /**
22
16
  * A node for drawing a smooth line through a number of points.
@@ -62,32 +56,32 @@ export interface SplineProps extends CurveProps {
62
56
  * ```
63
57
  */
64
58
  export declare class Spline extends Curve {
65
- /**
66
- * The smoothness of the spline when using auto-calculated handles.
67
- *
68
- * @remarks
69
- * This property is only applied to knots that don't use explicit handles.
70
- *
71
- * @defaultValue 0.4
72
- */
73
- readonly smoothness: SimpleSignal<number>;
74
- /**
75
- * The knots of the spline as an array of knots with auto-calculated handles.
76
- *
77
- * @remarks
78
- * You can control the smoothness of the resulting curve
79
- * via the {@link smoothness} property.
80
- */
81
- readonly points: SimpleSignal<SignalValue<PossibleVector2>[] | null, this>;
82
- constructor(props: SplineProps);
83
- profile(): CurveProfile;
84
- knots(): KnotInfo[];
85
- protected childrenBBox(): BBox;
86
- protected lineWidthCoefficient(): number;
87
- protected desiredSize(): SerializedVector2<DesiredLength>;
88
- protected offsetComputedLayout(box: BBox): BBox;
89
- private getTightBBox;
90
- drawOverlay(context: CanvasRenderingContext2D, matrix: DOMMatrix): void;
91
- private isKnot;
59
+ /**
60
+ * The smoothness of the spline when using auto-calculated handles.
61
+ *
62
+ * @remarks
63
+ * This property is only applied to knots that don't use explicit handles.
64
+ *
65
+ * @defaultValue 0.4
66
+ */
67
+ readonly smoothness: SimpleSignal<number>;
68
+ /**
69
+ * The knots of the spline as an array of knots with auto-calculated handles.
70
+ *
71
+ * @remarks
72
+ * You can control the smoothness of the resulting curve
73
+ * via the {@link smoothness} property.
74
+ */
75
+ readonly points: SimpleSignal<SignalValue<PossibleVector2>[] | null, this>;
76
+ constructor(props: SplineProps);
77
+ profile(): CurveProfile;
78
+ knots(): KnotInfo[];
79
+ protected childrenBBox(): BBox;
80
+ protected lineWidthCoefficient(): number;
81
+ protected desiredSize(): SerializedVector2<DesiredLength>;
82
+ protected offsetComputedLayout(box: BBox): BBox;
83
+ private getTightBBox;
84
+ drawOverlay(context: CanvasRenderingContext2D, matrix: DOMMatrix): void;
85
+ private isKnot;
92
86
  }
93
- //# sourceMappingURL=Spline.d.ts.map
87
+ //# sourceMappingURL=Spline.d.ts.map
@@ -1,62 +1,51 @@
1
- import {
2
- InterpolationFunction,
3
- SignalValue,
4
- SimpleSignal,
5
- ThreadGenerator,
6
- TimingFunction,
7
- } from '@revideo/core';
8
- import {Node} from './Node';
9
- import {Shape, ShapeProps} from './Shape';
10
- import {TxtLeaf} from './TxtLeaf';
11
- import {ComponentChildren} from './types';
1
+ import { InterpolationFunction, SignalValue, SimpleSignal, ThreadGenerator, TimingFunction } from '@revideo/core';
2
+ import { Node } from './Node';
3
+ import { Shape, ShapeProps } from './Shape';
4
+ import { TxtLeaf } from './TxtLeaf';
5
+ import { ComponentChildren } from './types';
12
6
  type TxtChildren = string | Node | (string | Node)[];
13
7
  type AnyTxt = Txt | TxtLeaf;
14
8
  export interface TxtProps extends ShapeProps {
15
- children?: TxtChildren;
16
- text?: SignalValue<string>;
9
+ children?: TxtChildren;
10
+ text?: SignalValue<string>;
17
11
  }
18
12
  export declare class Txt extends Shape {
19
- /**
20
- * Create a bold text node.
21
- *
22
- * @remarks
23
- * This is a shortcut for
24
- * ```tsx
25
- * <Txt fontWeight={700} />
26
- * ```
27
- *
28
- * @param props - Additional text properties.
29
- */
30
- static b(props: TxtProps): Txt;
31
- /**
32
- * Create an italic text node.
33
- *
34
- * @remarks
35
- * This is a shortcut for
36
- * ```tsx
37
- * <Txt fontStyle={'italic'} />
38
- * ```
39
- *
40
- * @param props - Additional text properties.
41
- */
42
- static i(props: TxtProps): Txt;
43
- readonly text: SimpleSignal<string, this>;
44
- protected getText(): string;
45
- protected setText(value: SignalValue<string>): void;
46
- protected setChildren(value: SignalValue<ComponentChildren>): void;
47
- protected tweenText(
48
- value: SignalValue<string>,
49
- time: number,
50
- timingFunction: TimingFunction,
51
- interpolationFunction: InterpolationFunction<string>,
52
- ): ThreadGenerator;
53
- protected getLayout(): boolean;
54
- constructor({children, text, ...props}: TxtProps);
55
- protected innerText(): string;
56
- protected parentTxt(): Txt | null;
57
- protected parseChildren(children: ComponentChildren): AnyTxt[];
58
- protected applyFlex(): void;
59
- protected draw(context: CanvasRenderingContext2D): Promise<void>;
13
+ /**
14
+ * Create a bold text node.
15
+ *
16
+ * @remarks
17
+ * This is a shortcut for
18
+ * ```tsx
19
+ * <Txt fontWeight={700} />
20
+ * ```
21
+ *
22
+ * @param props - Additional text properties.
23
+ */
24
+ static b(props: TxtProps): Txt;
25
+ /**
26
+ * Create an italic text node.
27
+ *
28
+ * @remarks
29
+ * This is a shortcut for
30
+ * ```tsx
31
+ * <Txt fontStyle={'italic'} />
32
+ * ```
33
+ *
34
+ * @param props - Additional text properties.
35
+ */
36
+ static i(props: TxtProps): Txt;
37
+ readonly text: SimpleSignal<string, this>;
38
+ protected getText(): string;
39
+ protected setText(value: SignalValue<string>): void;
40
+ protected setChildren(value: SignalValue<ComponentChildren>): void;
41
+ protected tweenText(value: SignalValue<string>, time: number, timingFunction: TimingFunction, interpolationFunction: InterpolationFunction<string>): ThreadGenerator;
42
+ protected getLayout(): boolean;
43
+ constructor({ children, text, ...props }: TxtProps);
44
+ protected innerText(): string;
45
+ protected parentTxt(): Txt | null;
46
+ protected parseChildren(children: ComponentChildren): AnyTxt[];
47
+ protected applyFlex(): void;
48
+ protected draw(context: CanvasRenderingContext2D): Promise<void>;
60
49
  }
61
50
  export {};
62
- //# sourceMappingURL=Txt.d.ts.map
51
+ //# sourceMappingURL=Txt.d.ts.map
@@ -1,24 +1,20 @@
1
- import {BBox, SignalValue, SimpleSignal} from '@revideo/core';
2
- import {Shape, ShapeProps} from './Shape';
3
- import {Txt} from './Txt';
1
+ import { BBox, SignalValue, SimpleSignal } from '@revideo/core';
2
+ import { Shape, ShapeProps } from './Shape';
3
+ import { Txt } from './Txt';
4
4
  export interface TxtLeafProps extends ShapeProps {
5
- children?: string;
6
- text?: SignalValue<string>;
5
+ children?: string;
6
+ text?: SignalValue<string>;
7
7
  }
8
8
  export declare class TxtLeaf extends Shape {
9
- protected static formatter: HTMLDivElement;
10
- protected static readonly segmenter: any;
11
- readonly text: SimpleSignal<string, this>;
12
- constructor({children, ...rest}: TxtLeafProps);
13
- protected parentTxt(): Txt | null;
14
- protected draw(context: CanvasRenderingContext2D): Promise<void>;
15
- protected drawText(
16
- context: CanvasRenderingContext2D,
17
- text: string,
18
- box: BBox,
19
- ): Promise<void>;
20
- protected getCacheBBox(): BBox;
21
- protected applyFlex(): void;
22
- protected updateLayout(): void;
9
+ protected static formatter: HTMLDivElement;
10
+ protected static readonly segmenter: any;
11
+ readonly text: SimpleSignal<string, this>;
12
+ constructor({ children, ...rest }: TxtLeafProps);
13
+ protected parentTxt(): Txt | null;
14
+ protected draw(context: CanvasRenderingContext2D): Promise<void>;
15
+ protected drawText(context: CanvasRenderingContext2D, text: string, box: BBox): Promise<void>;
16
+ protected getCacheBBox(): BBox;
17
+ protected applyFlex(): void;
18
+ protected updateLayout(): void;
23
19
  }
24
- //# sourceMappingURL=TxtLeaf.d.ts.map
20
+ //# sourceMappingURL=TxtLeaf.d.ts.map
@@ -1,26 +1,26 @@
1
- import {PlaybackState, SimpleSignal} from '@revideo/core';
2
- import type {Node} from './Node';
3
- import {Rect, RectProps} from './Rect';
1
+ import { PlaybackState, SimpleSignal } from '@revideo/core';
2
+ import type { Node } from './Node';
3
+ import { Rect, RectProps } from './Rect';
4
4
  export interface View2DProps extends RectProps {
5
- assetHash: string;
5
+ assetHash: string;
6
6
  }
7
7
  export declare class View2D extends Rect {
8
- static shadowRoot: ShadowRoot;
9
- readonly playbackState: SimpleSignal<PlaybackState, this>;
10
- readonly globalTime: SimpleSignal<number, this>;
11
- readonly fps: SimpleSignal<number, this>;
12
- readonly assetHash: SimpleSignal<string, this>;
13
- constructor(props: View2DProps);
14
- dispose(): void;
15
- render(context: CanvasRenderingContext2D): Promise<void>;
16
- /**
17
- * Find a node by its key.
18
- *
19
- * @param key - The key of the node.
20
- */
21
- findKey<T extends Node = Node>(key: string): T | null;
22
- protected requestLayoutUpdate(): void;
23
- protected requestFontUpdate(): void;
24
- view(): View2D;
8
+ static shadowRoot: ShadowRoot;
9
+ readonly playbackState: SimpleSignal<PlaybackState, this>;
10
+ readonly globalTime: SimpleSignal<number, this>;
11
+ readonly fps: SimpleSignal<number, this>;
12
+ readonly assetHash: SimpleSignal<string, this>;
13
+ constructor(props: View2DProps);
14
+ dispose(): void;
15
+ render(context: CanvasRenderingContext2D): Promise<void>;
16
+ /**
17
+ * Find a node by its key.
18
+ *
19
+ * @param key - The key of the node.
20
+ */
21
+ findKey<T extends Node = Node>(key: string): T | null;
22
+ protected requestLayoutUpdate(): void;
23
+ protected requestFontUpdate(): void;
24
+ view(): View2D;
25
25
  }
26
- //# sourceMappingURL=View2D.d.ts.map
26
+ //# sourceMappingURL=View2D.d.ts.map
@@ -24,4 +24,4 @@ export * from './Txt';
24
24
  export * from './Video';
25
25
  export * from './View2D';
26
26
  export * from './types';
27
- //# sourceMappingURL=index.d.ts.map
27
+ //# sourceMappingURL=index.d.ts.map
@@ -1,30 +1,17 @@
1
- import type {ReferenceReceiver} from '@revideo/core';
2
- import type {Node} from './Node';
3
- export type ComponentChild =
4
- | Node
5
- | object
6
- | string
7
- | number
8
- | bigint
9
- | boolean
10
- | null
11
- | undefined;
1
+ import type { ReferenceReceiver } from '@revideo/core';
2
+ import type { Node } from './Node';
3
+ export type ComponentChild = Node | object | string | number | bigint | boolean | null | undefined;
12
4
  export type ComponentChildren = ComponentChild | ComponentChild[];
13
5
  export type NodeChildren = Node | Node[];
14
- export type PropsOf<T> =
15
- T extends NodeConstructor<infer P>
16
- ? P
17
- : T extends FunctionComponent<infer P>
18
- ? P
19
- : never;
6
+ export type PropsOf<T> = T extends NodeConstructor<infer P> ? P : T extends FunctionComponent<infer P> ? P : never;
20
7
  export interface JSXProps {
21
- children?: ComponentChildren;
22
- ref?: ReferenceReceiver<Node>;
8
+ children?: ComponentChildren;
9
+ ref?: ReferenceReceiver<Node>;
23
10
  }
24
11
  export interface FunctionComponent<T = any> {
25
- (props: T): Node | null;
12
+ (props: T): Node | null;
26
13
  }
27
14
  export interface NodeConstructor<TProps = any, TNode = Node> {
28
- new (props: TProps): TNode;
15
+ new (props: TProps): TNode;
29
16
  }
30
- //# sourceMappingURL=types.d.ts.map
17
+ //# sourceMappingURL=types.d.ts.map
@@ -1,38 +1,26 @@
1
- import {Vector2} from '@revideo/core';
2
- import {CurvePoint} from './CurvePoint';
3
- import {Segment} from './Segment';
1
+ import { Vector2 } from '@revideo/core';
2
+ import { CurvePoint } from './CurvePoint';
3
+ import { Segment } from './Segment';
4
4
  export declare class ArcSegment extends Segment {
5
- readonly startPoint: Vector2;
6
- readonly radius: Vector2;
7
- readonly xAxisRotationDegree: number;
8
- readonly largeArcFlag: number;
9
- readonly sweepFlag: number;
10
- readonly endPoint: Vector2;
11
- private static el;
12
- readonly center: Vector2;
13
- readonly startAngle: number;
14
- readonly deltaAngle: number;
15
- readonly xAxisRotation: number;
16
- private xAxisRotationMatrix;
17
- readonly points: Vector2[];
18
- private length;
19
- constructor(
20
- startPoint: Vector2,
21
- radius: Vector2,
22
- xAxisRotationDegree: number,
23
- largeArcFlag: number,
24
- sweepFlag: number,
25
- endPoint: Vector2,
26
- );
27
- getAnglePosition(angle: number): Vector2;
28
- getAngleDerivative(angle: number): Vector2;
29
- draw(
30
- context: CanvasRenderingContext2D | Path2D,
31
- start: number,
32
- end: number,
33
- move: boolean,
34
- ): [CurvePoint, CurvePoint];
35
- getPoint(distance: number): CurvePoint;
36
- get arcLength(): number;
5
+ readonly startPoint: Vector2;
6
+ readonly radius: Vector2;
7
+ readonly xAxisRotationDegree: number;
8
+ readonly largeArcFlag: number;
9
+ readonly sweepFlag: number;
10
+ readonly endPoint: Vector2;
11
+ private static el;
12
+ readonly center: Vector2;
13
+ readonly startAngle: number;
14
+ readonly deltaAngle: number;
15
+ readonly xAxisRotation: number;
16
+ private xAxisRotationMatrix;
17
+ readonly points: Vector2[];
18
+ private length;
19
+ constructor(startPoint: Vector2, radius: Vector2, xAxisRotationDegree: number, largeArcFlag: number, sweepFlag: number, endPoint: Vector2);
20
+ getAnglePosition(angle: number): Vector2;
21
+ getAngleDerivative(angle: number): Vector2;
22
+ draw(context: CanvasRenderingContext2D | Path2D, start: number, end: number, move: boolean): [CurvePoint, CurvePoint];
23
+ getPoint(distance: number): CurvePoint;
24
+ get arcLength(): number;
37
25
  }
38
- //# sourceMappingURL=ArcSegment.d.ts.map
26
+ //# sourceMappingURL=ArcSegment.d.ts.map