Skip to content

Commit a64c148

Browse files
authored
fix: remove v2 suffix from Animation types (#123)
1 parent 5cb1dab commit a64c148

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

src/compiler/compiler.types.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ export interface CompilerOptions {
2424
/**
2525
* A `react-native-css` StyleSheet
2626
*/
27-
export type ReactNativeCssStyleSheet = ReactNativeCssStyleSheet_V2;
28-
29-
export interface ReactNativeCssStyleSheet_V2 {
27+
export interface ReactNativeCssStyleSheet {
3028
/** Feature flags */
3129
f?: FeatureFlagRecord;
3230
/** rem */
3331
r?: number;
3432
/** StyleRuleSets */
3533
s?: (readonly [string, StyleRuleSet])[];
3634
/** KeyFrames */
37-
k?: Animation_V2[];
35+
k?: Animation[];
3836
/** Root Variables */
3937
vr?: RootVariables;
4038
/** Universal Variables */
@@ -158,11 +156,11 @@ export type InlineVariable = {
158156
[key: string]: unknown | undefined;
159157
};
160158

161-
/****************************** Animations V2 ******************************/
159+
/****************************** Animations ******************************/
162160

163-
export type Animation_V2 = [string, AnimationKeyframes_V2[]];
164-
export type AnimationRecord = Record<string, AnimationKeyframes_V2[]>;
165-
export type AnimationKeyframes_V2 = [string | number, StyleDeclaration[]];
161+
export type Animation = [string, AnimationKeyframes[]];
162+
export type AnimationRecord = Record<string, AnimationKeyframes[]>;
163+
export type AnimationKeyframes = [string | number, StyleDeclaration[]];
166164

167165
/****************************** Conditions ******************************/
168166

@@ -257,7 +255,7 @@ export type LoggerOptions = {
257255
export interface CompilerCollection extends CompilerOptions {
258256
features: FeatureFlagRecord;
259257
rules: Map<string, StyleRule[]>;
260-
keyframes: Map<string, AnimationKeyframes_V2[]>;
258+
keyframes: Map<string, AnimationKeyframes[]>;
261259
darkMode?: string | null;
262260
rootVariables: VariableRecord;
263261
universalVariables: VariableRecord;

src/compiler/stylesheet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
specificityCompareFn,
77
} from "../runtime/utils";
88
import type {
9-
AnimationKeyframes_V2,
9+
AnimationKeyframes,
1010
AnimationRecord,
1111
CompilerOptions,
1212
ContainerQuery,
@@ -39,7 +39,7 @@ const extraRules = new WeakMap<StyleRule, Partial<StyleRule>[]>();
3939
const keywords = new Set(["unset"]);
4040

4141
export class StylesheetBuilder {
42-
animationFrames?: AnimationKeyframes_V2[];
42+
animationFrames?: AnimationKeyframes[];
4343
animationDeclarations: StyleDeclaration[] = [];
4444

4545
stylesheet: ReactNativeCssStyleSheet = {};

src/metro/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import connect from "connect";
66
import debug from "debug";
77
import type { MetroConfig } from "metro-config";
88

9-
import type { CompilerOptions, ReactNativeCssStyleSheet_V2 } from "../compiler";
9+
import type { CompilerOptions, ReactNativeCssStyleSheet } from "../compiler";
1010
import { compile } from "../compiler/compiler";
1111
import { getNativeInjectionCode, getWebInjectionCode } from "./injection-code";
1212
import { nativeResolver, webResolver } from "./resolver";
@@ -97,7 +97,7 @@ export function withReactNativeCSS<
9797

9898
const nativeCSSFiles = new Map<
9999
string,
100-
[string, ReactNativeCssStyleSheet_V2]
100+
[string, ReactNativeCssStyleSheet]
101101
>();
102102
const webCSSFiles = new Set<string>();
103103

src/style-collection/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {
2-
Animation_V2,
2+
Animation,
33
ReactNativeCssStyleSheet,
44
StyleRuleSet,
55
} from "react-native-css/compiler";
@@ -17,7 +17,7 @@ export { rootVariables, universalVariables };
1717

1818
interface StyleCollectionType {
1919
styles: ReturnType<typeof family<string, Observable<StyleRuleSet>>>;
20-
keyframes: ReturnType<typeof family<string, Observable<Animation_V2[1]>>>;
20+
keyframes: ReturnType<typeof family<string, Observable<Animation[1]>>>;
2121
inject: (options: ReactNativeCssStyleSheet) => void;
2222
}
2323

@@ -29,7 +29,7 @@ globalThis.__react_native_css_style_collection ??= {
2929
styles: family<string, Observable<StyleRuleSet>>(() => {
3030
return observable([], isDeepEqual);
3131
}),
32-
keyframes: family<string, Observable<Animation_V2[1]>>(() => {
32+
keyframes: family<string, Observable<Animation[1]>>(() => {
3333
return observable([], isDeepEqual);
3434
}),
3535
inject: function (options: ReactNativeCssStyleSheet) {

0 commit comments

Comments
 (0)