@serviomi/expo-settings 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.eslintrc.js +5 -0
  2. package/.expo/README.md +13 -0
  3. package/.expo/devices.json +3 -0
  4. package/.expo/settings.json +3 -0
  5. package/README.md +35 -0
  6. package/build/ExpoSettings.types.d.ts +18 -0
  7. package/build/ExpoSettings.types.d.ts.map +1 -0
  8. package/build/ExpoSettings.types.js +2 -0
  9. package/build/ExpoSettings.types.js.map +1 -0
  10. package/build/ExpoSettingsModule.d.ts +10 -0
  11. package/build/ExpoSettingsModule.d.ts.map +1 -0
  12. package/build/ExpoSettingsModule.js +4 -0
  13. package/build/ExpoSettingsModule.js.map +1 -0
  14. package/build/ExpoSettingsModule.web.d.ts +10 -0
  15. package/build/ExpoSettingsModule.web.d.ts.map +1 -0
  16. package/build/ExpoSettingsModule.web.js +12 -0
  17. package/build/ExpoSettingsModule.web.js.map +1 -0
  18. package/build/ExpoSettingsView.d.ts +4 -0
  19. package/build/ExpoSettingsView.d.ts.map +1 -0
  20. package/build/ExpoSettingsView.js +7 -0
  21. package/build/ExpoSettingsView.js.map +1 -0
  22. package/build/ExpoSettingsView.web.d.ts +4 -0
  23. package/build/ExpoSettingsView.web.d.ts.map +1 -0
  24. package/build/ExpoSettingsView.web.js +7 -0
  25. package/build/ExpoSettingsView.web.js.map +1 -0
  26. package/build/index.d.ts +4 -0
  27. package/build/index.d.ts.map +1 -0
  28. package/build/index.js +6 -0
  29. package/build/index.js.map +1 -0
  30. package/expo-module.config.json +9 -0
  31. package/package.json +43 -0
  32. package/serviomi-expo-settings-0.1.0.tgz +0 -0
  33. package/src/ExpoSettings.types.ts +19 -0
  34. package/src/ExpoSettingsModule.ts +12 -0
  35. package/src/ExpoSettingsModule.web.ts +15 -0
  36. package/src/ExpoSettingsView.tsx +11 -0
  37. package/src/ExpoSettingsView.web.tsx +15 -0
  38. package/src/index.ts +5 -0
  39. package/tsconfig.json +9 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ['universe/native', 'universe/web'],
