@revideo/2d 0.3.5-alpha.966 → 0.3.5-beta.967

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 (132) 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 +109 -67
  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/Media.d.ts +36 -36
  45. package/lib/components/Media.d.ts.map +1 -1
  46. package/lib/components/Media.js +8 -4
  47. package/lib/components/Node.d.ts +875 -830
  48. package/lib/components/Path.d.ts +35 -14
  49. package/lib/components/Polygon.d.ts +60 -55
  50. package/lib/components/QuadBezier.d.ts +29 -29
  51. package/lib/components/Ray.d.ts +28 -28
  52. package/lib/components/Rect.d.ts +115 -108
  53. package/lib/components/SVG.d.ts +165 -139
  54. package/lib/components/Shape.d.ts +44 -35
  55. package/lib/components/Spline.d.ts +46 -40
  56. package/lib/components/Txt.d.ts +55 -44
  57. package/lib/components/TxtLeaf.d.ts +20 -16
  58. package/lib/components/Video.d.ts +7 -6
  59. package/lib/components/Video.d.ts.map +1 -1
  60. package/lib/components/Video.js +7 -7
  61. package/lib/components/View2D.d.ts +22 -22
  62. package/lib/components/index.d.ts +1 -1
  63. package/lib/components/types.d.ts +22 -9
  64. package/lib/curves/ArcSegment.d.ts +36 -24
  65. package/lib/curves/CircleSegment.d.ts +26 -16
  66. package/lib/curves/CubicBezierSegment.d.ts +18 -13
  67. package/lib/curves/CurveDrawingInfo.d.ts +9 -9
  68. package/lib/curves/CurvePoint.d.ts +13 -13
  69. package/lib/curves/CurveProfile.d.ts +5 -5
  70. package/lib/curves/CurveProfile.js +1 -1
  71. package/lib/curves/KnotInfo.d.ts +8 -8
  72. package/lib/curves/LineSegment.d.ts +19 -14
  73. package/lib/curves/Polynomial.d.ts +110 -110
  74. package/lib/curves/Polynomial2D.d.ts +20 -20
  75. package/lib/curves/PolynomialSegment.d.ts +42 -37
  76. package/lib/curves/QuadBezierSegment.d.ts +12 -12
  77. package/lib/curves/Segment.d.ts +12 -7
  78. package/lib/curves/UniformPolynomialCurveSampler.d.ts +34 -34
  79. package/lib/curves/createCurveProfileLerp.d.ts +17 -6
  80. package/lib/curves/getBezierSplineProfile.d.ts +8 -4
  81. package/lib/curves/getCircleProfile.d.ts +10 -4
  82. package/lib/curves/getPathProfile.d.ts +2 -2
  83. package/lib/curves/getPointAtDistance.d.ts +7 -4
  84. package/lib/curves/getPolylineProfile.d.ts +8 -4
  85. package/lib/curves/getRectProfile.d.ts +9 -4
  86. package/lib/curves/index.d.ts +1 -1
  87. package/lib/curves/index.js +1 -1
  88. package/lib/decorators/canvasStyleSignal.d.ts +3 -3
  89. package/lib/decorators/colorSignal.d.ts +1 -1
  90. package/lib/decorators/compound.d.ts +4 -2
  91. package/lib/decorators/computed.d.ts +1 -1
  92. package/lib/decorators/defaultStyle.d.ts +5 -2
  93. package/lib/decorators/filtersSignal.d.ts +28 -8
  94. package/lib/decorators/index.d.ts +1 -1
  95. package/lib/decorators/index.js +1 -1
  96. package/lib/decorators/initializers.d.ts +5 -2
  97. package/lib/decorators/initializers.js +18 -19
  98. package/lib/decorators/nodeName.d.ts +1 -1
  99. package/lib/decorators/nodeName.js +4 -4
  100. package/lib/decorators/signal.d.ts +40 -20
  101. package/lib/decorators/spacingSignal.d.ts +1 -1
  102. package/lib/decorators/vector2Signal.d.ts +13 -7
  103. package/lib/index.d.ts +1 -1
  104. package/lib/index.js +1 -1
  105. package/lib/jsx-dev-runtime.d.ts +3 -3
  106. package/lib/jsx-dev-runtime.js +3 -3
  107. package/lib/jsx-runtime.d.ts +19 -9
  108. package/lib/jsx-runtime.js +18 -18
  109. package/lib/partials/Filter.d.ts +24 -16
  110. package/lib/partials/Gradient.d.ts +30 -24
  111. package/lib/partials/Pattern.d.ts +14 -9
  112. package/lib/partials/ShaderConfig.d.ts +81 -74
  113. package/lib/partials/index.d.ts +1 -1
  114. package/lib/partials/index.js +1 -1
  115. package/lib/partials/types.d.ts +19 -6
  116. package/lib/scenes/Scene2D.d.ts +42 -23
  117. package/lib/scenes/index.d.ts +1 -1
  118. package/lib/scenes/index.js +1 -1
  119. package/lib/scenes/makeScene2D.d.ts +7 -5
  120. package/lib/scenes/useScene2D.d.ts +2 -2
  121. package/lib/tsconfig.build.tsbuildinfo +1 -1
  122. package/lib/utils/CanvasUtils.d.ts +1 -1
  123. package/lib/utils/diff.d.ts +25 -18
  124. package/lib/utils/diff.js +84 -87
  125. package/lib/utils/index.d.ts +1 -1
  126. package/lib/utils/index.js +1 -1
  127. package/lib/utils/is.d.ts +4 -2
  128. package/lib/utils/is.js +2 -2
  129. package/lib/utils/makeSignalExtensions.d.ts +11 -4
  130. package/package.json +4 -4
  131. package/src/lib/components/Media.ts +2 -1
  132. package/src/lib/components/Video.ts +12 -11
