-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathindex.ts
38 lines (36 loc) · 1008 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { JsxWidget } from "@web-builder/core";
import { ReactComponentExportResult } from "@web-builder/react-core";
import {
reactnative as rn_config,
react as react_config,
} from "@grida/builder-config";
import {
ReactNativeStyleSheetModuleBuilder,
ReactNativeStyleSheeteWidgetModuleExportable,
} from "./rn-style-sheet-module-builder";
/**
* standard `StyleSheet.create` pattern for react-native
* @todo - this is not fully implemented
* @param entry
* @returns
*/
export default function finalizeReactNativeWidget_StyleSheet(
entry: JsxWidget,
{
styling,
exporting,
}: {
styling: rn_config.ReactNativeStyleSheetConfig;
exporting: react_config.ReactComponentExportingCofnig;
}
): ReactComponentExportResult {
const builder = new ReactNativeStyleSheetModuleBuilder({
entry,
config: styling,
});
return builder.asExportableModule().finalize(exporting);
}
export {
ReactNativeStyleSheetModuleBuilder,
ReactNativeStyleSheeteWidgetModuleExportable,
};