4
+ ignorePatterns: ['build'],
5
+ };
@@ -0,0 +1,13 @@
1
+ > Why do I have a folder named ".expo" in my project?
2
+
3
+ The ".expo" folder is created when an Expo project is started using "expo start" command.
4
+
5
+ > What do the files contain?
6
+
7
+ - "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
8
+ - "settings.json": contains the server configuration that is used to serve the application manifest.
9
+
10
+ > Should I commit the ".expo" folder?
11
+
12
+ No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
13
+ Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
@@ -0,0 +1,3 @@
1
+ {
2
+ "devices": []
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "urlRandomness": "t_8bk2w"
3
+ }
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # expo-settings
2
+
3
+ My new module
4
+
5
+ # API documentation
6
+
7
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/settings/)
8
+ - [Documentation for the main branch](https://docs.expo.dev/versions/unversioned/sdk/settings/)
9
+
10
+ # Installation in managed Expo projects
11
+
12
+ For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#api-documentation). If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
13
+
14
+ # Installation in bare React Native projects
15
+
16
+ For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
17
+
18
+ ### Add the package to your npm dependencies
19
+
20
+ ```
21
+ npm install expo-settings
22
+ ```
23
+
24
+ ### Configure for Android
25
+
26
+
27
+
28
+
29
+ ### Configure for iOS
30
+
31
+ Run `npx pod-install` after installing the npm package.
32
+
33
+ # Contributing
34
+
35
+ Contributions are very welcome! Please refer to guidelines described in the [contributing guide]( https://github.com/expo/expo#contributing).
@@ -0,0 +1,18 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
2
+ export type OnLoadEventPayload = {
3
+ url: string;
4
+ };
5
+ export type ExpoSettingsModuleEvents = {
6
+ onChange: (params: ChangeEventPayload) => void;
7
+ };
8
+ export type ChangeEventPayload = {
9
+ value: string;
10
+ };
11
+ export type ExpoSettingsViewProps = {
12
+ url: string;
13
+ onLoad: (event: {
14
+ nativeEvent: OnLoadEventPayload;
15
+ }) => void;
16
+ style?: StyleProp<ViewStyle>;
17
+ };
18
+ //# sourceMappingURL=ExpoSettings.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettings.types.d.ts","sourceRoot":"","sources":["../src/ExpoSettings.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,kBAAkB,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ExpoSettings.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettings.types.js","sourceRoot":"","sources":["../src/ExpoSettings.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nexport type OnLoadEventPayload = {\n url: string;\n};\n\nexport type ExpoSettingsModuleEvents = {\n onChange: (params: ChangeEventPayload) => void;\n};\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\nexport type ExpoSettingsViewProps = {\n url: string;\n onLoad: (event: { nativeEvent: OnLoadEventPayload }) => void;\n style?: StyleProp<ViewStyle>;\n};\n"]}
@@ -0,0 +1,10 @@
1
+ import { NativeModule } from 'expo';
2
+ import { ExpoSettingsModuleEvents } from './ExpoSettings.types';
3
+ declare class ExpoSettingsModule extends NativeModule<ExpoSettingsModuleEvents> {
4
+ PI: number;
5
+ hello(): string;
6
+ setValueAsync(value: string): Promise<void>;
7
+ }
8
+ declare const _default: ExpoSettingsModule;
9
+ export default _default;
10
+ //# sourceMappingURL=ExpoSettingsModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsModule.d.ts","sourceRoot":"","sources":["../src/ExpoSettingsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,OAAO,kBAAmB,SAAQ,YAAY,CAAC,wBAAwB,CAAC;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,IAAI,MAAM;IACf,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAC5C;;AAGD,wBAAuE"}
@@ -0,0 +1,4 @@
1
+ import { requireNativeModule } from 'expo';
2
+ // This call loads the native module object from the JSI.
3
+ export default requireNativeModule('ExpoSettings');
4
+ //# sourceMappingURL=ExpoSettingsModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsModule.js","sourceRoot":"","sources":["../src/ExpoSettingsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAUzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAqB,cAAc,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { ExpoSettingsModuleEvents } from './ExpoSettings.types';\n\ndeclare class ExpoSettingsModule extends NativeModule<ExpoSettingsModuleEvents> {\n PI: number;\n hello(): string;\n setValueAsync(value: string): Promise<void>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoSettingsModule>('ExpoSettings');\n"]}
@@ -0,0 +1,10 @@
1
+ import { NativeModule } from 'expo';
2
+ import { ExpoSettingsModuleEvents } from './ExpoSettings.types';
3
+ declare class ExpoSettingsModule extends NativeModule<ExpoSettingsModuleEvents> {
4
+ PI: number;
5
+ setValueAsync(value: string): Promise<void>;
6
+ hello(): string;
7
+ }
8
+ declare const _default: typeof ExpoSettingsModule;
9
+ export default _default;
10
+ //# sourceMappingURL=ExpoSettingsModule.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsModule.web.d.ts","sourceRoot":"","sources":["../src/ExpoSettingsModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,cAAM,kBAAmB,SAAQ,YAAY,CAAC,wBAAwB,CAAC;IACrE,EAAE,SAAW;IACP,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGjD,KAAK;CAGN;;AAED,wBAA2E"}
@@ -0,0 +1,12 @@
1
+ import { registerWebModule, NativeModule } from 'expo';
2
+ class ExpoSettingsModule extends NativeModule {
3
+ PI = Math.PI;
4
+ async setValueAsync(value) {
5
+ this.emit('onChange', { value });
6
+ }
7
+ hello() {
8
+ return 'Hello world! 👋';
9
+ }
10
+ }
11
+ export default registerWebModule(ExpoSettingsModule, 'ExpoSettingsModule');
12
+ //# sourceMappingURL=ExpoSettingsModule.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsModule.web.js","sourceRoot":"","sources":["../src/ExpoSettingsModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAIvD,MAAM,kBAAmB,SAAQ,YAAsC;IACrE,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACb,KAAK,CAAC,aAAa,CAAC,KAAa;QAC/B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,KAAK;QACH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF;AAED,eAAe,iBAAiB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { registerWebModule, NativeModule } from 'expo';\n\nimport { ExpoSettingsModuleEvents } from './ExpoSettings.types';\n\nclass ExpoSettingsModule extends NativeModule<ExpoSettingsModuleEvents> {\n PI = Math.PI;\n async setValueAsync(value: string): Promise<void> {\n this.emit('onChange', { value });\n }\n hello() {\n return 'Hello world! 👋';\n }\n}\n\nexport default registerWebModule(ExpoSettingsModule, 'ExpoSettingsModule');\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { ExpoSettingsViewProps } from './ExpoSettings.types';
3
+ export default function ExpoSettingsView(props: ExpoSettingsViewProps): React.JSX.Element;
4
+ //# sourceMappingURL=ExpoSettingsView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsView.d.ts","sourceRoot":"","sources":["../src/ExpoSettingsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAEpE"}
@@ -0,0 +1,7 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+ const NativeView = requireNativeView('ExpoSettings');
4
+ export default function ExpoSettingsView(props) {
5
+ return <NativeView {...props}/>;
6
+ }
7
+ //# sourceMappingURL=ExpoSettingsView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsView.js","sourceRoot":"","sources":["../src/ExpoSettingsView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,UAAU,GACd,iBAAiB,CAAC,cAAc,CAAC,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA4B;IACnE,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACnC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\n\nimport { ExpoSettingsViewProps } from './ExpoSettings.types';\n\nconst NativeView: React.ComponentType<ExpoSettingsViewProps> =\n requireNativeView('ExpoSettings');\n\nexport default function ExpoSettingsView(props: ExpoSettingsViewProps) {\n return <NativeView {...props} />;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { ExpoSettingsViewProps } from './ExpoSettings.types';
3
+ export default function ExpoSettingsView(props: ExpoSettingsViewProps): React.JSX.Element;
4
+ //# sourceMappingURL=ExpoSettingsView.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsView.web.d.ts","sourceRoot":"","sources":["../src/ExpoSettingsView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAUpE"}
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export default function ExpoSettingsView(props) {
3
+ return (<div>
4
+ <iframe style={{ flex: 1 }} src={props.url} onLoad={() => props.onLoad({ nativeEvent: { url: props.url } })}/>
5
+ </div>);
6
+ }
7
+ //# sourceMappingURL=ExpoSettingsView.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoSettingsView.web.js","sourceRoot":"","sources":["../src/ExpoSettingsView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA4B;IACnE,OAAO,CACL,CAAC,GAAG,CACF;MAAA,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CACnB,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACf,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAEpE;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\n\nimport { ExpoSettingsViewProps } from './ExpoSettings.types';\n\nexport default function ExpoSettingsView(props: ExpoSettingsViewProps) {\n return (\n <div>\n <iframe\n style={{ flex: 1 }}\n src={props.url}\n onLoad={() => props.onLoad({ nativeEvent: { url: props.url } })}\n />\n </div>\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export { default } from './ExpoSettingsModule';
2
+ export { default as ExpoSettingsView } from './ExpoSettingsView';
3
+ export * from './ExpoSettings.types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,cAAe,sBAAsB,CAAC"}
package/build/index.js ADDED
@@ -0,0 +1,6 @@
1
+ // Reexport the native module. On web, it will be resolved to ExpoSettingsModule.web.ts
2
+ // and on native platforms to ExpoSettingsModule.ts
3
+ export { default } from './ExpoSettingsModule';
4
+ export { default as ExpoSettingsView } from './ExpoSettingsView';
5
+ export * from './ExpoSettings.types';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,mDAAmD;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,cAAe,sBAAsB,CAAC","sourcesContent":["// Reexport the native module. On web, it will be resolved to ExpoSettingsModule.web.ts\n// and on native platforms to ExpoSettingsModule.ts\nexport { default } from './ExpoSettingsModule';\nexport { default as ExpoSettingsView } from './ExpoSettingsView';\nexport * from './ExpoSettings.types';\n"]}
@@ -0,0 +1,9 @@
1
+ {
2
+ "platforms": ["apple", "android", "web"],
3
+ "apple": {
4
+ "modules": ["ExpoSettingsModule"]
5
+ },
6
+ "android": {
7
+ "modules": ["expo.modules.settings.ExpoSettingsModule"]
8
+ }
9
+ }
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@serviomi/expo-settings",
3
+ "version": "0.1.0",
4
+ "description": "test-expo-settings",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "scripts": {
8
+ "build": "expo-module build",
9
+ "clean": "expo-module clean",
10
+ "lint": "expo-module lint",
11
+ "test": "expo-module test",
12
+ "prepare": "expo-module prepare",
13
+ "prepublishOnly": "expo-module prepublishOnly",
14
+ "expo-module": "expo-module",
15
+ "open:ios": "xed example/ios",
16
+ "open:android": "open -a \"Android Studio\" example/android"
17
+ },
18
+ "keywords": [
19
+ "react-native",
20
+ "expo",
21
+ "expo-settings",
22
+ "ExpoSettings"
23
+ ],
24
+ "repository": "https://github.com/serviom/expo-settings",
25
+ "bugs": {
26
+ "url": "https://github.com/serviom/expo-settings/issues"
27
+ },
28
+ "author": "serviom <iomm@ukr.net> (https://github.com/serviom)",
29
+ "license": "MIT",
30
+ "homepage": "https://github.com/serviom/expo-settings#readme",
31
+ "dependencies": {},
32
+ "devDependencies": {
33
+ "@types/react": "~19.1.0",
34
+ "expo-module-scripts": "^5.0.8",
35
+ "expo": "^54.0.27",
36
+ "react-native": "0.81.5"
37
+ },
38
+ "peerDependencies": {
39
+ "expo": "*",
40
+ "react": "*",
41
+ "react-native": "*"
42
+ }
43
+ }
Binary file
@@ -0,0 +1,19 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
2
+
3
+ export type OnLoadEventPayload = {
4
+ url: string;
5
+ };
6
+
7
+ export type ExpoSettingsModuleEvents = {
8
+ onChange: (params: ChangeEventPayload) => void;
9
+ };
10
+
11
+ export type ChangeEventPayload = {
12
+ value: string;
13
+ };
14
+
15
+ export type ExpoSettingsViewProps = {
16
+ url: string;
17
+ onLoad: (event: { nativeEvent: OnLoadEventPayload }) => void;
18
+ style?: StyleProp<ViewStyle>;
19
+ };
@@ -0,0 +1,12 @@
1
+ import { NativeModule, requireNativeModule } from 'expo';
2
+
3
+ import { ExpoSettingsModuleEvents } from './ExpoSettings.types';
4
+
5
+ declare class ExpoSettingsModule extends NativeModule<ExpoSettingsModuleEvents> {
6
+ PI: number;
7
+ hello(): string;
8
+ setValueAsync(value: string): Promise<void>;
9
+ }
10
+
11
+ // This call loads the native module object from the JSI.
12
+ export default requireNativeModule<ExpoSettingsModule>('ExpoSettings');
@@ -0,0 +1,15 @@
1
+ import { registerWebModule, NativeModule } from 'expo';
2
+
3
+ import { ExpoSettingsModuleEvents } from './ExpoSettings.types';
4
+
5
+ class ExpoSettingsModule extends NativeModule<ExpoSettingsModuleEvents> {
6
+ PI = Math.PI;
7
+ async setValueAsync(value: string): Promise<void> {
8
+ this.emit('onChange', { value });
9
+ }
10
+ hello() {
11
+ return 'Hello world! 👋';
12
+ }
13
+ }
14
+
15
+ export default registerWebModule(ExpoSettingsModule, 'ExpoSettingsModule');
@@ -0,0 +1,11 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+
4
+ import { ExpoSettingsViewProps } from './ExpoSettings.types';
5
+
6
+ const NativeView: React.ComponentType<ExpoSettingsViewProps> =
7
+ requireNativeView('ExpoSettings');
8
+
9
+ export default function ExpoSettingsView(props: ExpoSettingsViewProps) {
10
+ return <NativeView {...props} />;
11
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+
3
+ import { ExpoSettingsViewProps } from './ExpoSettings.types';
4
+
5
+ export default function ExpoSettingsView(props: ExpoSettingsViewProps) {
6
+ return (
7
+ <div>
8
+ <iframe
9
+ style={{ flex: 1 }}
10
+ src={props.url}
11
+ onLoad={() => props.onLoad({ nativeEvent: { url: props.url } })}
12
+ />
13
+ </div>
14
+ );
15
+ }
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ // Reexport the native module. On web, it will be resolved to ExpoSettingsModule.web.ts
2
+ // and on native platforms to ExpoSettingsModule.ts
3
+ export { default } from './ExpoSettingsModule';
4
+ export { default as ExpoSettingsView } from './ExpoSettingsView';
5
+ export * from './ExpoSettings.types';
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ // @generated by expo-module-scripts
2
+ {
3
+ "extends": "expo-module-scripts/tsconfig.base",
4
+ "compilerOptions": {
5
+ "outDir": "./build"
6
+ },
7
+ "include": ["./src"],
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__rsc_tests__/*"]
9
+ }