@@ -1,14 +1,21 @@
1
- import { SerializedVector2, SignalValue, SimpleSignal, ThreadGenerator, TimingFunction, Vector2 } from '@revideo/core';
2
- import { DesiredLength } from '../partials';
3
- import { Node, NodeProps } from './Node';
4
- import { Shape, ShapeProps } from './Shape';
1
+ import {
2
+ SerializedVector2,
3
+ SignalValue,
4
+ SimpleSignal,
5
+ ThreadGenerator,
6
+ TimingFunction,
7
+ Vector2,
8
+ } from '@revideo/core';
9
+ import {DesiredLength} from '../partials';
10
+ import {Node, NodeProps} from './Node';
11
+ import {Shape, ShapeProps} from './Shape';
5
12
  /**
6
13
  * Represent SVG shape.
7
14
  * This only used single time because `node` may have reference to parent SVG renderer.
8
15
  */
9
16
  export interface SVGShape {
10
- id: string;
11
- shape: Node;
17
+ id: string;
18
+ shape: Node;
12
19
  }
13
20
  /**
14
21
  * Data of SVGShape.
@@ -16,18 +23,18 @@ export interface SVGShape {
16
23
  * This must build into SVGShape
17
24
  */
18
25
  export interface SVGShapeData {
19
- id: string;
20
- type: new (props: NodeProps) => Node;
21
- props: ShapeProps;
22
- children?: SVGShapeData[];
26
+ id: string;
27
+ type: new (props: NodeProps) => Node;
28
+ props: ShapeProps;
29
+ children?: SVGShapeData[];
23
30
  }
24
31
  /**
25
32
  * Represent SVG document that contains SVG shapes.
26
33
  * This only used single time because `nodes` have reference to parent SVG renderer.
27
34
  */
28
35
  export interface SVGDocument {
29
- size: Vector2;
30
- nodes: SVGShape[];
36
+ size: Vector2;
37
+ nodes: SVGShape[];
31
38
  }
32
39
  /**
33
40
  * Data of SVGDocument.
@@ -35,11 +42,11 @@ export interface SVGDocument {
35
42
  * This must build into SVGDocument
36
43
  */
37
44
  export interface SVGDocumentData {
38
- size: Vector2;
39
- nodes: SVGShapeData[];
45
+ size: Vector2;
46
+ nodes: SVGShapeData[];
40
47
  }
41
48
  export interface SVGProps extends ShapeProps {
42
- svg: SignalValue<string>;
49
+ svg: SignalValue<string>;
43
50
  }
44
51
  /**
45
52
  A Node for drawing and animating SVG images.
@@ -48,128 +55,147 @@ A Node for drawing and animating SVG images.
48
55
  If you're not interested in animating SVG, you can use {@link Img} instead.
49
56
  */
