@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.
- package/editor/editor/tsconfig.build.tsbuildinfo +1 -1
- package/editor/index.js +380 -151
- package/editor/index.js.map +1 -1
- package/lib/code/CodeCursor.d.ts +74 -74
- package/lib/code/CodeDiffer.d.ts +21 -16
- package/lib/code/CodeDiffer.js +39 -41
- package/lib/code/CodeFragment.d.ts +16 -8
- package/lib/code/CodeFragment.js +36 -36
- package/lib/code/CodeHighlighter.d.ts +59 -59
- package/lib/code/CodeHighlighter.js +1 -1
- package/lib/code/CodeMetrics.d.ts +12 -8
- package/lib/code/CodeMetrics.js +26 -24
- package/lib/code/CodeRange.d.ts +21 -5
- package/lib/code/CodeRange.js +131 -124
- package/lib/code/CodeScope.d.ts +18 -8
- package/lib/code/CodeSelection.d.ts +9 -4
- package/lib/code/CodeSelection.js +8 -8
- package/lib/code/CodeSignal.d.ts +74 -47
- package/lib/code/CodeTokenizer.d.ts +1 -1
- package/lib/code/CodeTokenizer.js +41 -41
- package/lib/code/DefaultHighlightStyle.d.ts +2 -2
- package/lib/code/DefaultHighlightStyle.js +96 -96
- package/lib/code/LezerHighlighter.d.ts +21 -19
- package/lib/code/diff.d.ts +12 -9
- package/lib/code/diff.js +218 -205
- package/lib/code/extractRange.d.ts +7 -4
- package/lib/code/extractRange.js +79 -71
- package/lib/code/index.d.ts +1 -1
- package/lib/code/index.js +1 -1
- package/lib/components/Audio.d.ts +11 -11
- package/lib/components/Bezier.d.ts +18 -18
- package/lib/components/Circle.d.ts +95 -90
- package/lib/components/Code.d.ts +244 -211
- package/lib/components/CodeBlock.d.ts +1 -1
- package/lib/components/CubicBezier.d.ts +36 -36
- package/lib/components/Curve.d.ts +208 -198
- package/lib/components/Grid.d.ts +47 -42
- package/lib/components/Icon.d.ts +55 -50
- package/lib/components/Img.d.ts +86 -79
- package/lib/components/Knot.d.ts +97 -78
- package/lib/components/Latex.d.ts +12 -12
- package/lib/components/Layout.d.ts +455 -413
- package/lib/components/Line.d.ts +61 -49
- package/lib/components/Node.d.ts +1 -1
- package/lib/components/Path.d.ts +1 -1
- package/lib/components/Polygon.d.ts +60 -55
- package/lib/components/QuadBezier.d.ts +29 -29
- package/lib/components/Ray.d.ts +28 -28
- package/lib/components/Rect.d.ts +115 -108
- package/lib/components/SVG.d.ts +1 -1
- package/lib/components/Shape.d.ts +1 -1
- package/lib/components/Spline.d.ts +46 -40
- package/lib/components/Txt.d.ts +55 -44
- package/lib/components/TxtLeaf.d.ts +20 -16
- package/lib/components/View2D.d.ts +22 -22
- package/lib/components/index.d.ts +1 -1
- package/lib/components/types.d.ts +22 -9
- package/lib/curves/ArcSegment.d.ts +36 -24
- package/lib/curves/CircleSegment.d.ts +26 -16
- package/lib/curves/CubicBezierSegment.d.ts +18 -13
- package/lib/curves/CurveDrawingInfo.d.ts +9 -9
- package/lib/curves/CurvePoint.d.ts +13 -13
- package/lib/curves/CurveProfile.d.ts +5 -5
- package/lib/curves/CurveProfile.js +1 -1
- package/lib/curves/KnotInfo.d.ts +8 -8
- package/lib/curves/LineSegment.d.ts +19 -14
- package/lib/curves/Polynomial.d.ts +110 -110
- package/lib/curves/Polynomial2D.d.ts +20 -20
- package/lib/curves/PolynomialSegment.d.ts +42 -37
- package/lib/curves/QuadBezierSegment.d.ts +12 -12
- package/lib/curves/Segment.d.ts +12 -7
- package/lib/curves/UniformPolynomialCurveSampler.d.ts +34 -34
- package/lib/curves/createCurveProfileLerp.d.ts +17 -6
- package/lib/curves/getBezierSplineProfile.d.ts +8 -4
- package/lib/curves/getCircleProfile.d.ts +10 -4
- package/lib/curves/getPathProfile.d.ts +2 -2
- package/lib/curves/getPointAtDistance.d.ts +7 -4
- package/lib/curves/getPolylineProfile.d.ts +8 -4
- package/lib/curves/getRectProfile.d.ts +9 -4
- package/lib/curves/index.d.ts +1 -1
- package/lib/curves/index.js +1 -1
- package/lib/decorators/canvasStyleSignal.d.ts +3 -3
- package/lib/decorators/colorSignal.d.ts +1 -1
- package/lib/decorators/compound.d.ts +4 -2
- package/lib/decorators/computed.d.ts +1 -1
- package/lib/decorators/defaultStyle.d.ts +5 -2
- package/lib/decorators/filtersSignal.d.ts +28 -8
- package/lib/decorators/index.d.ts +1 -1
- package/lib/decorators/index.js +1 -1
- package/lib/decorators/initializers.d.ts +5 -2
- package/lib/decorators/initializers.js +18 -19
- package/lib/decorators/nodeName.d.ts +1 -1
- package/lib/decorators/nodeName.js +4 -4
- package/lib/decorators/signal.d.ts +40 -20
- package/lib/decorators/spacingSignal.d.ts +1 -1
- package/lib/decorators/vector2Signal.d.ts +13 -7
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/jsx-dev-runtime.d.ts +3 -3
- package/lib/jsx-dev-runtime.js +3 -3
- package/lib/jsx-runtime.d.ts +19 -9
- package/lib/jsx-runtime.js +18 -18
- package/lib/partials/Filter.d.ts +24 -16
- package/lib/partials/Gradient.d.ts +30 -24
- package/lib/partials/Pattern.d.ts +14 -9
- package/lib/partials/ShaderConfig.d.ts +81 -74
- package/lib/partials/index.d.ts +1 -1
- package/lib/partials/index.js +1 -1
- package/lib/partials/types.d.ts +19 -6
- package/lib/scenes/Scene2D.d.ts +42 -23
- package/lib/scenes/index.d.ts +1 -1
- package/lib/scenes/index.js +1 -1
- package/lib/scenes/makeScene2D.d.ts +7 -5
- package/lib/scenes/useScene2D.d.ts +2 -2
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/utils/diff.d.ts +25 -18
- package/lib/utils/diff.js +84 -87
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/is.d.ts +4 -2
- package/lib/utils/is.js +2 -2
- package/lib/utils/makeSignalExtensions.d.ts +11 -4
- package/package.json +5 -5
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
package/lib/components/Txt.d.ts
CHANGED
|
@@ -1,51 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
10
|
-
|
|
15
|
+
children?: TxtChildren;
|
|
16
|
+
text?: SignalValue<string>;
|
|
11
17
|
}
|
|
12
18
|
export declare class Txt extends Shape {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
6
|
-
|
|
5
|
+
children?: string;
|
|
6
|
+
text?: SignalValue<string>;
|
|
7
7
|
}
|
|
8
8
|
export declare class TxtLeaf extends Shape {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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;
|
|
19
23
|
}
|
|
20
|
-
//# sourceMappingURL=TxtLeaf.d.ts.map
|
|
24
|
+
//# sourceMappingURL=TxtLeaf.d.ts.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
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
|
-
|
|
5
|
+
assetHash: string;
|
|
6
6
|
}
|
|
7
7
|
export declare class View2D extends Rect {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export type ComponentChild =
|
|
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;
|
|
4
12
|
export type ComponentChildren = ComponentChild | ComponentChild[];
|
|
5
13
|
export type NodeChildren = Node | Node[];
|
|
6
|
-
export type PropsOf<T> =
|
|
14
|
+
export type PropsOf<T> =
|
|
15
|
+
T extends NodeConstructor<infer P>
|
|
16
|
+
? P
|
|
17
|
+
: T extends FunctionComponent<infer P>
|
|
18
|
+
? P
|
|
19
|
+
: never;
|
|
7
20
|
export interface JSXProps {
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
children?: ComponentChildren;
|
|
22
|
+
ref?: ReferenceReceiver<Node>;
|
|
10
23
|
}
|
|
11
24
|
export interface FunctionComponent<T = any> {
|
|
12
|
-
|
|
25
|
+
(props: T): Node | null;
|
|
13
26
|
}
|
|
14
27
|
export interface NodeConstructor<TProps = any, TNode = Node> {
|
|
15
|
-
|
|
28
|
+
new (props: TProps): TNode;
|
|
16
29
|
}
|
|
17
|
-
//# sourceMappingURL=types.d.ts.map
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,26 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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;
|
|
25
37
|
}
|
|
26
|
-
//# sourceMappingURL=ArcSegment.d.ts.map
|
|
38
|
+
//# sourceMappingURL=ArcSegment.d.ts.map
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {Vector2} from '@revideo/core';
|
|
2
|
+
import {CurvePoint} from './CurvePoint';
|
|
3
|
+
import {Segment} from './Segment';
|
|
4
4
|
export declare class CircleSegment extends Segment {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
private center;
|
|
6
|
+
private radius;
|
|
7
|
+
private from;
|
|
8
|
+
private to;
|
|
9
|
+
private counter;
|
|
10
|
+
private readonly length;
|
|
11
|
+
private readonly angle;
|
|
12
|
+
readonly points: Vector2[];
|
|
13
|
+
constructor(
|
|
14
|
+
center: Vector2,
|
|
15
|
+
radius: number,
|
|
16
|
+
from: Vector2,
|
|
17
|
+
to: Vector2,
|
|
18
|
+
counter: boolean,
|
|
19
|
+
);
|
|
20
|
+
get arcLength(): number;
|
|
21
|
+
draw(
|
|
22
|
+
context: CanvasRenderingContext2D | Path2D,
|
|
23
|
+
from: number,
|
|
24
|
+
to: number,
|
|
25
|
+
): [CurvePoint, CurvePoint];
|
|
26
|
+
getPoint(distance: number): CurvePoint;
|
|
17
27
|
}
|
|
18
|
-
//# sourceMappingURL=CircleSegment.d.ts.map
|
|
28
|
+
//# sourceMappingURL=CircleSegment.d.ts.map
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {Vector2} from '@revideo/core';
|
|
2
|
+
import {PolynomialSegment} from './PolynomialSegment';
|
|
3
3
|
/**
|
|
4
4
|
* A spline segment representing a cubic Bézier curve.
|
|
5
5
|
*/
|
|
6
6
|
export declare class CubicBezierSegment extends PolynomialSegment {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
readonly p0: Vector2;
|
|
8
|
+
readonly p1: Vector2;
|
|
9
|
+
readonly p2: Vector2;
|
|
10
|
+
readonly p3: Vector2;
|
|
11
|
+
private static el;
|
|
12
|
+
get points(): Vector2[];
|
|
13
|
+
constructor(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2);
|
|
14
|
+
split(t: number): [PolynomialSegment, PolynomialSegment];
|
|
15
|
+
protected doDraw(context: CanvasRenderingContext2D | Path2D): void;
|
|
16
|
+
protected static getLength(
|
|
17
|
+
p0: Vector2,
|
|
18
|
+
p1: Vector2,
|
|
19
|
+
p2: Vector2,
|
|
20
|
+
p3: Vector2,
|
|
21
|
+
): number;
|
|
17
22
|
}
|
|
18
|
-
//# sourceMappingURL=CubicBezierSegment.d.ts.map
|
|
23
|
+
//# sourceMappingURL=CubicBezierSegment.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Vector2} from '@revideo/core';
|
|
2
2
|
export interface CurveDrawingInfo {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
path: Path2D;
|
|
4
|
+
arrowSize: number;
|
|
5
|
+
endPoint: Vector2;
|
|
6
|
+
endTangent: Vector2;
|
|
7
|
+
startPoint: Vector2;
|
|
8
|
+
startTangent: Vector2;
|
|
9
|
+
startOffset: number;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=CurveDrawingInfo.d.ts.map
|
|
11
|
+
//# sourceMappingURL=CurveDrawingInfo.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {Vector2} from '@revideo/core';
|
|
2
2
|
export interface CurvePoint {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
position: Vector2;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* The tangent is currently inconsistent for different types of curves and may
|
|
7
|
+
* sometimes return the normal of the point, instead. This will be fixed in
|
|
8
|
+
* the next major version but is kept as is for now for backwards
|
|
9
|
+
* compatibility reasons. To always get the real tangent of the point, you can
|
|
10
|
+
* use `normal.flipped.perpendicular`, instead.
|
|
11
|
+
*/
|
|
12
|
+
tangent: Vector2;
|
|
13
|
+
normal: Vector2;
|
|
14
14
|
}
|
|
15
|
-
//# sourceMappingURL=CurvePoint.d.ts.map
|
|
15
|
+
//# sourceMappingURL=CurvePoint.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Segment} from './Segment';
|
|
2
2
|
export interface CurveProfile {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
arcLength: number;
|
|
4
|
+
segments: Segment[];
|
|
5
|
+
minSin: number;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=CurveProfile.d.ts.map
|
|
7
|
+
//# sourceMappingURL=CurveProfile.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ3VydmVQcm9maWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi9jdXJ2ZXMvQ3VydmVQcm9maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ3VydmVQcm9maWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi9jdXJ2ZXMvQ3VydmVQcm9maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
package/lib/curves/KnotInfo.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Vector2} from '@revideo/core';
|
|
2
2
|
export type KnotAutoHandles = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
5
|
};
|
|
6
6
|
export interface KnotInfo {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
position: Vector2;
|
|
8
|
+
startHandle: Vector2;
|
|
9
|
+
endHandle: Vector2;
|
|
10
|
+
auto: KnotAutoHandles;
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=KnotInfo.d.ts.map
|
|
12
|
+
//# sourceMappingURL=KnotInfo.d.ts.map
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {Vector2} from '@revideo/core';
|
|
2
|
+
import {CurvePoint} from './CurvePoint';
|
|
3
|
+
import {Segment} from './Segment';
|
|
4
4
|
export declare class LineSegment extends Segment {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
readonly from: Vector2;
|
|
6
|
+
readonly to: Vector2;
|
|
7
|
+
private readonly length;
|
|
8
|
+
private readonly vector;
|
|
9
|
+
private readonly normal;
|
|
10
|
+
readonly points: Vector2[];
|
|
11
|
+
constructor(from: Vector2, to: Vector2);
|
|
12
|
+
get arcLength(): number;
|
|
13
|
+
draw(
|
|
14
|
+
context: CanvasRenderingContext2D | Path2D,
|
|
15
|
+
start?: number,
|
|
16
|
+
end?: number,
|
|
17
|
+
move?: boolean,
|
|
18
|
+
): [CurvePoint, CurvePoint];
|
|
19
|
+
getPoint(distance: number): CurvePoint;
|
|
15
20
|
}
|
|
16
|
-
//# sourceMappingURL=LineSegment.d.ts.map
|
|
21
|
+
//# sourceMappingURL=LineSegment.d.ts.map
|