react-native-theme-flow
Version:
react native style sheet with theme
26 lines • 1.15 kB
TypeScript
import { type PropsWithChildren } from 'react';
import { type ScaledSize } from 'react-native';
import type { NestedObject, RNStyle, ValueOrFactory, WithId } from './types';
export declare const createThemeFlow: <ThemeContract extends NestedObject, ExtraData extends Record<string, any> = any>() => {
ThemeProvider: ({ children, theme, extraData, }: PropsWithChildren<{
theme: WithId<ThemeContract>;
extraData?: ExtraData;
}>) => import("react/jsx-runtime").JSX.Element;
useTheme: () => WithId<ThemeContract>;
useThemeFlow: () => {
theme: WithId<ThemeContract>;
extraData?: ExtraData;
};
ThemeFlow: {
create: <O extends {
[key: string]: ValueOrFactory<RNStyle, any>;
}>(namedStyles: ValueOrFactory<O, {
theme: WithId<ThemeContract>;
windowDimensions: ScaledSize;
} & ExtraData>) => {
use: () => { [K in keyof O]: O[K] extends (input: infer P) => infer S ? (input: P) => S : O[K]; };
};
};
themeFactory: (theme: ThemeContract) => WithId<ThemeContract>;
};
//# sourceMappingURL=create-theme-flow.d.ts.map