@pixerate/editor 0.125.0 → 0.127.0
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/dist/animation/index.d.cts +2 -3
- package/dist/animation/index.d.ts +2 -3
- package/dist/animation-editor/index.cjs +71 -73
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +6 -8
- package/dist/animation-editor/index.d.ts +6 -8
- package/dist/animation-editor/index.js +11 -13
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/{bezier-CBzKKDjl.d.cts → bezier-DBz0IgEt.d.cts} +22 -2
- package/dist/{bezier-CWv6LQal.d.ts → bezier-DWI5MEkI.d.ts} +22 -2
- package/dist/{brushstrokeRender-LRV7GXGD.js → brushstrokeRender-7RUITO42.js} +3 -3
- package/dist/{brushstrokeRender-EELTV7U4.cjs → brushstrokeRender-OW6ENCZG.cjs} +7 -7
- package/dist/{brushstrokeRender-EELTV7U4.cjs.map → brushstrokeRender-OW6ENCZG.cjs.map} +1 -1
- package/dist/canvas/index.cjs +423 -37
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +189 -11
- package/dist/canvas/index.d.ts +189 -11
- package/dist/canvas/index.js +395 -9
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-7LQO6OHH.cjs → chunk-33SO3QWP.cjs} +4 -4
- package/dist/{chunk-7LQO6OHH.cjs.map → chunk-33SO3QWP.cjs.map} +1 -1
- package/dist/{chunk-MPQAO33O.js → chunk-A6KHMKI4.js} +3 -3
- package/dist/{chunk-V5YGPRCZ.cjs → chunk-BEGEWQHD.cjs} +41 -41
- package/dist/{chunk-V5YGPRCZ.cjs.map → chunk-BEGEWQHD.cjs.map} +1 -1
- package/dist/{chunk-N3FVUOZD.cjs → chunk-BJTCSLF6.cjs} +7 -7
- package/dist/{chunk-N3FVUOZD.cjs.map → chunk-BJTCSLF6.cjs.map} +1 -1
- package/dist/{chunk-WUDPFWAN.js → chunk-F7Q2NE2Y.js} +3 -3
- package/dist/{chunk-G6WXWS4Y.js → chunk-FICSDDDF.js} +2 -2
- package/dist/{chunk-GUZ47CJM.cjs → chunk-IZ4WRXZA.cjs} +1 -1
- package/dist/{chunk-GUZ47CJM.cjs.map → chunk-IZ4WRXZA.cjs.map} +1 -1
- package/dist/{chunk-QDJKUBWE.cjs → chunk-JODTP4DP.cjs} +176 -5
- package/dist/chunk-JODTP4DP.cjs.map +1 -0
- package/dist/{chunk-GLWZXQ4Q.js → chunk-KHNZ6MOU.js} +1 -1
- package/dist/chunk-KHNZ6MOU.js.map +1 -0
- package/dist/{chunk-GCJWMEYW.cjs → chunk-KSJLDRHK.cjs} +46 -46
- package/dist/{chunk-GCJWMEYW.cjs.map → chunk-KSJLDRHK.cjs.map} +1 -1
- package/dist/{chunk-QQKTOA4U.cjs → chunk-ORE334I6.cjs} +132 -132
- package/dist/{chunk-QQKTOA4U.cjs.map → chunk-ORE334I6.cjs.map} +1 -1
- package/dist/{chunk-X6KTSFAE.js → chunk-Q4NBEVV5.js} +2 -2
- package/dist/{chunk-XZWOLXWA.js → chunk-QFSTQHZY.js} +174 -3
- package/dist/chunk-QFSTQHZY.js.map +1 -0
- package/dist/{chunk-FPRIUR4T.js → chunk-ROZFX4QI.js} +3 -3
- package/dist/{chunk-UXFI3CDZ.cjs → chunk-SFCPGMCT.cjs} +8 -8
- package/dist/{chunk-UXFI3CDZ.cjs.map → chunk-SFCPGMCT.cjs.map} +1 -1
- package/dist/{chunk-J67OLQUQ.js → chunk-UABQTYQF.js} +3 -3
- package/dist/{chunk-O5RVCDEC.cjs → chunk-XLUYXUBD.cjs} +88 -88
- package/dist/{chunk-O5RVCDEC.cjs.map → chunk-XLUYXUBD.cjs.map} +1 -1
- package/dist/{chunk-FG274FYT.js → chunk-YGJIER2R.js} +2 -2
- package/dist/effects/index.cjs +32 -34
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/index.d.cts +6 -38
- package/dist/effects/index.d.ts +6 -38
- package/dist/effects/index.js +3 -5
- package/dist/effects/index.js.map +1 -1
- package/dist/evaluate-BbCeF6pt.d.ts +114 -0
- package/dist/evaluate-BsxYieLN.d.cts +114 -0
- package/dist/{export-DVl4fWy5.d.cts → export-Cbr9IqpJ.d.cts} +1 -1
- package/dist/{export-Bp7ji2r4.d.cts → export-CcldobdN.d.cts} +3 -3
- package/dist/{export-C1s4eolZ.d.ts → export-ClPKUB-v.d.ts} +1 -1
- package/dist/{export-DAyPY94f.d.ts → export-PGhOpDmz.d.ts} +3 -3
- package/dist/{helpers-i95Ob6Vi.d.cts → helpers-C5aAd44p.d.cts} +67 -4
- package/dist/{helpers-BBLlekuM.d.ts → helpers-CPWcK504.d.ts} +67 -4
- package/dist/image-editor/index.cjs +619 -621
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +9 -11
- package/dist/image-editor/index.d.ts +9 -11
- package/dist/image-editor/index.js +6 -8
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-14PDI5D2.d.ts → opentype-01rMIuQR.d.ts} +1 -1
- package/dist/{opentype-D80AVmMu.d.cts → opentype-BgqvmGT-.d.cts} +1 -1
- package/dist/paint-editor/index.cjs +737 -117
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +248 -13
- package/dist/paint-editor/index.d.ts +248 -13
- package/dist/paint-editor/index.js +635 -15
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{pathfinder-DjISxkUv.d.ts → pathfinder-D-h0Imus.d.ts} +1 -1
- package/dist/{pathfinder-C0UoFypx.d.cts → pathfinder-DgG0Z9Lr.d.cts} +1 -1
- package/dist/{player-cGLrngL_.d.ts → player-BK2kKbfd.d.ts} +1 -1
- package/dist/{player-CBtEoU2x.d.cts → player-CmbY3218.d.cts} +1 -1
- package/dist/pool-C7GtrL34.d.cts +34 -0
- package/dist/pool-CTrtciaN.d.ts +34 -0
- package/dist/{svg-DJKriJ4A.d.ts → svg-BRLwcibA.d.ts} +2 -3
- package/dist/{svg-BkRL-fZJ.d.cts → svg-DLBBPQP9.d.cts} +2 -3
- package/dist/{tools-CM8Oe8F3.d.ts → tools-AugT22z3.d.ts} +1 -1
- package/dist/{tools-DZCv2kX1.d.cts → tools-BpCmUNxb.d.cts} +1 -1
- package/dist/vector/index.cjs +923 -925
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +10 -12
- package/dist/vector/index.d.ts +10 -12
- package/dist/vector/index.js +11 -13
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.cjs +269 -271
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +6 -8
- package/dist/video-editor/index.d.ts +6 -8
- package/dist/video-editor/index.js +3 -5
- package/dist/video-editor/index.js.map +1 -1
- package/dist/{warp-CH9MM435.d.cts → warp-C13L_GRn.d.cts} +1 -1
- package/dist/{warp-k_PdtXOG.d.ts → warp-q8FK5HHi.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +19 -0
- package/skills/pixerate-paint-editor/SKILL.md +40 -1
- package/dist/behavior-Ymbld6jL.d.cts +0 -60
- package/dist/behavior-Ymbld6jL.d.ts +0 -60
- package/dist/chunk-GLWZXQ4Q.js.map +0 -1
- package/dist/chunk-IOXKXQNW.cjs +0 -178
- package/dist/chunk-IOXKXQNW.cjs.map +0 -1
- package/dist/chunk-QDJKUBWE.cjs.map +0 -1
- package/dist/chunk-TGKT5QAB.js +0 -178
- package/dist/chunk-TGKT5QAB.js.map +0 -1
- package/dist/chunk-XZWOLXWA.js.map +0 -1
- package/dist/evaluate-2S3vSPLy.d.cts +0 -55
- package/dist/evaluate-CfmT6xA3.d.ts +0 -55
- package/dist/gradient-KDfCvhuj.d.cts +0 -66
- package/dist/gradient-KDfCvhuj.d.ts +0 -66
- /package/dist/{brushstrokeRender-LRV7GXGD.js.map → brushstrokeRender-7RUITO42.js.map} +0 -0
- /package/dist/{chunk-MPQAO33O.js.map → chunk-A6KHMKI4.js.map} +0 -0
- /package/dist/{chunk-WUDPFWAN.js.map → chunk-F7Q2NE2Y.js.map} +0 -0
- /package/dist/{chunk-G6WXWS4Y.js.map → chunk-FICSDDDF.js.map} +0 -0
- /package/dist/{chunk-X6KTSFAE.js.map → chunk-Q4NBEVV5.js.map} +0 -0
- /package/dist/{chunk-FPRIUR4T.js.map → chunk-ROZFX4QI.js.map} +0 -0
- /package/dist/{chunk-J67OLQUQ.js.map → chunk-UABQTYQF.js.map} +0 -0
- /package/dist/{chunk-FG274FYT.js.map → chunk-YGJIER2R.js.map} +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { b as AnimationEasing } from './easing-lM0Xo9Ni.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Keyframe tracks, independent of what they animate: each track is a list of keyframes
|
|
5
|
-
* `{ time (ms), value, easing }`, where the easing governs the segment *leaving* the keyframe
|
|
6
|
-
* (filmcraft / After Effects convention).
|
|
7
|
-
*/
|
|
8
|
-
/** Keyframe times closer than this (ms) are the same time. */
|
|
9
|
-
declare const ANIMATION_TIME_EPSILON = 0.000001;
|
|
10
|
-
/** A keyframe value: a number, or a CSS colour for colour properties. */
|
|
11
|
-
type AnimationValue = number | string;
|
|
12
|
-
interface AnimationKeyframe {
|
|
13
|
-
/** Time in milliseconds from the start of the timeline. */
|
|
14
|
-
time: number;
|
|
15
|
-
value: AnimationValue;
|
|
16
|
-
/** Easing of the segment from this keyframe to the next (default `linear`). */
|
|
17
|
-
easing?: AnimationEasing;
|
|
18
|
-
}
|
|
19
|
-
interface AnimationTrack {
|
|
20
|
-
keyframes: AnimationKeyframe[];
|
|
21
|
-
/** Disabled tracks keep their keyframes but do not animate (default `true`). */
|
|
22
|
-
enabled?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** How a track's values interpolate: numbers linearly, colours in OKLab. */
|
|
25
|
-
type AnimationValueType = 'number' | 'color';
|
|
26
|
-
/** Whether `value` is a well-formed keyframe. */
|
|
27
|
-
declare function isAnimationKeyframe(value: unknown): value is AnimationKeyframe;
|
|
28
|
-
/**
|
|
29
|
-
* Keyframes sorted by time, invalid entries dropped and duplicate times merged (the *later*
|
|
30
|
-
* entry in the array wins, so appending a keyframe replaces one at the same time). Cached per
|
|
31
|
-
* array (revalidated by element identity), so evaluating every frame does not re-sort; treat
|
|
32
|
-
* keyframe objects as immutable.
|
|
33
|
-
*/
|
|
34
|
-
declare function normalizeKeyframes(keyframes: readonly AnimationKeyframe[] | undefined | null): AnimationKeyframe[];
|
|
35
|
-
|
|
36
|
-
/** How time past the end of the timeline maps back into it. */
|
|
37
|
-
type AnimationLoopMode = 'none' | 'loop' | 'ping-pong';
|
|
38
|
-
/**
|
|
39
|
-
* Interpolates between two keyframe values: numbers linearly, colours in OKLab (premultiplied
|
|
40
|
-
* alpha). Mismatched or unreadable values hold `from` until `t` reaches 1.
|
|
41
|
-
*/
|
|
42
|
-
declare function interpolateAnimationValue(from: AnimationValue, to: AnimationValue, t: number, type?: AnimationValueType): AnimationValue;
|
|
43
|
-
/**
|
|
44
|
-
* A track's value at `time`. Before the first keyframe it holds the first value, after the
|
|
45
|
-
* last the last value. Keyframes may be unsorted or share times (see `normalizeKeyframes`).
|
|
46
|
-
* Returns `undefined` for a track without valid keyframes.
|
|
47
|
-
*/
|
|
48
|
-
declare function evaluateTrack(track: AnimationTrack | readonly AnimationKeyframe[] | undefined | null, time: number, type?: AnimationValueType): AnimationValue | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Maps a running time onto the timeline `[0, duration]`: clamped (`none`), wrapped (`loop`)
|
|
51
|
-
* or bounced (`ping-pong`).
|
|
52
|
-
*/
|
|
53
|
-
declare function wrapAnimationTime(time: number, duration: number, loop?: AnimationLoopMode): number;
|
|
54
|
-
|
|
55
|
-
export { ANIMATION_TIME_EPSILON as A, type AnimationKeyframe as a, type AnimationLoopMode as b, type AnimationTrack as c, type AnimationValue as d, type AnimationValueType as e, evaluateTrack as f, isAnimationKeyframe as g, interpolateAnimationValue as i, normalizeKeyframes as n, wrapAnimationTime as w };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { b as AnimationEasing } from './easing-lM0Xo9Ni.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Keyframe tracks, independent of what they animate: each track is a list of keyframes
|
|
5
|
-
* `{ time (ms), value, easing }`, where the easing governs the segment *leaving* the keyframe
|
|
6
|
-
* (filmcraft / After Effects convention).
|
|
7
|
-
*/
|
|
8
|
-
/** Keyframe times closer than this (ms) are the same time. */
|
|
9
|
-
declare const ANIMATION_TIME_EPSILON = 0.000001;
|
|
10
|
-
/** A keyframe value: a number, or a CSS colour for colour properties. */
|
|
11
|
-
type AnimationValue = number | string;
|
|
12
|
-
interface AnimationKeyframe {
|
|
13
|
-
/** Time in milliseconds from the start of the timeline. */
|
|
14
|
-
time: number;
|
|
15
|
-
value: AnimationValue;
|
|
16
|
-
/** Easing of the segment from this keyframe to the next (default `linear`). */
|
|
17
|
-
easing?: AnimationEasing;
|
|
18
|
-
}
|
|
19
|
-
interface AnimationTrack {
|
|
20
|
-
keyframes: AnimationKeyframe[];
|
|
21
|
-
/** Disabled tracks keep their keyframes but do not animate (default `true`). */
|
|
22
|
-
enabled?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** How a track's values interpolate: numbers linearly, colours in OKLab. */
|
|
25
|
-
type AnimationValueType = 'number' | 'color';
|
|
26
|
-
/** Whether `value` is a well-formed keyframe. */
|
|
27
|
-
declare function isAnimationKeyframe(value: unknown): value is AnimationKeyframe;
|
|
28
|
-
/**
|
|
29
|
-
* Keyframes sorted by time, invalid entries dropped and duplicate times merged (the *later*
|
|
30
|
-
* entry in the array wins, so appending a keyframe replaces one at the same time). Cached per
|
|
31
|
-
* array (revalidated by element identity), so evaluating every frame does not re-sort; treat
|
|
32
|
-
* keyframe objects as immutable.
|
|
33
|
-
*/
|
|
34
|
-
declare function normalizeKeyframes(keyframes: readonly AnimationKeyframe[] | undefined | null): AnimationKeyframe[];
|
|
35
|
-
|
|
36
|
-
/** How time past the end of the timeline maps back into it. */
|
|
37
|
-
type AnimationLoopMode = 'none' | 'loop' | 'ping-pong';
|
|
38
|
-
/**
|
|
39
|
-
* Interpolates between two keyframe values: numbers linearly, colours in OKLab (premultiplied
|
|
40
|
-
* alpha). Mismatched or unreadable values hold `from` until `t` reaches 1.
|
|
41
|
-
*/
|
|
42
|
-
declare function interpolateAnimationValue(from: AnimationValue, to: AnimationValue, t: number, type?: AnimationValueType): AnimationValue;
|
|
43
|
-
/**
|
|
44
|
-
* A track's value at `time`. Before the first keyframe it holds the first value, after the
|
|
45
|
-
* last the last value. Keyframes may be unsorted or share times (see `normalizeKeyframes`).
|
|
46
|
-
* Returns `undefined` for a track without valid keyframes.
|
|
47
|
-
*/
|
|
48
|
-
declare function evaluateTrack(track: AnimationTrack | readonly AnimationKeyframe[] | undefined | null, time: number, type?: AnimationValueType): AnimationValue | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Maps a running time onto the timeline `[0, duration]`: clamped (`none`), wrapped (`loop`)
|
|
51
|
-
* or bounced (`ping-pong`).
|
|
52
|
-
*/
|
|
53
|
-
declare function wrapAnimationTime(time: number, duration: number, loop?: AnimationLoopMode): number;
|
|
54
|
-
|
|
55
|
-
export { ANIMATION_TIME_EPSILON as A, type AnimationKeyframe as a, type AnimationLoopMode as b, type AnimationTrack as c, type AnimationValue as d, type AnimationValueType as e, evaluateTrack as f, isAnimationKeyframe as g, interpolateAnimationValue as i, normalizeKeyframes as n, wrapAnimationTime as w };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canvas gradient models, parsing, presets, and SVG defs generation.
|
|
3
|
-
* Supports linear and radial gradients for shape fills, strokes, and freehand drawing.
|
|
4
|
-
*/
|
|
5
|
-
interface GradientStop {
|
|
6
|
-
offset: number;
|
|
7
|
-
color: string;
|
|
8
|
-
opacity?: number;
|
|
9
|
-
}
|
|
10
|
-
interface CanvasLinearGradient {
|
|
11
|
-
type: 'linear';
|
|
12
|
-
angle?: number;
|
|
13
|
-
stops: GradientStop[];
|
|
14
|
-
}
|
|
15
|
-
interface CanvasRadialGradient {
|
|
16
|
-
type: 'radial';
|
|
17
|
-
cx?: number;
|
|
18
|
-
cy?: number;
|
|
19
|
-
r?: number;
|
|
20
|
-
stops: GradientStop[];
|
|
21
|
-
}
|
|
22
|
-
type CanvasGradientDef = CanvasLinearGradient | CanvasRadialGradient;
|
|
23
|
-
interface SvgGradientStop {
|
|
24
|
-
offset: string;
|
|
25
|
-
stopColor: string;
|
|
26
|
-
stopOpacity?: number;
|
|
27
|
-
}
|
|
28
|
-
interface SvgGradientDef {
|
|
29
|
-
id: string;
|
|
30
|
-
type: 'linear' | 'radial';
|
|
31
|
-
attrs: Record<string, string | number>;
|
|
32
|
-
stops: SvgGradientStop[];
|
|
33
|
-
}
|
|
34
|
-
declare const PIXERATE_BRAND_GRADIENT: CanvasLinearGradient;
|
|
35
|
-
declare const CANVAS_GRADIENT_PRESETS: Record<string, CanvasLinearGradient>;
|
|
36
|
-
/** Whether an arbitrary value matches a CanvasGradientDef object. */
|
|
37
|
-
declare function isCanvasGradient(value: unknown): value is CanvasGradientDef;
|
|
38
|
-
/**
|
|
39
|
-
* Parses CSS linear-gradient or radial-gradient strings into CanvasGradientDef.
|
|
40
|
-
* Supports forms like:
|
|
41
|
-
* - linear-gradient(90deg, #ff0000 0%, #0000ff 100%)
|
|
42
|
-
* - linear-gradient(to right, red, blue)
|
|
43
|
-
* - radial-gradient(circle, red 0%, blue 100%)
|
|
44
|
-
*/
|
|
45
|
-
declare function parseCssGradient(css: string): CanvasGradientDef | null;
|
|
46
|
-
/**
|
|
47
|
-
* Resolves a paint value (which could be a CSS color, preset name, CSS gradient string, or CanvasGradientDef)
|
|
48
|
-
* into either a CanvasGradientDef (if gradient) or null (if solid color or invalid).
|
|
49
|
-
*/
|
|
50
|
-
declare function resolveCanvasGradient(value: unknown): CanvasGradientDef | null;
|
|
51
|
-
/**
|
|
52
|
-
* Converts degrees clockwise (CSS angle: 0 = top, 90 = right, 180 = bottom, 270 = left)
|
|
53
|
-
* to SVG linearGradient vector coordinates (x1, y1, x2, y2) normalized [0, 1].
|
|
54
|
-
*/
|
|
55
|
-
declare function angleToSvgLinearCoords(angleDeg?: number): {
|
|
56
|
-
x1: number;
|
|
57
|
-
y1: number;
|
|
58
|
-
x2: number;
|
|
59
|
-
y2: number;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Converts a CanvasGradientDef to an SvgGradientDef descriptor ready for rendering `<linearGradient>` / `<radialGradient>`.
|
|
63
|
-
*/
|
|
64
|
-
declare function gradientToSvgDef(gradient: CanvasGradientDef, id: string): SvgGradientDef;
|
|
65
|
-
|
|
66
|
-
export { type CanvasGradientDef as C, type GradientStop as G, PIXERATE_BRAND_GRADIENT as P, type SvgGradientDef as S, CANVAS_GRADIENT_PRESETS as a, type CanvasLinearGradient as b, type CanvasRadialGradient as c, type SvgGradientStop as d, angleToSvgLinearCoords as e, gradientToSvgDef as g, isCanvasGradient as i, parseCssGradient as p, resolveCanvasGradient as r };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canvas gradient models, parsing, presets, and SVG defs generation.
|
|
3
|
-
* Supports linear and radial gradients for shape fills, strokes, and freehand drawing.
|
|
4
|
-
*/
|
|
5
|
-
interface GradientStop {
|
|
6
|
-
offset: number;
|
|
7
|
-
color: string;
|
|
8
|
-
opacity?: number;
|
|
9
|
-
}
|
|
10
|
-
interface CanvasLinearGradient {
|
|
11
|
-
type: 'linear';
|
|
12
|
-
angle?: number;
|
|
13
|
-
stops: GradientStop[];
|
|
14
|
-
}
|
|
15
|
-
interface CanvasRadialGradient {
|
|
16
|
-
type: 'radial';
|
|
17
|
-
cx?: number;
|
|
18
|
-
cy?: number;
|
|
19
|
-
r?: number;
|
|
20
|
-
stops: GradientStop[];
|
|
21
|
-
}
|
|
22
|
-
type CanvasGradientDef = CanvasLinearGradient | CanvasRadialGradient;
|
|
23
|
-
interface SvgGradientStop {
|
|
24
|
-
offset: string;
|
|
25
|
-
stopColor: string;
|
|
26
|
-
stopOpacity?: number;
|
|
27
|
-
}
|
|
28
|
-
interface SvgGradientDef {
|
|
29
|
-
id: string;
|
|
30
|
-
type: 'linear' | 'radial';
|
|
31
|
-
attrs: Record<string, string | number>;
|
|
32
|
-
stops: SvgGradientStop[];
|
|
33
|
-
}
|
|
34
|
-
declare const PIXERATE_BRAND_GRADIENT: CanvasLinearGradient;
|
|
35
|
-
declare const CANVAS_GRADIENT_PRESETS: Record<string, CanvasLinearGradient>;
|
|
36
|
-
/** Whether an arbitrary value matches a CanvasGradientDef object. */
|
|
37
|
-
declare function isCanvasGradient(value: unknown): value is CanvasGradientDef;
|
|
38
|
-
/**
|
|
39
|
-
* Parses CSS linear-gradient or radial-gradient strings into CanvasGradientDef.
|
|
40
|
-
* Supports forms like:
|
|
41
|
-
* - linear-gradient(90deg, #ff0000 0%, #0000ff 100%)
|
|
42
|
-
* - linear-gradient(to right, red, blue)
|
|
43
|
-
* - radial-gradient(circle, red 0%, blue 100%)
|
|
44
|
-
*/
|
|
45
|
-
declare function parseCssGradient(css: string): CanvasGradientDef | null;
|
|
46
|
-
/**
|
|
47
|
-
* Resolves a paint value (which could be a CSS color, preset name, CSS gradient string, or CanvasGradientDef)
|
|
48
|
-
* into either a CanvasGradientDef (if gradient) or null (if solid color or invalid).
|
|
49
|
-
*/
|
|
50
|
-
declare function resolveCanvasGradient(value: unknown): CanvasGradientDef | null;
|
|
51
|
-
/**
|
|
52
|
-
* Converts degrees clockwise (CSS angle: 0 = top, 90 = right, 180 = bottom, 270 = left)
|
|
53
|
-
* to SVG linearGradient vector coordinates (x1, y1, x2, y2) normalized [0, 1].
|
|
54
|
-
*/
|
|
55
|
-
declare function angleToSvgLinearCoords(angleDeg?: number): {
|
|
56
|
-
x1: number;
|
|
57
|
-
y1: number;
|
|
58
|
-
x2: number;
|
|
59
|
-
y2: number;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Converts a CanvasGradientDef to an SvgGradientDef descriptor ready for rendering `<linearGradient>` / `<radialGradient>`.
|
|
63
|
-
*/
|
|
64
|
-
declare function gradientToSvgDef(gradient: CanvasGradientDef, id: string): SvgGradientDef;
|
|
65
|
-
|
|
66
|
-
export { type CanvasGradientDef as C, type GradientStop as G, PIXERATE_BRAND_GRADIENT as P, type SvgGradientDef as S, CANVAS_GRADIENT_PRESETS as a, type CanvasLinearGradient as b, type CanvasRadialGradient as c, type SvgGradientStop as d, angleToSvgLinearCoords as e, gradientToSvgDef as g, isCanvasGradient as i, parseCssGradient as p, resolveCanvasGradient as r };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|