react-native-simple-note-pitch-detector 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 (51) hide show
  1. package/.eslintrc.js +5 -0
  2. package/README.md +1 -0
  3. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  4. package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
  7. package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
  8. package/android/.gradle/7.4.2/gc.properties +0 -0
  9. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  10. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  11. package/android/.gradle/vcs-1/gc.properties +0 -0
  12. package/android/build.gradle +89 -0
  13. package/android/src/main/AndroidManifest.xml +2 -0
  14. package/android/src/main/java/expo/modules/simplenotepitchdetector/ReactNativeSimpleNotePitchDetectorModule.kt +47 -0
  15. package/android/src/main/java/expo/modules/simplenotepitchdetector/ReactNativeSimpleNotePitchDetectorView.kt +7 -0
  16. package/build/ReactNativeSimpleNotePitchDetector.types.d.ts +7 -0
  17. package/build/ReactNativeSimpleNotePitchDetector.types.d.ts.map +1 -0
  18. package/build/ReactNativeSimpleNotePitchDetector.types.js +2 -0
  19. package/build/ReactNativeSimpleNotePitchDetector.types.js.map +1 -0
  20. package/build/ReactNativeSimpleNotePitchDetectorModule.d.ts +3 -0
  21. package/build/ReactNativeSimpleNotePitchDetectorModule.d.ts.map +1 -0
  22. package/build/ReactNativeSimpleNotePitchDetectorModule.js +5 -0
  23. package/build/ReactNativeSimpleNotePitchDetectorModule.js.map +1 -0
  24. package/build/ReactNativeSimpleNotePitchDetectorModule.web.d.ts +7 -0
  25. package/build/ReactNativeSimpleNotePitchDetectorModule.web.d.ts.map +1 -0
  26. package/build/ReactNativeSimpleNotePitchDetectorModule.web.js +12 -0
  27. package/build/ReactNativeSimpleNotePitchDetectorModule.web.js.map +1 -0
  28. package/build/ReactNativeSimpleNotePitchDetectorView.d.ts +4 -0
  29. package/build/ReactNativeSimpleNotePitchDetectorView.d.ts.map +1 -0
  30. package/build/ReactNativeSimpleNotePitchDetectorView.js +7 -0
  31. package/build/ReactNativeSimpleNotePitchDetectorView.js.map +1 -0
  32. package/build/ReactNativeSimpleNotePitchDetectorView.web.d.ts +4 -0
  33. package/build/ReactNativeSimpleNotePitchDetectorView.web.d.ts.map +1 -0
  34. package/build/ReactNativeSimpleNotePitchDetectorView.web.js +6 -0
  35. package/build/ReactNativeSimpleNotePitchDetectorView.web.js.map +1 -0
  36. package/build/index.d.ts +9 -0
  37. package/build/index.d.ts.map +1 -0
  38. package/build/index.js +19 -0
  39. package/build/index.js.map +1 -0
  40. package/expo-module.config.json +9 -0
  41. package/ios/ReactNativeSimpleNotePitchDetector.podspec +27 -0
  42. package/ios/ReactNativeSimpleNotePitchDetectorModule.swift +44 -0
  43. package/ios/ReactNativeSimpleNotePitchDetectorView.swift +7 -0
  44. package/package.json +42 -0
  45. package/src/ReactNativeSimpleNotePitchDetector.types.ts +7 -0
  46. package/src/ReactNativeSimpleNotePitchDetectorModule.ts +5 -0
  47. package/src/ReactNativeSimpleNotePitchDetectorModule.web.ts +13 -0
  48. package/src/ReactNativeSimpleNotePitchDetectorView.tsx +11 -0
  49. package/src/ReactNativeSimpleNotePitchDetectorView.web.tsx +11 -0
  50. package/src/index.ts +26 -0
  51. 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