50
57
  export declare class SVG extends Shape {
51
- protected static containerElement: HTMLDivElement;
52
- private static svgNodesPool;
53
- /**
54
- * SVG string to be rendered
55
- */
56
- readonly svg: SimpleSignal<string, this>;
57
- /**
58
- * Child to wrap all SVG node
59
- */
60
- wrapper: Node;
61
- private lastTweenTargetSrc;
62
- private lastTweenTargetDocument;
63
- constructor(props: SVGProps);
64
- /**
65
- * Get all SVG nodes with the given id.
66
- * @param id - An id to query.
67
- */
68
- getChildrenById(id: string): Node[];
69
- protected desiredSize(): SerializedVector2<DesiredLength>;
70
- protected getCurrentSize(): {
71
- x: number | null;
72
- y: number | null;
73
- };
74
- protected calculateWrapperScale(documentSize: Vector2, parentSize: SerializedVector2<number | null>): Vector2;
75
- /**
76
- * Convert `SVGDocumentData` to `SVGDocument`.
77
- * @param data - `SVGDocumentData` to convert.
78
- */
79
- protected buildDocument(data: SVGDocumentData): SVGDocument;
80
- /**
81
- * Convert `SVGShapeData` to `SVGShape`.
82
- * @param data - `SVGShapeData` to convert.
83
- */
84
- protected buildShape({ id, type, props, children }: SVGShapeData): SVGShape;
85
- /**
86
- * Convert an SVG string to `SVGDocument`.
87
- * @param svg - An SVG string to be parsed.
88
- */
89
- protected parseSVG(svg: string): SVGDocument;
90
- /**
91
- * Create a tweening list to tween between two SVG nodes.
92
- * @param from - The initial node,
93
- * @param to - The final node.
94
- * @param duration - The duration of the tween.
95
- * @param timing - The timing function.
96
- */
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>;
99
- private wrapperScale;
100
- /**
101
- * Get the current `SVGDocument`.
102
- */
103
- private document;
104
- /**
105
- * Get current document nodes.
106
- */
107
- private documentNodes;
108
- /**
109
- * Convert SVG colors in Shape properties to Motion Canvas colors.
110
- * @param param - Shape properties.
111
- * @returns Converted Shape properties.
112
- */
113
- private processElementStyle;
114
- /**
115
- * Parse an SVG string as `SVGDocumentData`.
116
- * @param svg - And SVG string to be parsed.
117
- * @returns `SVGDocumentData` that can be used to build SVGDocument.
118
- */
119
- protected static parseSVGData(svg: string): SVGDocumentData;
120
- /**
121
- * Get position, rotation and scale from Matrix transformation as Shape properties
122
- * @param transform - Matrix transformation
123
- * @returns MotionCanvas Shape properties
124
- */
125
- protected static getMatrixTransformation(transform: DOMMatrix): ShapeProps;
126
- /**
127
- * Convert an SVG color into a Motion Canvas color.
128
- * @param color - SVG color.
129
- * @returns Motion Canvas color.
130
- */
131
- private static processSVGColor;
132
- /**
133
- * Get the final transformation matrix for the given SVG element.
134
- * @param element - SVG element.
135
- * @param parentTransform - The transformation matrix of the parent.
136
- */
137
- private static getElementTransformation;
138
- private static parseLineCap;
139
- private static parseLineJoin;
140
- private static parseLineDash;
141
- private static parseDashOffset;
142
- private static parseOpacity;
143
- /**
144
- * Convert the SVG element's style to a Motion Canvas Shape properties.
145
- * @param element - An SVG element whose style should be converted.
146
- * @param inheritedStyle - The parent style that should be inherited.
147
- */
148
- private static getElementStyle;
149
- /**
150
- * Extract `SVGShapeData` list from the SVG element's children.
151
- * This will not extract the current element's shape.
152
- * @param element - An element whose children will be extracted.
153
- * @param svgRoot - The SVG root ("svg" tag) of the element.
154
- * @param parentTransform - The transformation matrix applied to the parent.
155
- * @param inheritedStyle - The style of the current SVG `element` that the children should inherit.
156
- */
157
- private static extractGroupNodes;
158
- /**
159
- * Parse a number from an SVG element attribute.
160
- * @param element - SVG element whose attribute will be parsed.
161
- * @param name - The name of the attribute to parse.
162
- * @returns a parsed number or `0` if the attribute is not defined.
163
- */
164
- private static parseNumberAttribute;
165
- /**
166
- * Extract `SVGShapeData` list from the SVG element.
167
- * This will also recursively extract shapes from its children.
168
- * @param child - An SVG element to extract.
169
- * @param svgRoot - The SVG root ("svg" tag) of the element.
170
- * @param parentTransform - The transformation matrix applied to the parent.
171
- * @param inheritedStyle - The style of the parent SVG element that the element should inherit.
172
- */
173
- private static extractElementNodes;
58
+ protected static containerElement: HTMLDivElement;
59
+ private static svgNodesPool;
60
+ /**
61
+ * SVG string to be rendered
62
+ */
63
+ readonly svg: SimpleSignal<string, this>;
64
+ /**
65
+ * Child to wrap all SVG node
66
+ */
67
+ wrapper: Node;
68
+ private lastTweenTargetSrc;
69
+ private lastTweenTargetDocument;
70
+ constructor(props: SVGProps);
71
+ /**
72
+ * Get all SVG nodes with the given id.
73
+ * @param id - An id to query.
74
+ */
75
+ getChildrenById(id: string): Node[];
76
+ protected desiredSize(): SerializedVector2<DesiredLength>;
77
+ protected getCurrentSize(): {
78
+ x: number | null;
79
+ y: number | null;
80
+ };
81
+ protected calculateWrapperScale(
82
+ documentSize: Vector2,
83
+ parentSize: SerializedVector2<number | null>,
84
+ ): Vector2;
85
+ /**
86
+ * Convert `SVGDocumentData` to `SVGDocument`.
87
+ * @param data - `SVGDocumentData` to convert.
88
+ */
89
+ protected buildDocument(data: SVGDocumentData): SVGDocument;
90
+ /**
91
+ * Convert `SVGShapeData` to `SVGShape`.
92
+ * @param data - `SVGShapeData` to convert.
93
+ */
94
+ protected buildShape({id, type, props, children}: SVGShapeData): SVGShape;
95
+ /**
96
+ * Convert an SVG string to `SVGDocument`.
97
+ * @param svg - An SVG string to be parsed.
98
+ */
99
+ protected parseSVG(svg: string): SVGDocument;
100
+ /**
101
+ * Create a tweening list to tween between two SVG nodes.
102
+ * @param from - The initial node,
103
+ * @param to - The final node.
104
+ * @param duration - The duration of the tween.
105
+ * @param timing - The timing function.
106
+ */
107
+ protected generateTransformer(
108
+ from: Node,
109
+ to: Node,
110
+ duration: number,
111
+ timing: TimingFunction,
112
+ ): Generator<ThreadGenerator>;
113
+ protected tweenSvg(
114
+ value: SignalValue<string>,
115
+ time: number,
116
+ timingFunction: TimingFunction,
117
+ ): Generator<
118
+ | void
119
+ | Promise<any>
120
+ | ThreadGenerator
121
+ | import('@revideo/core').Promisable<any>,
122
+ void,
123
+ any
124
+ >;
125
+ private wrapperScale;
126
+ /**
127
+ * Get the current `SVGDocument`.
128
+ */
129
+ private document;
130
+ /**
131
+ * Get current document nodes.
132
+ */
133
+ private documentNodes;
134
+ /**
135
+ * Convert SVG colors in Shape properties to Motion Canvas colors.
136
+ * @param param - Shape properties.
137
+ * @returns Converted Shape properties.
138
+ */
139
+ private processElementStyle;
140
+ /**
141
+ * Parse an SVG string as `SVGDocumentData`.
142
+ * @param svg - And SVG string to be parsed.
143
+ * @returns `SVGDocumentData` that can be used to build SVGDocument.
144
+ */
145
+ protected static parseSVGData(svg: string): SVGDocumentData;
146
+ /**
147
+ * Get position, rotation and scale from Matrix transformation as Shape properties
148
+ * @param transform - Matrix transformation
149
+ * @returns MotionCanvas Shape properties
150
+ */
151
+ protected static getMatrixTransformation(transform: DOMMatrix): ShapeProps;
152
+ /**
153
+ * Convert an SVG color into a Motion Canvas color.
154
+ * @param color - SVG color.
155
+ * @returns Motion Canvas color.
156
+ */
157
+ private static processSVGColor;
158
+ /**
159
+ * Get the final transformation matrix for the given SVG element.
160
+ * @param element - SVG element.
161
+ * @param parentTransform - The transformation matrix of the parent.
162
+ */
163
+ private static getElementTransformation;
164
+ private static parseLineCap;
165
+ private static parseLineJoin;
166
+ private static parseLineDash;
167
+ private static parseDashOffset;
168
+ private static parseOpacity;
169
+ /**
170
+ * Convert the SVG element's style to a Motion Canvas Shape properties.
171
+ * @param element - An SVG element whose style should be converted.
172
+ * @param inheritedStyle - The parent style that should be inherited.
173
+ */
174
+ private static getElementStyle;
175
+ /**
176
+ * Extract `SVGShapeData` list from the SVG element's children.
177
+ * This will not extract the current element's shape.
178
+ * @param element - An element whose children will be extracted.
179
+ * @param svgRoot - The SVG root ("svg" tag) of the element.
180
+ * @param parentTransform - The transformation matrix applied to the parent.
181
+ * @param inheritedStyle - The style of the current SVG `element` that the children should inherit.
182
+ */
183
+ private static extractGroupNodes;
184
+ /**
185
+ * Parse a number from an SVG element attribute.
186
+ * @param element - SVG element whose attribute will be parsed.
187
+ * @param name - The name of the attribute to parse.
188
+ * @returns a parsed number or `0` if the attribute is not defined.
189
+ */
190
+ private static parseNumberAttribute;
191
+ /**
192
+ * Extract `SVGShapeData` list from the SVG element.
193
+ * This will also recursively extract shapes from its children.
194
+ * @param child - An SVG element to extract.
195
+ * @param svgRoot - The SVG root ("svg" tag) of the element.
196
+ * @param parentTransform - The transformation matrix applied to the parent.
197
+ * @param inheritedStyle - The style of the parent SVG element that the element should inherit.
198
+ */
199
+ private static extractElementNodes;
174
200
  }
