react-native-simple-note-pitch-detector 0.1.6 → 0.1.7

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.
package/build/index.d.ts CHANGED
@@ -1,9 +1,7 @@
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 };
1
+ import { Subscription } from "expo-modules-core";
2
+ import ReactNativeSimpleNotePitchDetectorView from "./ReactNativeSimpleNotePitchDetectorView";
3
+ import { ChangeEventPayload, ReactNativeSimpleNotePitchDetectorViewProps } from "./ReactNativeSimpleNotePitchDetector.types";
4
+ export declare function start(): any;
5
+ export declare function onChangePitch(listener: (event: ChangeEventPayload) => void): Subscription;
6
+ export { ReactNativeSimpleNotePitchDetectorView, ReactNativeSimpleNotePitchDetectorViewProps, ChangeEventPayload, };
9
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAC9F,OAAO,EACL,kBAAkB,EAClB,2CAA2C,EAC5C,MAAM,4CAA4C,CAAC;AAEpD,wBAAgB,KAAK,QAEpB;AAOD,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAC5C,YAAY,CAEd;AAED,OAAO,EACL,sCAAsC,EACtC,2CAA2C,EAC3C,kBAAkB,GACnB,CAAC"}
package/build/index.js CHANGED
@@ -1,19 +1,13 @@
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();
1
+ import { NativeModulesProxy, EventEmitter, } from "expo-modules-core";
2
+ import ReactNativeSimpleNotePitchDetectorModule from "./ReactNativeSimpleNotePitchDetectorModule";
3
+ import ReactNativeSimpleNotePitchDetectorView from "./ReactNativeSimpleNotePitchDetectorView";
4
+ export function start() {
5
+ return ReactNativeSimpleNotePitchDetectorModule.start();
10
6
  }
11
- export async function setValueAsync(value) {
12
- return await ReactNativeSimpleNotePitchDetectorModule.setValueAsync(value);
7
+ const emitter = new EventEmitter(ReactNativeSimpleNotePitchDetectorModule ??
8
+ NativeModulesProxy.ReactNativeSimpleNotePitchDetector);
9
+ export function onChangePitch(listener) {
10
+ return emitter.addListener("onChangePitch", listener);
13
11
  }
14
- const emitter = new EventEmitter(ReactNativeSimpleNotePitchDetectorModule ?? NativeModulesProxy.ReactNativeSimpleNotePitchDetector);
15
- export function addChangeListener(listener) {
16
- return emitter.addListener('onChange', listener);
17
- }
18
- export { ReactNativeSimpleNotePitchDetectorView };
12
+ export { ReactNativeSimpleNotePitchDetectorView, };
19
13
  //# sourceMappingURL=index.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,GAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,wCAAwC,MAAM,4CAA4C,CAAC;AAClG,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAM9F,MAAM,UAAU,KAAK;IACnB,OAAO,wCAAwC,CAAC,KAAK,EAAE,CAAC;AAC1D,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC9B,wCAAwC;IACtC,kBAAkB,CAAC,kCAAkC,CACxD,CAAC;AAEF,MAAM,UAAU,aAAa,CAC3B,QAA6C;IAE7C,OAAO,OAAO,CAAC,WAAW,CAAqB,eAAe,EAAE,QAAQ,CAAC,CAAC;AAC5E,CAAC;AAED,OAAO,EACL,sCAAsC,GAGvC,CAAC","sourcesContent":["import {\n NativeModulesProxy,\n EventEmitter,\n Subscription,\n} from \"expo-modules-core\";\n\nimport ReactNativeSimpleNotePitchDetectorModule from \"./ReactNativeSimpleNotePitchDetectorModule\";\nimport ReactNativeSimpleNotePitchDetectorView from \"./ReactNativeSimpleNotePitchDetectorView\";\nimport {\n ChangeEventPayload,\n ReactNativeSimpleNotePitchDetectorViewProps,\n} from \"./ReactNativeSimpleNotePitchDetector.types\";\n\nexport function start() {\n return ReactNativeSimpleNotePitchDetectorModule.start();\n}\n\nconst emitter = new EventEmitter(\n ReactNativeSimpleNotePitchDetectorModule ??\n NativeModulesProxy.ReactNativeSimpleNotePitchDetector\n);\n\nexport function onChangePitch(\n listener: (event: ChangeEventPayload) => void\n): Subscription {\n return emitter.addListener<ChangeEventPayload>(\"onChangePitch\", listener);\n}\n\nexport {\n ReactNativeSimpleNotePitchDetectorView,\n ReactNativeSimpleNotePitchDetectorViewProps,\n ChangeEventPayload,\n};\n"]}
@@ -1,24 +1,13 @@
1
1
  import ExpoModulesCore
2
2
 
3
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.
4
+
7
5
  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
6
 
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
- ])
7
+ Name("ReactNativeSimpleNotePitchDetector")
17
8
 
