Skip to content

Commit 94204d6

Browse files
authored
Merge pull request #483 from Shopify/fix/skia-value-name
Rename SkiaValue to SkiaMutableValue and SkiaReadonlyValue to SkiaValue
2 parents 425b28e + 6a05a5f commit 94204d6

File tree

36 files changed

+95
-98
lines changed

36 files changed

+95
-98
lines changed

example/src/Examples/Animation/AnimationWithTouchHandler2.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React from "react";
22
import { StyleSheet, Dimensions } from "react-native";
3-
import type { AnimationState, SkiaValue } from "@shopify/react-native-skia";
3+
import type {
4+
AnimationState,
5+
SkiaMutableValue,
6+
} from "@shopify/react-native-skia";
47
import {
58
ValueApi,
69
Canvas,
@@ -21,7 +24,10 @@ interface PhysicsAnimationState extends AnimationState {
2124
velocity: number;
2225
}
2326

24-
const runBouncing = (translate: SkiaValue<number>, initialVelocity: number) => {
27+
const runBouncing = (
28+
translate: SkiaMutableValue<number>,
29+
initialVelocity: number
30+
) => {
2531
translate.animation = ValueApi.createAnimation<PhysicsAnimationState>(
2632
(now, state) => {
2733
if (state === undefined) {

example/src/Examples/Aurora/components/CoonsPatchMeshGradient.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import React from "react";
2-
import type {
3-
CubicBezierHandle,
4-
SkiaReadonlyValue,
5-
} from "@shopify/react-native-skia";
2+
import type { CubicBezierHandle, SkiaValue } from "@shopify/react-native-skia";
63
import {
74
Skia,
85
isEdge,
@@ -45,7 +42,7 @@ const rectToColors = (
4542
) => [colors[tl], colors[tr], colors[br], colors[bl]] as const;
4643

4744
const useRectToPatch = (
48-
mesh: SkiaReadonlyValue<CubicBezierHandle[]>,
45+
mesh: SkiaValue<CubicBezierHandle[]>,
4946
indices: readonly number[]
5047
) =>
5148
useDerivedValue(() => {
@@ -207,7 +204,7 @@ interface RectPatchProps {
207204
debug?: boolean;
208205
lines?: boolean;
209206
colors: string[];
210-
mesh: SkiaReadonlyValue<CubicBezierHandle[]>;
207+
mesh: SkiaValue<CubicBezierHandle[]>;
211208
defaultMesh: CubicBezierHandle[];
212209
}
213210

example/src/Examples/Aurora/components/Cubic.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import React from "react";
2-
import type {
3-
SkiaReadonlyValue,
4-
CubicBezierHandle,
5-
} from "@shopify/react-native-skia";
2+
import type { SkiaValue, CubicBezierHandle } from "@shopify/react-native-skia";
63
import {
74
Line,
85
Paint,
@@ -13,7 +10,7 @@ import {
1310
import { symmetric } from "./Math";
1411

1512
interface CubicProps {
16-
mesh: SkiaReadonlyValue<CubicBezierHandle[]>;
13+
mesh: SkiaValue<CubicBezierHandle[]>;
1714
index: number;
1815
color: string;
1916
}

example/src/Examples/Aurora/components/Curves.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import type { PatchProps, SkiaReadonlyValue } from "@shopify/react-native-skia";
1+
import type { PatchProps, SkiaValue } from "@shopify/react-native-skia";
22
import { useDerivedValue, Path, Skia } from "@shopify/react-native-skia";
33
import React from "react";
44

55
interface CurvesProps {
6-
patch: SkiaReadonlyValue<PatchProps["patch"]>;
6+
patch: SkiaValue<PatchProps["patch"]>;
77
}
88

99
export const Curves = ({ patch }: CurvesProps) => {

example/src/Examples/Aurora/components/useHandles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {
2-
SkiaValue,
2+
SkiaMutableValue,
33
CubicBezierHandle,
44
SkRect,
55
} from "@shopify/react-native-skia";
@@ -18,7 +18,7 @@ type TouchSelection = null | {
1818
};
1919

2020
export const useHandles = (
21-
mesh: SkiaValue<CubicBezierHandle[]>,
21+
mesh: SkiaMutableValue<CubicBezierHandle[]>,
2222
defaultMesh: CubicBezierHandle[],
2323
window: SkRect
2424
) => {

example/src/Examples/Breathe/Breathe.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { Dimensions, StyleSheet } from "react-native";
3-
import type { SkiaReadonlyValue } from "@shopify/react-native-skia";
3+
import type { SkiaValue } from "@shopify/react-native-skia";
44
import {
55
useDerivedValue,
66
useLoop,
@@ -23,7 +23,7 @@ const center = vec(width / 2, height / 2 - 64);
2323

2424
interface RingProps {
2525
index: number;
26-
progress: SkiaReadonlyValue<number>;
26+
progress: SkiaValue<number>;
2727
}
2828

2929
const Ring = ({ index, progress }: RingProps) => {

example/src/Examples/Matrix/Symbol.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useRef } from "react";
2-
import type { SkiaReadonlyValue, SkFont } from "@shopify/react-native-skia";
2+
import type { SkiaValue, SkFont } from "@shopify/react-native-skia";
33
import {
44
useDerivedValue,
55
interpolateColors,
@@ -17,7 +17,7 @@ const pos = vec(0, 0);
1717
interface SymbolProps {
1818
i: number;
1919
j: number;
20-
timestamp: SkiaReadonlyValue<number>;
20+
timestamp: SkiaValue<number>;
2121
stream: number[];
2222
font: SkFont;
2323
symbols: number[];

example/src/Examples/Neumorphism/Dashboard/components/Control.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Text,
99
Circle,
1010
} from "@shopify/react-native-skia";
11-
import type { SkiaReadonlyValue, SkFont } from "@shopify/react-native-skia";
11+
import type { SkiaValue, SkFont } from "@shopify/react-native-skia";
1212
import type { ReactNode } from "react";
1313
import React from "react";
1414

@@ -19,7 +19,7 @@ const r = 25;
1919
interface ControlProps {
2020
x: number;
2121
y: number;
22-
progress: SkiaReadonlyValue<number>;
22+
progress: SkiaValue<number>;
2323
label: string;
2424
children: ReactNode;
2525
active: boolean;

example/src/Examples/Neumorphism/Dashboard/components/Mode.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { SkiaReadonlyValue } from "@shopify/react-native-skia";
1+
import type { SkiaValue } from "@shopify/react-native-skia";
22
import {
33
BackdropBlur,
44
rect,
@@ -15,7 +15,7 @@ import React from "react";
1515
const clip = rrect(rect(0, 596, 390, 844), 40, 40);
1616

1717
interface ModeProps {
18-
translateY: SkiaReadonlyValue<number>;
18+
translateY: SkiaValue<number>;
1919
}
2020

2121
export const Mode = ({ translateY }: ModeProps) => {

example/src/Examples/Neumorphism/Dashboard/components/ProgressBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { SkiaReadonlyValue } from "@shopify/react-native-skia";
1+
import type { SkiaValue } from "@shopify/react-native-skia";
22
import {
33
BoxShadow,
44
rect,
@@ -28,7 +28,7 @@ const fromCircle = (cx: number, cy: number, r: number) =>
2828
rrect(rect(cx - r, cy - r, 2 * r, 2 * r), r, r);
2929

3030
interface ProgressBarProps {
31-
progress: SkiaReadonlyValue<number>;
31+
progress: SkiaValue<number>;
3232
}
3333

3434
const colors = ["#2FB8FF", "#9EECD9"];

0 commit comments

Comments
 (0)