175
- //# sourceMappingURL=SVG.d.ts.map
201
+ //# sourceMappingURL=SVG.d.ts.map
@@ -1,39 +1,48 @@
1
- import { BBox, SignalValue, SimpleSignal } from '@revideo/core';
2
- import { CanvasStyleSignal } from '../decorators/canvasStyleSignal';
3
- import { PossibleCanvasStyle } from '../partials';
4
- import { Layout, LayoutProps } from './Layout';
1
+ import {BBox, SignalValue, SimpleSignal} from '@revideo/core';
2
+ import {CanvasStyleSignal} from '../decorators/canvasStyleSignal';
3
+ import {PossibleCanvasStyle} from '../partials';
4
+ import {Layout, LayoutProps} from './Layout';
5
5
  export interface ShapeProps extends LayoutProps {
6
- fill?: SignalValue<PossibleCanvasStyle>;
7
- stroke?: SignalValue<PossibleCanvasStyle>;
8
- strokeFirst?: SignalValue<boolean>;
9
- lineWidth?: SignalValue<number>;
10
- lineJoin?: SignalValue<CanvasLineJoin>;
11
- lineCap?: SignalValue<CanvasLineCap>;
12
- lineDash?: SignalValue<number[]>;
13
- lineDashOffset?: SignalValue<number>;
14
- antialiased?: SignalValue<boolean>;
6
+ fill?: SignalValue<PossibleCanvasStyle>;
7
+ stroke?: SignalValue<PossibleCanvasStyle>;
8
+ strokeFirst?: SignalValue<boolean>;
9
+ lineWidth?: SignalValue<number>;
10
+ lineJoin?: SignalValue<CanvasLineJoin>;
11
+ lineCap?: SignalValue<CanvasLineCap>;
12
+ lineDash?: SignalValue<number[]>;
13
+ lineDashOffset?: SignalValue<number>;
14
+ antialiased?: SignalValue<boolean>;
15
15
  }
