expo-rich-input 0.1.3 → 0.1.4

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.
@@ -16,13 +16,15 @@ class ExpoRichInputModule : Module() {
16
16
  "onSelectionChange"
17
17
  )
18
18
 
19
- AsyncFunction("focus") {
20
- view: RichInputView ->
19
+ Prop("id") { view: RichInputView, id: Int ->
20
+ view.viewId = id
21
+ }
22
+
23
+ AsyncFunction("focus") { view: RichInputView ->
21
24
  view.focusInput()
22
25
  }
23
26
 
24
- AsyncFunction("blur") {
25
- view: RichInputView ->
27
+ AsyncFunction("blur") { view: RichInputView ->
26
28
  view.blurInput()
27
29
  }
28
30
  }
@@ -9,7 +9,9 @@ import android.view.inputmethod.*
9
9
  import expo.modules.kotlin.AppContext
10
10
  import expo.modules.kotlin.views.ExpoView
11
11
 
12
- class RichInputView(context: Context, appContext: AppContext) : ExpoView(context, appContext) {
12
+ class RichInputView(context: Context, val appContext: AppContext) : ExpoView(context, appContext) {
13
+
14
+ var viewId: Int = -1
13
15
 
14
16
  private var cursorPosition = 0
15
17
  private var selectionStart = 0
@@ -37,7 +39,13 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
37
39
  return EditorInputConnection(this)
38
40
  }
39
41
 
40
- // 🔥 Hardware keyboard support
42
+ private fun emitEvent(name: String, payload: Map<String, Any>) {
43
+ appContext.eventEmitter?.emit(
44
+ name,
45
+ payload + mapOf("id" to viewId)
46
+ )
47
+ }
48
+
41
49
  override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
42
50
  if (event.isCtrlPressed) {
43
51
  val action = when (keyCode) {
@@ -51,7 +59,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
51
59
  }
52
60
 
53
61
  action?.let {
54
- sendEvent("onKeyboardAction", mapOf("action" to it))
62
+ emitEvent("onKeyboardAction", mapOf("action" to it))
55
63
  return true
56
64
  }
57
65
  }
@@ -71,13 +79,12 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
71
79
  imm.hideSoftInputFromWindow(windowToken, 0)
72
80
  }
73
81
 
74
- // 🔥 Core Input Engine
75
82
  inner class EditorInputConnection(view: View) : BaseInputConnection(view, false) {
76
83
 
77
84
  override fun commitText(text: CharSequence?, newCursorPosition: Int): Boolean {
78
85
  val str = text?.toString() ?: return false
79
86
 
80
- sendEvent("onEditEvent", mapOf(
87
+ emitEvent("onEditEvent", mapOf(
81
88
  "type" to "insert",
82
89
  "text" to str,
83
90
  "cursor" to cursorPosition
@@ -93,7 +100,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
93
100
  override fun setComposingText(text: CharSequence?, newCursorPosition: Int): Boolean {
94
101
  val str = text?.toString() ?: ""
95
102
 
96
- sendEvent("onEditEvent", mapOf(
103
+ emitEvent("onEditEvent", mapOf(
97
104
  "type" to "compose",
98
105
  "text" to str,
99
106
  "cursor" to cursorPosition
@@ -103,7 +110,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
103
110
  }
104
111
 
105
112
  override fun finishComposingText(): Boolean {
106
- sendEvent("onEditEvent", mapOf(
113
+ emitEvent("onEditEvent", mapOf(
107
114
  "type" to "composeCommit",
108
115
  "cursor" to cursorPosition
109
116
  ))
@@ -114,7 +121,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
114
121
  if (beforeLength > 0) {
115
122
  val deleteCount = minOf(beforeLength, cursorPosition)
116
123
 
117
- sendEvent("onEditEvent", mapOf(
124
+ emitEvent("onEditEvent", mapOf(
118
125
  "type" to "delete",
119
126
  "count" to deleteCount,
120
127
  "cursor" to cursorPosition
@@ -132,7 +139,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
132
139
  selectionEnd = end
133
140
  cursorPosition = end
134
141
 
135
- sendEvent("onSelectionChange", mapOf(
142
+ emitEvent("onSelectionChange", mapOf(
136
143
  "start" to start,
137
144
  "end" to end
138
145
  ))
@@ -1,18 +1,27 @@
1
- export type EditEventType = "insert" | "delete" | "compose" | "composeCommit";
2
- export interface EditEvent {
1
+ export type EditEventType = 'insert' | 'delete' | 'compose' | 'composeCommit';
2
+ export type EditEvent = {
3
+ id: number;
3
4
  type: EditEventType;
4
5
  text?: string;
5
6
  count?: number;
6
- }
7
- export interface KeyboardActionEvent {
8
- action: "undo" | "redo" | "toggleComment";
9
- }
10
- export interface ExpoRichInputRef {
11
- focus: () => Promise<void>;
12
- blur: () => Promise<void>;
13
- }
14
- export interface ExpoRichInputProps {
15
- onEditEvent: (event: EditEvent) => void;
16
- onKeyboardAction?: (event: KeyboardActionEvent) => void;
17
- }
7
+ cursor: number;
8
+ };
9
+ export type KeyboardActionEvent = {
10
+ id: number;
11
+ action: string;
12
+ };
13
+ export type SelectionChangeEvent = {
14
+ id: number;
15
+ start: number;
16
+ end: number;
17
+ };
18
+ export type ExpoRichInputProps = {
19
+ onEditEvent?: (e: EditEvent) => void;
20
+ onKeyboardAction?: (e: KeyboardActionEvent) => void;
21
+ onSelectionChange?: (e: SelectionChangeEvent) => void;
22
+ };
23
+ export type ExpoRichInputRef = {
24
+ focus: () => void;
25
+ blur: () => void;
26
+ };
18
27
  //# sourceMappingURL=ExpoRichInput.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoRichInput.types.d.ts","sourceRoot":"","sources":["../src/ExpoRichInput.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,CAAC;AAE9E,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,eAAe,CAAC;CAC7C;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC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"ExpoRichInput.types.js","sourceRoot":"","sources":["../src/ExpoRichInput.types.ts"],"names":[],"mappings":"","sourcesContent":["export type EditEventType = \"insert\" | \"delete\" | \"compose\" | \"composeCommit\";\n\nexport interface EditEvent {\n type: EditEventType;\n text?: string;\n count?: number;\n}\n\nexport interface KeyboardActionEvent {\n action: \"undo\" | \"redo\" | \"toggleComment\";\n}\n\nexport interface ExpoRichInputRef {\n focus: () => Promise<void>;\n blur: () => Promise<void>;\n}\n\nexport interface ExpoRichInputProps {\n onEditEvent: (event: EditEvent) => void;\n onKeyboardAction?: (event: KeyboardActionEvent) => void;\n}\n"]}
1
+ {"version":3,"file":"ExpoRichInput.types.js","sourceRoot":"","sources":["../src/ExpoRichInput.types.ts"],"names":[],"mappings":"","sourcesContent":["export type EditEventType = 'insert' | 'delete' | 'compose' | 'composeCommit'\n\nexport type EditEvent = {\n id: number\n type: EditEventType\n text?: string\n count?: number\n cursor: number\n}\n\nexport type KeyboardActionEvent = {\n id: number\n action: string\n}\n\nexport type SelectionChangeEvent = {\n id: number\n start: number\n end: number\n}\n\nexport type ExpoRichInputProps = {\n onEditEvent?: (e: EditEvent) => void\n onKeyboardAction?: (e: KeyboardActionEvent) => void\n onSelectionChange?: (e: SelectionChangeEvent) => void\n}\n\nexport type ExpoRichInputRef = {\n focus: () => void\n blur: () => void\n}"]}
@@ -1,3 +1,5 @@
1
- import { ExpoRichInputProps, ExpoRichInputRef } from "./ExpoRichInput.types";
2
- export declare const ExpoRichInputView: import("react").ForwardRefExoticComponent<ExpoRichInputProps & import("react").RefAttributes<ExpoRichInputRef>>;
1
+ import React from "react";
2
+ import type { ExpoRichInputProps, ExpoRichInputRef } from "./ExpoRichInput.types";
3
+ declare const RichInput: React.ForwardRefExoticComponent<ExpoRichInputProps & React.RefAttributes<ExpoRichInputRef>>;
4
+ export default RichInput;
3
5
  //# sourceMappingURL=ExpoRichInputView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoRichInputView.d.ts","sourceRoot":"","sources":["../src/ExpoRichInputView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI7E,eAAO,MAAM,iBAAiB,iHAmB5B,CAAC"}
1
+ {"version":3,"file":"ExpoRichInputView.d.ts","sourceRoot":"","sources":["../src/ExpoRichInputView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EACR,kBAAkB,EAClB,gBAAgB,EAInB,MAAM,uBAAuB,CAAC;AAQ/B,QAAA,MAAM,SAAS,6FAkCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,24 +1,34 @@
1
- import { requireNativeViewManager } from "expo-modules-core";
2
- import { forwardRef, useRef, useImperativeHandle } from "react";
3
- import { StyleSheet } from "react-native";
4
- import { focus, blur } from "./ExpoRichInputModule";
1
+ import React, { useEffect, useRef, forwardRef, useImperativeHandle } from "react";
2
+ import { requireNativeViewManager, EventEmitter } from "expo-modules-core";
3
+ import * as NativeModule from "./ExpoRichInputModule";
5
4
  const NativeView = requireNativeViewManager("ExpoRichInput");
6
- export const ExpoRichInputView = forwardRef(({ onEditEvent, onKeyboardAction }, ref) => {
5
+ const emitter = new EventEmitter();
6
+ let globalId = 0;
7
+ const RichInput = forwardRef(({ onEditEvent, onKeyboardAction, onSelectionChange, ...props }, ref) => {
8
+ const idRef = useRef(++globalId);
7
9
  const nativeRef = useRef(null);
8
10
  useImperativeHandle(ref, () => ({
9
- focus: () => focus(nativeRef.current),
10
- blur: () => blur(nativeRef.current)
11
+ focus: () => NativeModule.focus(nativeRef.current),
12
+ blur: () => NativeModule.blur(nativeRef.current)
11
13
  }));
12
- return (<NativeView ref={nativeRef} style={styles.input} onEditEvent={(e) => onEditEvent(e.nativeEvent)} onKeyboardAction={(e) => onKeyboardAction?.(e.nativeEvent)}/>);
13
- });
14
- const styles = StyleSheet.create({
15
- input: {
16
- position: "absolute",
17
- top: 0,
18
- left: 0,
19
- width: 1,
20
- height: 1,
21
- opacity: 0
22
- }
14
+ useEffect(() => {
15
+ const subs = [
16
+ emitter.addListener("onEditEvent", (e) => {
17
+ if (e.id === idRef.current)
18
+ onEditEvent?.(e);
19
+ }),
20
+ emitter.addListener("onKeyboardAction", (e) => {
21
+ if (e.id === idRef.current)
22
+ onKeyboardAction?.(e);
23
+ }),
24
+ emitter.addListener("onSelectionChange", (e) => {
25
+ if (e.id === idRef.current)
26
+ onSelectionChange?.(e);
27
+ })
28
+ ];
29
+ return () => subs.forEach(s => s.remove());
30
+ }, []);
31
+ return <NativeView ref={nativeRef} {...props} id={idRef.current}/>;
23
32
  });
33
+ export default RichInput;
24
34
  //# sourceMappingURL=ExpoRichInputView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoRichInputView.js","sourceRoot":"","sources":["../src/ExpoRichInputView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,UAAU,GAAG,wBAAwB,CAAC,eAAe,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAGzC,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,EAAE,GAAG,EAAE,EAAE;IACzC,MAAM,SAAS,GAAG,MAAM,CAAM,IAAI,CAAC,CAAC;IAEpC,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC5B,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;QACrC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KACtC,CAAC,CAAC,CAAC;IAEJ,OAAO,CACH,CAAC,UAAU,CACP,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACpB,WAAW,CAAC,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CACpD,gBAAgB,CAAC,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAClE,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC7B,KAAK,EAAE;QACH,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACb;CACJ,CAAC,CAAC","sourcesContent":["import { requireNativeViewManager } from \"expo-modules-core\";\nimport { forwardRef, useRef, useImperativeHandle } from \"react\";\nimport { StyleSheet } from \"react-native\";\nimport { focus, blur } from \"./ExpoRichInputModule\";\nimport { ExpoRichInputProps, ExpoRichInputRef } from \"./ExpoRichInput.types\";\n\nconst NativeView = requireNativeViewManager(\"ExpoRichInput\");\n\nexport const ExpoRichInputView = forwardRef<\n ExpoRichInputRef,\n ExpoRichInputProps\n>(({ onEditEvent, onKeyboardAction }, ref) => {\n const nativeRef = useRef<any>(null);\n\n useImperativeHandle(ref, () => ({\n focus: () => focus(nativeRef.current),\n blur: () => blur(nativeRef.current)\n }));\n\n return (\n <NativeView\n ref={nativeRef}\n style={styles.input}\n onEditEvent={(e: any) => onEditEvent(e.nativeEvent)}\n onKeyboardAction={(e: any) => onKeyboardAction?.(e.nativeEvent)}\n />\n );\n});\n\nconst styles = StyleSheet.create({\n input: {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: 1,\n height: 1,\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AC,CAAsB,EAAE,EAAE;gBACvB,IAAI,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO;oBAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC;YACtD,CAAC,CACJ;YACD,OAAO,CAAC,WAAW,CACf,mBAAmB,EACnB,CAAC,CAAuB,EAAE,EAAE;gBACxB,IAAI,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO;oBAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC;YACvD,CAAC,CACJ;SACJ,CAAC;QAEF,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAG,CAAC;AACxE,CAAC,CACJ,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import React, {\n useEffect,\n useRef,\n forwardRef,\n useImperativeHandle\n} from \"react\";\nimport { requireNativeViewManager, EventEmitter } from \"expo-modules-core\";\n\nimport * as NativeModule from \"./ExpoRichInputModule\";\nimport type {\n ExpoRichInputProps,\n ExpoRichInputRef,\n EditEvent,\n KeyboardActionEvent,\n SelectionChangeEvent\n} from \"./ExpoRichInput.types\";\n\nconst NativeView = requireNativeViewManager(\"ExpoRichInput\");\n\nconst emitter = new EventEmitter() as any\n\nlet globalId = 0;\n\nconst RichInput = forwardRef<ExpoRichInputRef, ExpoRichInputProps>(\n ({ onEditEvent, onKeyboardAction, onSelectionChange, ...props }, ref) => {\n const idRef = useRef(++globalId);\n const nativeRef = useRef<any>(null);\n\n useImperativeHandle(ref, () => ({\n focus: () => NativeModule.focus(nativeRef.current),\n blur: () => NativeModule.blur(nativeRef.current)\n }));\n\n useEffect(() => {\n const subs = [\n emitter.addListener(\"onEditEvent\", (e: EditEvent) => {\n if (e.id === idRef.current) onEditEvent?.(e);\n }),\n emitter.addListener(\n \"onKeyboardAction\",\n (e: KeyboardActionEvent) => {\n if (e.id === idRef.current) onKeyboardAction?.(e);\n }\n ),\n emitter.addListener(\n \"onSelectionChange\",\n (e: SelectionChangeEvent) => {\n if (e.id === idRef.current) onSelectionChange?.(e);\n }\n )\n ];\n\n return () => subs.forEach(s => s.remove());\n }, []);\n\n return <NativeView ref={nativeRef} {...props} id={idRef.current} />;\n }\n);\n\nexport default RichInput;\n"]}
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { ExpoRichInputView } from "./ExpoRichInputView";
1
+ export { default } from "./ExpoRichInputView";
2
2
  export { focus, blur } from "./ExpoRichInputModule";
3
3
  export type { EditEvent, EditEventType, KeyboardActionEvent, ExpoRichInputRef, ExpoRichInputProps } from "./ExpoRichInput.types";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EACR,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAEpD,YAAY,EACV,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC"}
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { ExpoRichInputView } from "./ExpoRichInputView";
2
- export { focus, blur } from "./ExpoRichInputModule"; // can remove after testing
1
+ export { default } from "./ExpoRichInputView";
2
+ export { focus, blur } from "./ExpoRichInputModule";
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC,CAAC,2BAA2B","sourcesContent":["export { ExpoRichInputView } from \"./ExpoRichInputView\";\nexport { focus, blur } from \"./ExpoRichInputModule\"; // can remove after testing\nexport type {\n EditEvent,\n EditEventType,\n KeyboardActionEvent,\n ExpoRichInputRef,\n ExpoRichInputProps\n} from \"./ExpoRichInput.types\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { default } from \"./ExpoRichInputView\";\n\nexport { focus, blur } from \"./ExpoRichInputModule\";\n\nexport type {\n EditEvent,\n EditEventType,\n KeyboardActionEvent,\n ExpoRichInputRef,\n ExpoRichInputProps\n} from \"./ExpoRichInput.types\";"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-rich-input",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A native Expo module that replaces `TextInput` entirely, giving the editor raw OS-level edit deltas — insert, delete, and IME compose events — directly from `UIKeyInput` on iOS and `InputConnection` on Android, so the Rope never has to diff a full string.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",