diff --git a/examples/expo-example/src/app.tsx b/examples/expo-example/src/app.tsx
index 165dae4..48c0f65 100644
--- a/examples/expo-example/src/app.tsx
+++ b/examples/expo-example/src/app.tsx
@@ -7,6 +7,7 @@ import { StatusBar } from "expo-status-bar";
import { Text, View } from "react-native";
import { registerRootComponent } from "expo";
import { Pressable, Stylable, useYoshiki } from "yoshiki/native";
+import { Card } from "./common";
const CustomBox = ({ color, ...props }: { color: string } & Stylable) => {
const { css } = useYoshiki();
@@ -60,6 +61,7 @@ function App() {
+ Test +
+ ); +}; diff --git a/examples/expo-example/src/components/text.d.ts b/examples/expo-example/src/components/text.d.ts new file mode 100644 index 0000000..0fb47f8 --- /dev/null +++ b/examples/expo-example/src/components/text.d.ts @@ -0,0 +1,10 @@ +// +// Copyright (c) Zoe Roux and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for details. +// + +import { FunctionComponent, ReactNode } from "react"; +import { Stylable } from "yoshiki"; + +export type PProps = Stylable<"text"> & { children: ReactNode | string}; +export declare const P: FunctionComponent+ {children} +
+ ); +}); diff --git a/packages/yoshiki/package.json b/packages/yoshiki/package.json index a264e19..123e8ad 100644 --- a/packages/yoshiki/package.json +++ b/packages/yoshiki/package.json @@ -14,6 +14,7 @@ "url": "https://github.com/AnonymusRaccoon/yoshiki/issues" }, "main": "src/index.ts", + "react-native": "src/native/index.ts", "types": "src/index.ts", "source": "src/index.ts", "scripts": { diff --git a/packages/yoshiki/src/index.ts b/packages/yoshiki/src/index.ts index ae8ef0d..c6ab52c 100644 --- a/packages/yoshiki/src/index.ts +++ b/packages/yoshiki/src/index.ts @@ -5,17 +5,20 @@ import { useYoshiki as useWebYoshiki, + Platform, type Stylable as WebStylable, type StylableHoverable as WebStylableHoverable, + type YsWeb, } from "./web"; import type { Stylable as NativeStylable, StylableHoverable as NativeStylableHoverable, + YsNative, } from "./native"; -import { YsStyleProps } from "./native/generator"; -import { Theme } from "./theme"; -import { WithState, EnhancedStyle } from "./type"; +import type { YsStyleProps } from "./native/generator"; +import type { Theme } from "./theme"; +import type { WithState, EnhancedStyle, Length } from "./type"; import type { ViewStyle, ImageStyle, TextStyle } from "react-native"; export const useYoshiki = (): { @@ -23,7 +26,7 @@ export const useYoshiki = (): { Style extends ViewStyle | TextStyle | ImageStyle, State extends Partial