16
16
  export declare abstract class Shape extends Layout {
17
- readonly fill: CanvasStyleSignal<this>;
18
- readonly stroke: CanvasStyleSignal<this>;
19
- readonly strokeFirst: SimpleSignal<boolean, this>;
20
- readonly lineWidth: SimpleSignal<number, this>;
21
- readonly lineJoin: SimpleSignal<CanvasLineJoin, this>;
22
- readonly lineCap: SimpleSignal<CanvasLineCap, this>;
23
- readonly lineDash: SimpleSignal<number[], this>;
24
- readonly lineDashOffset: SimpleSignal<number, this>;
25
- readonly antialiased: SimpleSignal<boolean, this>;
26
- protected readonly rippleStrength: SimpleSignal<number, this>;
27
- protected rippleSize(): number;
28
- constructor(props: ShapeProps);
29
- protected applyText(context: CanvasRenderingContext2D): void;
30
- protected applyStyle(context: CanvasRenderingContext2D): void;
31
- protected draw(context: CanvasRenderingContext2D): Promise<void>;
32
- protected drawShape(context: CanvasRenderingContext2D): void;
33
- protected getCacheBBox(): BBox;
34
- protected getPath(): Path2D;
35
- protected getRipplePath(): Path2D;
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>;
17
+ readonly fill: CanvasStyleSignal<this>;
18
+ readonly stroke: CanvasStyleSignal<this>;
19
+ readonly strokeFirst: SimpleSignal<boolean, this>;
20
+ readonly lineWidth: SimpleSignal<number, this>;
21
+ readonly lineJoin: SimpleSignal<CanvasLineJoin, this>;
22
+ readonly lineCap: SimpleSignal<CanvasLineCap, this>;
23
+ readonly lineDash: SimpleSignal<number[], this>;
24
+ readonly lineDashOffset: SimpleSignal<number, this>;
25
+ readonly antialiased: SimpleSignal<boolean, this>;
26
+ protected readonly rippleStrength: SimpleSignal<number, this>;
27
+ protected rippleSize(): number;
28
+ constructor(props: ShapeProps);
29
+ protected applyText(context: CanvasRenderingContext2D): void;
30
+ protected applyStyle(context: CanvasRenderingContext2D): void;
31
+ protected draw(context: CanvasRenderingContext2D): Promise<void>;
32
+ protected drawShape(context: CanvasRenderingContext2D): void;
33
+ protected getCacheBBox(): BBox;
34
+ protected getPath(): Path2D;
35
+ protected getRipplePath(): Path2D;
36
+ protected drawRipple(context: CanvasRenderingContext2D): void;
37
+ ripple(
38
+ duration?: number,
39
+ ): Generator<
40
+ | void
41
+ | Promise<any>
42
+ | import('@revideo/core').ThreadGenerator
43
+ | import('@revideo/core').Promisable<any>,
44
+ void,
45
+ any
46
+ >;
38
47
  }