18
- // Defines event names that the module can send to JavaScript.
19
9
  Events("onChange")
20
10
 
21
- // Defines a JavaScript synchronous function that runs the native code on the JavaScript thread.
22
11
  Function("hello") {
23
12
  return "Hello world! 👋"
24
13
  }
@@ -32,13 +21,5 @@ public class ReactNativeSimpleNotePitchDetectorModule: Module {
32
21
  ])
33
22
  }
34
23
 
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
24
  }
44
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-simple-note-pitch-detector",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "asdf",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
package/src/index.ts CHANGED
@@ -1,26 +1,33 @@
1
- import { NativeModulesProxy, EventEmitter, Subscription } from 'expo-modules-core';
1
+ import {
2
+ NativeModulesProxy,
3
+ EventEmitter,
4
+ Subscription,
5
+ } from "expo-modules-core";
2
6
 
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';
7
+ import ReactNativeSimpleNotePitchDetectorModule from "./ReactNativeSimpleNotePitchDetectorModule";
8
+ import ReactNativeSimpleNotePitchDetectorView from "./ReactNativeSimpleNotePitchDetectorView";
9
+ import {
10
+ ChangeEventPayload,
11
+ ReactNativeSimpleNotePitchDetectorViewProps,
12
+ } from "./ReactNativeSimpleNotePitchDetector.types";
8
13
 
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);
14
+ export function start() {
15
+ return ReactNativeSimpleNotePitchDetectorModule.start();
18
16
  }
19
17
 
20
- const emitter = new EventEmitter(ReactNativeSimpleNotePitchDetectorModule ?? NativeModulesProxy.ReactNativeSimpleNotePitchDetector);
18
+ const emitter = new EventEmitter(
19
+ ReactNativeSimpleNotePitchDetectorModule ??
20
+ NativeModulesProxy.ReactNativeSimpleNotePitchDetector
21
+ );
21
22
 
22
- export function addChangeListener(listener: (event: ChangeEventPayload) => void): Subscription {
23
- return emitter.addListener<ChangeEventPayload>('onChange', listener);
23
+ export function onChangePitch(
24
+ listener: (event: ChangeEventPayload) => void
25
+ ): Subscription {
26
+ return emitter.addListener<ChangeEventPayload>("onChangePitch", listener);
24
27
  }
25
28
 
26
- export { ReactNativeSimpleNotePitchDetectorView, ReactNativeSimpleNotePitchDetectorViewProps, ChangeEventPayload };
29
+ export {
30
+ ReactNativeSimpleNotePitchDetectorView,
31
+ ReactNativeSimpleNotePitchDetectorViewProps,
32
+ ChangeEventPayload,
33
+ };
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactNativeSimpleNotePitchDetectorModule.web.d.ts","sourceRoot":"","sources":["../src/ReactNativeSimpleNotePitchDetectorModule.web.ts"],"names":[],"mappings":";;yBAM6B,MAAM,GAAG,QAAQ,IAAI,CAAC;;;AAFnD,wBAQE"}
@@ -1,12 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,4 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,6 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,13 +0,0 @@
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
- };
@@ -1,11 +0,0 @@
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
- }