+ };
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # react-native-simple-note-pitch-detector
File without changes
@@ -0,0 +1,2 @@
1
+ #Wed Sep 27 11:42:08 PDT 2023
2
+ gradle.version=7.4.2
File without changes
@@ -0,0 +1,89 @@
1
+ apply plugin: 'com.android.library'
2
+ apply plugin: 'kotlin-android'
3
+ apply plugin: 'maven-publish'
4
+
5
+ group = 'expo.modules.simplenotepitchdetector'
6
+ version = '0.1.0'
7
+
8
+ buildscript {
9
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
+ if (expoModulesCorePlugin.exists()) {
11
+ apply from: expoModulesCorePlugin
12
+ applyKotlinExpoModulesCorePlugin()
13
+ }
14
+
15
+ // Simple helper that allows the root project to override versions declared by this library.
16
+ ext.safeExtGet = { prop, fallback ->
17
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
18
+ }
19
+
20
+ // Ensures backward compatibility
21
+ ext.getKotlinVersion = {
22
+ if (ext.has("kotlinVersion")) {
23
+ ext.kotlinVersion()
24
+ } else {
25
+ ext.safeExtGet("kotlinVersion", "1.8.10")
26
+ }
27
+ }
28
+
29
+ repositories {
30
+ mavenCentral()
31
+ }
32
+
33
+ dependencies {
34
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
35
+ }
36
+ }
37
+
38
+ afterEvaluate {
39
+ publishing {
40
+ publications {
41
+ release(MavenPublication) {
42
+ from components.release
43
+ }
44
+ }
45
+ repositories {
46
+ maven {
47
+ url = mavenLocal().url
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ android {
54
+ compileSdkVersion safeExtGet("compileSdkVersion", 33)
55
+
56
+ compileOptions {
57
+ sourceCompatibility JavaVersion.VERSION_11
58
+ targetCompatibility JavaVersion.VERSION_11
59
+ }
60
+
61
+ kotlinOptions {
62
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
63
+ }
64
+
65
+ namespace "expo.modules.simplenotepitchdetector"
66
+ defaultConfig {
67
+ minSdkVersion safeExtGet("minSdkVersion", 21)
68
+ targetSdkVersion safeExtGet("targetSdkVersion", 33)
69
+ versionCode 1
70
+ versionName "0.1.0"
71
+ }
72
+ lintOptions {
73
+ abortOnError false
74
+ }
75
+ publishing {
76
+ singleVariant("release") {
77
+ withSourcesJar()
78
+ }
79
+ }
80
+ }
81
+
82
+ repositories {
83
+ mavenCentral()
84
+ }
85
+
86
+ dependencies {
87
+ implementation project(':expo-modules-core')
88
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
89
+ }
@@ -0,0 +1,2 @@
1
+ <manifest>
2
+ </manifest>
@@ -0,0 +1,47 @@
1
+ package expo.modules.simplenotepitchdetector
2
+
3
+ import expo.modules.kotlin.modules.Module
4
+ import expo.modules.kotlin.modules.ModuleDefinition
5
+
6
+ class ReactNativeSimpleNotePitchDetectorModule : Module() {
7
+ // Each module class must implement the definition function. The definition consists of components
8
+ // that describes the module's functionality and behavior.
9
+ // See https://docs.expo.dev/modules/module-api for more details about available components.
10
+ override fun definition() = ModuleDefinition {
11
+ // Sets the name of the module that JavaScript code will use to refer to the module. Takes a string as an argument.
12
+ // Can be inferred from module's class name, but it's recommended to set it explicitly for clarity.
13
+ // The module will be accessible from `requireNativeModule('ReactNativeSimpleNotePitchDetector')` in JavaScript.
14
+ Name("ReactNativeSimpleNotePitchDetector")
15
+
16
+ // Sets constant properties on the module. Can take a dictionary or a closure that returns a dictionary.
17
+ Constants(
18
+ "PI" to Math.PI
19
+ )
20
+
21
+ // Defines event names that the module can send to JavaScript.
22
+ Events("onChange")
23
+
24
+ // Defines a JavaScript synchronous function that runs the native code on the JavaScript thread.
25
+ Function("hello") {
26
+ "Hello world! 👋"
27
+ }
28
+
29
+ // Defines a JavaScript function that always returns a Promise and whose native code
30
+ // is by default dispatched on the different thread than the JavaScript runtime runs on.
31
+ AsyncFunction("setValueAsync") { value: String ->
32
+ // Send an event to JavaScript.
33
+ sendEvent("onChange", mapOf(
34
+ "value" to value
35
+ ))
36
+ }
37
+
38
+ // Enables the module to be used as a native view. Definition components that are accepted as part of
39
+ // the view definition: Prop, Events.
40
+ View(ReactNativeSimpleNotePitchDetectorView::class) {
41
+ // Defines a setter for the `name` prop.
42
+ Prop("name") { view: ReactNativeSimpleNotePitchDetectorView, prop: String ->
43
+ println(prop)
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,7 @@
1
+ package expo.modules.simplenotepitchdetector
2
+
3
+ import android.content.Context
4
+ import expo.modules.kotlin.AppContext
5
+ import expo.modules.kotlin.views.ExpoView
6
+
7
+ class ReactNativeSimpleNotePitchDetectorView(context: Context, appContext: AppContext) : ExpoView(context, appContext)
@@ -0,0 +1,7 @@
1
+ export type ChangeEventPayload = {
2
+ value: string;
3
+ };
4
+ export type ReactNativeSimpleNotePitchDetectorViewProps = {
5
+ name: string;
6
+ };
7
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetector.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetector.types.d.ts","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetector.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetector.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetector.types.js","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetector.types.ts"],"names":[],"mappings":"","sourcesContent":["export type ChangeEventPayload = {\n value: string;\n};\n\nexport type ReactNativeSimpleNotePitchDetectorViewProps = {\n name: string;\n};\n"]}
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorModule.d.ts","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorModule.ts"],"names":[],"mappings":";AAIA,wBAAyE"}
@@ -0,0 +1,5 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ // It loads the native module object from the JSI or falls back to
3
+ // the bridge module (from NativeModulesProxy) if the remote debugger is on.
4
+ export default requireNativeModule('ReactNativeSimpleNotePitchDetector');
5
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorModule.js","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,kEAAkE;AAClE,4EAA4E;AAC5E,eAAe,mBAAmB,CAAC,oCAAoC,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\n// It loads the native module object from the JSI or falls back to\n// the bridge module (from NativeModulesProxy) if the remote debugger is on.\nexport default requireNativeModule('ReactNativeSimpleNotePitchDetector');\n"]}
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ PI: number;
3
+ setValueAsync(value: string): Promise<void>;
4
+ hello(): string;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorModule.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorModule.web.d.ts","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorModule.web.ts"],"names":[],"mappings":";;yBAM6B,MAAM,GAAG,QAAQ,IAAI,CAAC;;;AAFnD,wBAQE"}
@@ -0,0 +1,12 @@
1
+ import { EventEmitter } from 'expo-modules-core';
2
+ const emitter = new EventEmitter({});
3
+ export default {
4
+ PI: Math.PI,
5
+ async setValueAsync(value) {
6
+ emitter.emit('onChange', { value });
7
+ },
8
+ hello() {
9
+ return 'Hello world! 👋';
10
+ },
11
+ };
12
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorModule.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorModule.web.js","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,EAAS,CAAC,CAAC;AAE5C,eAAe;IACb,EAAE,EAAE,IAAI,CAAC,EAAE;IACX,KAAK,CAAC,aAAa,CAAC,KAAa;QAC/B,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,KAAK;QACH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF,CAAC","sourcesContent":["import { EventEmitter } from 'expo-modules-core';\n\nconst emitter = new EventEmitter({} as any);\n\nexport default {\n PI: Math.PI,\n async setValueAsync(value: string): Promise<void> {\n emitter.emit('onChange', { value });\n },\n hello() {\n return 'Hello world! 👋';\n },\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';
3
+ export default function ReactNativeSimpleNotePitchDetectorView(props: ReactNativeSimpleNotePitchDetectorViewProps): React.JSX.Element;
4
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorView.d.ts","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,2CAA2C,EAAE,MAAM,4CAA4C,CAAC;AAKzG,MAAM,CAAC,OAAO,UAAU,sCAAsC,CAAC,KAAK,EAAE,2CAA2C,qBAEhH"}
@@ -0,0 +1,7 @@
1
+ import { requireNativeViewManager } from 'expo-modules-core';
2
+ import * as React from 'react';
3
+ const NativeView = requireNativeViewManager('ReactNativeSimpleNotePitchDetector');
4
+ export default function ReactNativeSimpleNotePitchDetectorView(props) {
5
+ return React.createElement(NativeView, { ...props });
6
+ }
7
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorView.js","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,UAAU,GACd,wBAAwB,CAAC,oCAAoC,CAAC,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,sCAAsC,CAAC,KAAkD;IAC/G,OAAO,oBAAC,UAAU,OAAK,KAAK,GAAI,CAAC;AACnC,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\n\nimport { ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';\n\nconst NativeView: React.ComponentType<ReactNativeSimpleNotePitchDetectorViewProps> =\n requireNativeViewManager('ReactNativeSimpleNotePitchDetector');\n\nexport default function ReactNativeSimpleNotePitchDetectorView(props: ReactNativeSimpleNotePitchDetectorViewProps) {\n return <NativeView {...props} />;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';
3
+ export default function ReactNativeSimpleNotePitchDetectorView(props: ReactNativeSimpleNotePitchDetectorViewProps): React.JSX.Element;
4
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorView.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorView.web.d.ts","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,2CAA2C,EAAE,MAAM,4CAA4C,CAAC;AAEzG,MAAM,CAAC,OAAO,UAAU,sCAAsC,CAAC,KAAK,EAAE,2CAA2C,qBAMhH"}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export default function ReactNativeSimpleNotePitchDetectorView(props) {
3
+ return (React.createElement("div", null,
4
+ React.createElement("span", null, props.name)));
5
+ }
6
+ //# sourceMappingURL=ReactNativeSimpleNotePitchDetectorView.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactNativeSimpleNotePitchDetectorView.web.js","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,CAAC,OAAO,UAAU,sCAAsC,CAAC,KAAkD;IAC/G,OAAO,CACL;QACE,kCAAO,KAAK,CAAC,IAAI,CAAQ,CACrB,CACP,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\n\nimport { ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';\n\nexport default function ReactNativeSimpleNotePitchDetectorView(props: ReactNativeSimpleNotePitchDetectorViewProps) {\n return (\n <div>\n <span>{props.name}</span>\n </div>\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { Subscription } from 'expo-modules-core';
2
+ import ReactNativeSimpleNotePitchDetectorView from './ReactNativeSimpleNotePitchDetectorView';
3
+ import { ChangeEventPayload, ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';
4
+ export declare const PI: any;
5
+ export declare function hello(): string;
6
+ export declare function setValueAsync(value: string): Promise<any>;
7
+ export declare function addChangeListener(listener: (event: ChangeEventPayload) => void): Subscription;
8
+ export { ReactNativeSimpleNotePitchDetectorView, ReactNativeSimpleNotePitchDetectorViewProps, ChangeEventPayload };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKnF,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,2CAA2C,EAAE,MAAM,4CAA4C,CAAC;AAG7H,eAAO,MAAM,EAAE,KAA8C,CAAC;AAE9D,wBAAgB,KAAK,IAAI,MAAM,CAE9B;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,gBAEhD;AAID,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAAG,YAAY,CAE7F;AAED,OAAO,EAAE,sCAAsC,EAAE,2CAA2C,EAAE,kBAAkB,EAAE,CAAC"}
package/build/index.js ADDED
@@ -0,0 +1,19 @@
1
+ import { NativeModulesProxy, EventEmitter } from 'expo-modules-core';
2
+ // Import the native module. On web, it will be resolved to ReactNativeSimpleNotePitchDetector.web.ts
3
+ // and on native platforms to ReactNativeSimpleNotePitchDetector.ts
4
+ import ReactNativeSimpleNotePitchDetectorModule from './ReactNativeSimpleNotePitchDetectorModule';
5
+ import ReactNativeSimpleNotePitchDetectorView from './ReactNativeSimpleNotePitchDetectorView';
6
+ // Get the native constant value.
7
+ export const PI = ReactNativeSimpleNotePitchDetectorModule.PI;
8
+ export function hello() {
9
+ return ReactNativeSimpleNotePitchDetectorModule.hello();
10
+ }
11
+ export async function setValueAsync(value) {
12
+ return await ReactNativeSimpleNotePitchDetectorModule.setValueAsync(value);
13
+ }
14
+ const emitter = new EventEmitter(ReactNativeSimpleNotePitchDetectorModule ?? NativeModulesProxy.ReactNativeSimpleNotePitchDetector);
15
+ export function addChangeListener(listener) {
16
+ return emitter.addListener('onChange', listener);
17
+ }
18
+ export { ReactNativeSimpleNotePitchDetectorView };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAgB,MAAM,mBAAmB,CAAC;AAEnF,qGAAqG;AACrG,mEAAmE;AACnE,OAAO,wCAAwC,MAAM,4CAA4C,CAAC;AAClG,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAG9F,iCAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,GAAG,wCAAwC,CAAC,EAAE,CAAC;AAE9D,MAAM,UAAU,KAAK;IACnB,OAAO,wCAAwC,CAAC,KAAK,EAAE,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAa;IAC/C,OAAO,MAAM,wCAAwC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,wCAAwC,IAAI,kBAAkB,CAAC,kCAAkC,CAAC,CAAC;AAEpI,MAAM,UAAU,iBAAiB,CAAC,QAA6C;IAC7E,OAAO,OAAO,CAAC,WAAW,CAAqB,UAAU,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC;AAED,OAAO,EAAE,sCAAsC,EAAmE,CAAC","sourcesContent":["import { NativeModulesProxy, EventEmitter, Subscription } from 'expo-modules-core';\n\n// Import the native module. On web, it will be resolved to ReactNativeSimpleNotePitchDetector.web.ts\n// and on native platforms to ReactNativeSimpleNotePitchDetector.ts\nimport ReactNativeSimpleNotePitchDetectorModule from './ReactNativeSimpleNotePitchDetectorModule';\nimport ReactNativeSimpleNotePitchDetectorView from './ReactNativeSimpleNotePitchDetectorView';\nimport { ChangeEventPayload, ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';\n\n// Get the native constant value.\nexport const PI = ReactNativeSimpleNotePitchDetectorModule.PI;\n\nexport function hello(): string {\n return ReactNativeSimpleNotePitchDetectorModule.hello();\n}\n\nexport async function setValueAsync(value: string) {\n return await ReactNativeSimpleNotePitchDetectorModule.setValueAsync(value);\n}\n\nconst emitter = new EventEmitter(ReactNativeSimpleNotePitchDetectorModule ?? NativeModulesProxy.ReactNativeSimpleNotePitchDetector);\n\nexport function addChangeListener(listener: (event: ChangeEventPayload) => void): Subscription {\n return emitter.addListener<ChangeEventPayload>('onChange', listener);\n}\n\nexport { ReactNativeSimpleNotePitchDetectorView, ReactNativeSimpleNotePitchDetectorViewProps, ChangeEventPayload };\n"]}
@@ -0,0 +1,9 @@
1
+ {
2
+ "platforms": ["ios", "android", "web"],
3
+ "ios": {
4
+ "modules": ["ReactNativeSimpleNotePitchDetectorModule"]
5
+ },
6
+ "android": {
7
+ "modules": ["expo.modules.simplenotepitchdetector.ReactNativeSimpleNotePitchDetectorModule"]
8
+ }
9
+ }
@@ -0,0 +1,27 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'ReactNativeSimpleNotePitchDetector'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.description = package['description']
10
+ s.license = package['license']
11
+ s.author = package['author']
12
+ s.homepage = package['homepage']
13
+ s.platform = :ios, '13.0'
14
+ s.swift_version = '5.4'
15
+ s.source = { git: 'https://github.com/derekhdawson/react-native-simple-note-pitch-detector' }
16
+ s.static_framework = true
17
+
18
+ s.dependency 'ExpoModulesCore'
19
+
20
+ # Swift/Objective-C compatibility
21
+ s.pod_target_xcconfig = {
22
+ 'DEFINES_MODULE' => 'YES',
23
+ 'SWIFT_COMPILATION_MODE' => 'wholemodule'
24
+ }
25
+
26
+ s.source_files = "**/*.{h,m,swift}"
27
+ end
@@ -0,0 +1,44 @@
1
+ import ExpoModulesCore
2
+
3
+ public class ReactNativeSimpleNotePitchDetectorModule: Module {
4
+ // Each module class must implement the definition function. The definition consists of components
5
+ // that describes the module's functionality and behavior.
6
+ // See https://docs.expo.dev/modules/module-api for more details about available components.
7
+ public func definition() -> ModuleDefinition {
8
+ // Sets the name of the module that JavaScript code will use to refer to the module. Takes a string as an argument.
9
+ // Can be inferred from module's class name, but it's recommended to set it explicitly for clarity.
10
+ // The module will be accessible from `requireNativeModule('ReactNativeSimpleNotePitchDetector')` in JavaScript.
11
+ Name("ReactNativeSimpleNotePitchDetector")
12
+
13
+ // Sets constant properties on the module. Can take a dictionary or a closure that returns a dictionary.
14
+ Constants([
15
+ "PI": Double.pi
16
+ ])
17
+
18
+ // Defines event names that the module can send to JavaScript.
19
+ Events("onChange")
20
+
21
+ // Defines a JavaScript synchronous function that runs the native code on the JavaScript thread.
22
+ Function("hello") {
23
+ return "Hello world! 👋"
24
+ }
25
+
26
+ // Defines a JavaScript function that always returns a Promise and whose native code
27
+ // is by default dispatched on the different thread than the JavaScript runtime runs on.
28
+ AsyncFunction("setValueAsync") { (value: String) in
29
+ // Send an event to JavaScript.
30
+ self.sendEvent("onChange", [
31
+ "value": value
32
+ ])
33
+ }
34
+
35
+ // Enables the module to be used as a native view. Definition components that are accepted as part of the
36
+ // view definition: Prop, Events.
37
+ View(ReactNativeSimpleNotePitchDetectorView.self) {
38
+ // Defines a setter for the `name` prop.
39
+ Prop("name") { (view: ReactNativeSimpleNotePitchDetectorView, prop: String) in
40
+ print(prop)
41
+ }
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,7 @@
1
+ import ExpoModulesCore
2
+
3
+ // This view will be used as a native component. Make sure to inherit from `ExpoView`
4
+ // to apply the proper styling (e.g. border radius and shadows).
5
+ class ReactNativeSimpleNotePitchDetectorView: ExpoView {
6
+
7
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "react-native-simple-note-pitch-detector",
3
+ "version": "0.1.0",
4
+ "description": "asdf",
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": "open -a \"Xcode\" example/ios",
16
+ "open:android": "open -a \"Android Studio\" example/android"
17
+ },
18
+ "keywords": [
19
+ "react-native",
20
+ "expo",
21
+ "react-native-simple-note-pitch-detector",
22
+ "ReactNativeSimpleNotePitchDetector"
23
+ ],
24
+ "repository": "https://github.com/derekhdawson/react-native-simple-note-pitch-detector",
25
+ "bugs": {
26
+ "url": "https://github.com/derekhdawson/react-native-simple-note-pitch-detector/issues"
27
+ },
28
+ "author": "derekhdawson <derekhdawson@yahoo.com> (https://github.com/derekhdawson)",
29
+ "license": "MIT",
30
+ "homepage": "https://github.com/derekhdawson/react-native-simple-note-pitch-detector#readme",
31
+ "dependencies": {},
32
+ "devDependencies": {
33
+ "@types/react": "^18.0.25",
34
+ "expo-module-scripts": "^3.0.11",
35
+ "expo-modules-core": "^1.5.7"
36
+ },
37
+ "peerDependencies": {
38
+ "expo": "*",
39
+ "react": "*",
40
+ "react-native": "*"
41
+ }
42
+ }
@@ -0,0 +1,7 @@
1
+ export type ChangeEventPayload = {
2
+ value: string;
3
+ };
4
+
5
+ export type ReactNativeSimpleNotePitchDetectorViewProps = {
6
+ name: string;
7
+ };
@@ -0,0 +1,5 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+
3
+ // It loads the native module object from the JSI or falls back to
4
+ // the bridge module (from NativeModulesProxy) if the remote debugger is on.
5
+ export default requireNativeModule('ReactNativeSimpleNotePitchDetector');
@@ -0,0 +1,13 @@
1
+ import { EventEmitter } from 'expo-modules-core';
2
+
3
+ const emitter = new EventEmitter({} as any);
4
+
5
+ export default {
6
+ PI: Math.PI,
7
+ async setValueAsync(value: string): Promise<void> {
8
+ emitter.emit('onChange', { value });
9
+ },
10
+ hello() {
11
+ return 'Hello world! 👋';
12
+ },
13
+ };
@@ -0,0 +1,11 @@
1
+ import { requireNativeViewManager } from 'expo-modules-core';
2
+ import * as React from 'react';
3
+
4
+ import { ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';
5
+
6
+ const NativeView: React.ComponentType<ReactNativeSimpleNotePitchDetectorViewProps> =
7
+ requireNativeViewManager('ReactNativeSimpleNotePitchDetector');
8
+
9
+ export default function ReactNativeSimpleNotePitchDetectorView(props: ReactNativeSimpleNotePitchDetectorViewProps) {
10
+ return <NativeView {...props} />;
11
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+
3
+ import { ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';
4
+
5
+ export default function ReactNativeSimpleNotePitchDetectorView(props: ReactNativeSimpleNotePitchDetectorViewProps) {
6
+ return (
7
+ <div>
8
+ <span>{props.name}</span>
9
+ </div>
10
+ );
11
+ }
package/src/index.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { NativeModulesProxy, EventEmitter, Subscription } from 'expo-modules-core';
2
+
3
+ // Import the native module. On web, it will be resolved to ReactNativeSimpleNotePitchDetector.web.ts
4
+ // and on native platforms to ReactNativeSimpleNotePitchDetector.ts
5
+ import ReactNativeSimpleNotePitchDetectorModule from './ReactNativeSimpleNotePitchDetectorModule';
6
+ import ReactNativeSimpleNotePitchDetectorView from './ReactNativeSimpleNotePitchDetectorView';
7
+ import { ChangeEventPayload, ReactNativeSimpleNotePitchDetectorViewProps } from './ReactNativeSimpleNotePitchDetector.types';
8
+
9
+ // Get the native constant value.
10
+ export const PI = ReactNativeSimpleNotePitchDetectorModule.PI;
11
+
12
+ export function hello(): string {
13
+ return ReactNativeSimpleNotePitchDetectorModule.hello();
14
+ }
15
+
16
+ export async function setValueAsync(value: string) {
17
+ return await ReactNativeSimpleNotePitchDetectorModule.setValueAsync(value);
18
+ }
19
+
20
+ const emitter = new EventEmitter(ReactNativeSimpleNotePitchDetectorModule ?? NativeModulesProxy.ReactNativeSimpleNotePitchDetector);
21
+
22
+ export function addChangeListener(listener: (event: ChangeEventPayload) => void): Subscription {
23
+ return emitter.addListener<ChangeEventPayload>('onChange', listener);
24
+ }
25
+
26
+ export { ReactNativeSimpleNotePitchDetectorView, ReactNativeSimpleNotePitchDetectorViewProps, ChangeEventPayload };
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__/*"]
9
+ }