39
- //# sourceMappingURL=Shape.d.ts.map
48
+ //# sourceMappingURL=Shape.d.ts.map
@@ -1,16 +1,22 @@
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';
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';
5
11
  export interface SplineProps extends CurveProps {
6
- /**
7
- * {@inheritDoc Spline.smoothness}
8
- */
9
- smoothness?: SignalValue<number>;
10
- /**
11
- * {@inheritDoc Spline.points}
12
- */
13
- points?: SignalValue<SignalValue<PossibleVector2[]>>;
12
+ /**
13
+ * {@inheritDoc Spline.smoothness}
14
+ */
15
+ smoothness?: SignalValue<number>;
16
+ /**
17
+ * {@inheritDoc Spline.points}
18
+ */
19
+ points?: SignalValue<SignalValue<PossibleVector2[]>>;
14
20
  }
15
21
  /**
16
22
  * A node for drawing a smooth line through a number of points.
@@ -56,32 +62,32 @@ export interface SplineProps extends CurveProps {
56
62
  * ```
57
63
  */
58
64
  export declare class Spline extends Curve {
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;
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;
86
92
  }
87
- //# sourceMappingURL=Spline.d.ts.map
93
+ //# sourceMappingURL=Spline.d.ts.map
@@ -1,51 +1,62 @@
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';
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';
6
12
  type TxtChildren = string | Node | (string | Node)[];
7
13
  type AnyTxt = Txt | TxtLeaf;
8
14
  export interface TxtProps extends ShapeProps {
9
- children?: TxtChildren;
10
- text?: SignalValue<string>;
15
+ children?: TxtChildren;
16
+ text?: SignalValue<string>;
11
17
  }
12
18
  export declare class Txt extends Shape {
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>;
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>;
49
60
  }
50
61
  export {};
51
- //# sourceMappingURL=Txt.d.ts.map
62
+ //# sourceMappingURL=Txt.d.ts.map