diff --git a/src/compiler/compiler.types.ts b/src/compiler/compiler.types.ts index 57631a91..c34bc650 100644 --- a/src/compiler/compiler.types.ts +++ b/src/compiler/compiler.types.ts @@ -24,9 +24,7 @@ export interface CompilerOptions { /** * A `react-native-css` StyleSheet */ -export type ReactNativeCssStyleSheet = ReactNativeCssStyleSheet_V2; - -export interface ReactNativeCssStyleSheet_V2 { +export interface ReactNativeCssStyleSheet { /** Feature flags */ f?: FeatureFlagRecord; /** rem */ @@ -34,7 +32,7 @@ export interface ReactNativeCssStyleSheet_V2 { /** StyleRuleSets */ s?: (readonly [string, StyleRuleSet])[]; /** KeyFrames */ - k?: Animation_V2[]; + k?: Animation[]; /** Root Variables */ vr?: RootVariables; /** Universal Variables */ @@ -158,11 +156,11 @@ export type InlineVariable = { [key: string]: unknown | undefined; }; -/****************************** Animations V2 ******************************/ +/****************************** Animations ******************************/ -export type Animation_V2 = [string, AnimationKeyframes_V2[]]; -export type AnimationRecord = Record; -export type AnimationKeyframes_V2 = [string | number, StyleDeclaration[]]; +export type Animation = [string, AnimationKeyframes[]]; +export type AnimationRecord = Record; +export type AnimationKeyframes = [string | number, StyleDeclaration[]]; /****************************** Conditions ******************************/ @@ -257,7 +255,7 @@ export type LoggerOptions = { export interface CompilerCollection extends CompilerOptions { features: FeatureFlagRecord; rules: Map; - keyframes: Map; + keyframes: Map; darkMode?: string | null; rootVariables: VariableRecord; universalVariables: VariableRecord; diff --git a/src/compiler/stylesheet.ts b/src/compiler/stylesheet.ts index 4906a6d5..f67ab99f 100644 --- a/src/compiler/stylesheet.ts +++ b/src/compiler/stylesheet.ts @@ -6,7 +6,7 @@ import { specificityCompareFn, } from "../runtime/utils"; import type { - AnimationKeyframes_V2, + AnimationKeyframes, AnimationRecord, CompilerOptions, ContainerQuery, @@ -39,7 +39,7 @@ const extraRules = new WeakMap[]>(); const keywords = new Set(["unset"]); export class StylesheetBuilder { - animationFrames?: AnimationKeyframes_V2[]; + animationFrames?: AnimationKeyframes[]; animationDeclarations: StyleDeclaration[] = []; stylesheet: ReactNativeCssStyleSheet = {}; diff --git a/src/metro/index.ts b/src/metro/index.ts index 275d5453..dfbed7f3 100644 --- a/src/metro/index.ts +++ b/src/metro/index.ts @@ -6,7 +6,7 @@ import connect from "connect"; import debug from "debug"; import type { MetroConfig } from "metro-config"; -import type { CompilerOptions, ReactNativeCssStyleSheet_V2 } from "../compiler"; +import type { CompilerOptions, ReactNativeCssStyleSheet } from "../compiler"; import { compile } from "../compiler/compiler"; import { getNativeInjectionCode, getWebInjectionCode } from "./injection-code"; import { nativeResolver, webResolver } from "./resolver"; @@ -97,7 +97,7 @@ export function withReactNativeCSS< const nativeCSSFiles = new Map< string, - [string, ReactNativeCssStyleSheet_V2] + [string, ReactNativeCssStyleSheet] >(); const webCSSFiles = new Set(); diff --git a/src/style-collection/index.ts b/src/style-collection/index.ts index a82fc0bd..e3299b5f 100644 --- a/src/style-collection/index.ts +++ b/src/style-collection/index.ts @@ -1,5 +1,5 @@ import type { - Animation_V2, + Animation, ReactNativeCssStyleSheet, StyleRuleSet, } from "react-native-css/compiler"; @@ -17,7 +17,7 @@ export { rootVariables, universalVariables }; interface StyleCollectionType { styles: ReturnType>>; - keyframes: ReturnType>>; + keyframes: ReturnType>>; inject: (options: ReactNativeCssStyleSheet) => void; } @@ -29,7 +29,7 @@ globalThis.__react_native_css_style_collection ??= { styles: family>(() => { return observable([], isDeepEqual); }), - keyframes: family>(() => { + keyframes: family>(() => { return observable([], isDeepEqual); }), inject: function (options: ReactNativeCssStyleSheet) {