@tbvjaos510/react-native-paste-input 0.9.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.
- package/.circleci/config.yml +130 -0
- package/LICENSE +21 -0
- package/README.md +73 -0
- package/android/.project +17 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build.gradle +94 -0
- package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerDelegate.java +236 -0
- package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerInterface.java +84 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/PasteTextInputSpecs-generated.cpp +27 -0
- package/android/generated/jni/PasteTextInputSpecs.h +28 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.h +166 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.cpp +183 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.h +148 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI-generated.cpp +17 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI.h +19 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.cpp +640 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.h +144 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.cpp +247 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.h +95 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.cpp +14 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.h +19 -0
- package/android/gradle.properties +6 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/IPasteInputListener.kt +8 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputActionCallback.kt +72 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputEditText.kt +60 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputFileFromUrl.kt +50 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputListener.kt +84 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputManager.kt +72 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputPackage.kt +14 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputPasteEvent.java +41 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/RealPathUtil.kt +174 -0
- package/ios/NSData+MimeType.h +20 -0
- package/ios/NSData+MimeType.m +59 -0
- package/ios/PasteInput-Bridging-Header.h +1 -0
- package/ios/PasteInput.xcodeproj/project.pbxproj +319 -0
- package/ios/PasteInputTextView.h +20 -0
- package/ios/PasteInputTextView.m +68 -0
- package/ios/PasteInputView.h +18 -0
- package/ios/PasteInputView.m +96 -0
- package/ios/PasteTextInput.h +13 -0
- package/ios/PasteTextInput.mm +726 -0
- package/ios/PasteTextInputManager.mm +171 -0
- package/ios/Swime/MimeType.h +70 -0
- package/ios/Swime/MimeType.m +701 -0
- package/ios/Swime/Swime.h +14 -0
- package/ios/Swime/Swime.m +28 -0
- package/ios/Swime/SwimeProxy.h +18 -0
- package/ios/Swime/SwimeProxy.m +66 -0
- package/ios/Swime/SwimeUtils.h +12 -0
- package/ios/Swime/SwimeUtils.m +23 -0
- package/ios/UIImage+ImageEffects.h +112 -0
- package/ios/UIImage+ImageEffects.m +310 -0
- package/ios/UIImage+vImageScaling.h +16 -0
- package/ios/UIImage+vImageScaling.m +48 -0
- package/ios/UIPasteboard+GetImageInfo.h +19 -0
- package/ios/UIPasteboard+GetImageInfo.m +98 -0
- package/ios/generated/PasteTextInputSpecs/ComponentDescriptors.cpp +22 -0
- package/ios/generated/PasteTextInputSpecs/ComponentDescriptors.h +42 -0
- package/ios/generated/PasteTextInputSpecs/EventEmitters.cpp +41 -0
- package/ios/generated/PasteTextInputSpecs/EventEmitters.h +37 -0
- package/ios/generated/PasteTextInputSpecs/PasteTextInputSpecs-generated.mm +16 -0
- package/ios/generated/PasteTextInputSpecs/PasteTextInputSpecs.h +38 -0
- package/ios/generated/PasteTextInputSpecs/Props.cpp +142 -0
- package/ios/generated/PasteTextInputSpecs/Props.h +81 -0
- package/ios/generated/PasteTextInputSpecs/RCTComponentViewHelpers.h +106 -0
- package/ios/generated/PasteTextInputSpecs/ShadowNodes.cpp +127 -0
- package/ios/generated/PasteTextInputSpecs/ShadowNodes.h +85 -0
- package/ios/generated/PasteTextInputSpecs/States.cpp +16 -0
- package/ios/generated/PasteTextInputSpecs/States.h +53 -0
- package/ios/generated/PasteTextInputSpecsJSI-generated.cpp +17 -0
- package/ios/generated/PasteTextInputSpecsJSI.h +19 -0
- package/lib/commonjs/PasteTextInput.js +446 -0
- package/lib/commonjs/PasteTextInput.js.map +1 -0
- package/lib/commonjs/PasteTextInputNativeComponent.ts +277 -0
- package/lib/commonjs/index.js +25 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/module.d.js +2 -0
- package/lib/commonjs/module.d.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/PasteTextInput.js +440 -0
- package/lib/module/PasteTextInput.js.map +1 -0
- package/lib/module/PasteTextInputNativeComponent.ts +277 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/module.d.js +2 -0
- package/lib/module/module.d.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/src/PasteTextInput.d.ts +5 -0
- package/lib/typescript/src/PasteTextInput.d.ts.map +1 -0
- package/lib/typescript/src/PasteTextInputNativeComponent.d.ts +168 -0
- package/lib/typescript/src/PasteTextInputNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +56 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +140 -0
- package/react-native-paste-input.podspec +20 -0
- package/react-native.config.js +13 -0
- package/src/PasteTextInput.tsx +615 -0
- package/src/PasteTextInputNativeComponent.ts +277 -0
- package/src/index.ts +13 -0
- package/src/module.d.ts +4 -0
- package/src/types.ts +71 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ColorValue,
|
|
3
|
+
type HostComponent,
|
|
4
|
+
type ViewProps,
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
import type {
|
|
7
|
+
BubblingEventHandler,
|
|
8
|
+
DirectEventHandler,
|
|
9
|
+
Double,
|
|
10
|
+
Float,
|
|
11
|
+
Int32,
|
|
12
|
+
WithDefault,
|
|
13
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
14
|
+
import { codegenNativeComponent } from 'react-native';
|
|
15
|
+
import { codegenNativeCommands } from 'react-native';
|
|
16
|
+
|
|
17
|
+
export interface PasteTextInputPasteEventData {
|
|
18
|
+
data: Readonly<
|
|
19
|
+
{
|
|
20
|
+
fileName: string;
|
|
21
|
+
fileSize: Int32;
|
|
22
|
+
type: string;
|
|
23
|
+
uri: string;
|
|
24
|
+
}[]
|
|
25
|
+
>;
|
|
26
|
+
error?: Readonly<{
|
|
27
|
+
message: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type TargetedEvent = {
|
|
32
|
+
target: Int32;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export interface PasteTextInputContentSizeChangeEventData
|
|
36
|
+
extends TargetedEvent {
|
|
37
|
+
contentSize: {
|
|
38
|
+
width: Int32;
|
|
39
|
+
height: Int32;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface PasteTextInputSelectionChangeEventData extends TargetedEvent {
|
|
44
|
+
selection: Readonly<{
|
|
45
|
+
start: Int32;
|
|
46
|
+
end: Int32;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface PasteTextInputScrollEventData extends TargetedEvent {
|
|
51
|
+
contentInset: Readonly<{
|
|
52
|
+
top: Double;
|
|
53
|
+
bottom: Double;
|
|
54
|
+
left: Double;
|
|
55
|
+
right: Double;
|
|
56
|
+
}>;
|
|
57
|
+
contentOffset: Readonly<{ x: Double; y: Double }>;
|
|
58
|
+
contentSize: Readonly<{
|
|
59
|
+
width: Double;
|
|
60
|
+
height: Double;
|
|
61
|
+
}>;
|
|
62
|
+
layoutMeasurement: Readonly<{
|
|
63
|
+
width: Double;
|
|
64
|
+
height: Double;
|
|
65
|
+
}>;
|
|
66
|
+
responderIgnoreScroll: boolean;
|
|
67
|
+
velocity: Readonly<{ x: Double; y: Double }>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface PasteTextInputChangeEventData extends TargetedEvent {
|
|
71
|
+
eventCount: Int32;
|
|
72
|
+
text: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface PasteTextInputTextInputEventData extends TargetedEvent {
|
|
76
|
+
text: string;
|
|
77
|
+
previousText: string;
|
|
78
|
+
range: Readonly<{ start: Int32; end: Int32 }>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface PasteTextInputEditEventData extends TargetedEvent {
|
|
82
|
+
text: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface PasteTextInputKeyEventData extends TargetedEvent {
|
|
86
|
+
key: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type KeyboardType =
|
|
90
|
+
| 'default'
|
|
91
|
+
| 'email-address'
|
|
92
|
+
| 'numeric'
|
|
93
|
+
| 'phone-pad'
|
|
94
|
+
| 'number-pad'
|
|
95
|
+
| 'decimal-pad'
|
|
96
|
+
| 'url'
|
|
97
|
+
// iOS-only
|
|
98
|
+
| 'ascii-capable'
|
|
99
|
+
| 'numbers-and-punctuation'
|
|
100
|
+
| 'name-phone-pad'
|
|
101
|
+
| 'twitter'
|
|
102
|
+
| 'web-search'
|
|
103
|
+
// Android-only
|
|
104
|
+
| 'visible-password';
|
|
105
|
+
|
|
106
|
+
export type ReturnKeyType =
|
|
107
|
+
// Cross Platform
|
|
108
|
+
| 'done'
|
|
109
|
+
| 'go'
|
|
110
|
+
| 'next'
|
|
111
|
+
| 'search'
|
|
112
|
+
| 'send'
|
|
113
|
+
// Android-only
|
|
114
|
+
| 'none'
|
|
115
|
+
| 'previous'
|
|
116
|
+
// iOS-only
|
|
117
|
+
| 'default'
|
|
118
|
+
| 'emergency-call'
|
|
119
|
+
| 'google'
|
|
120
|
+
| 'join'
|
|
121
|
+
| 'route'
|
|
122
|
+
| 'yahoo';
|
|
123
|
+
|
|
124
|
+
export type Autocomplete =
|
|
125
|
+
| 'birthdate-day'
|
|
126
|
+
| 'birthdate-full'
|
|
127
|
+
| 'birthdate-month'
|
|
128
|
+
| 'birthdate-year'
|
|
129
|
+
| 'cc-csc'
|
|
130
|
+
| 'cc-exp'
|
|
131
|
+
| 'cc-exp-day'
|
|
132
|
+
| 'cc-exp-month'
|
|
133
|
+
| 'cc-exp-year'
|
|
134
|
+
| 'cc-number'
|
|
135
|
+
| 'email'
|
|
136
|
+
| 'gender'
|
|
137
|
+
| 'name'
|
|
138
|
+
| 'name-family'
|
|
139
|
+
| 'name-given'
|
|
140
|
+
| 'name-middle'
|
|
141
|
+
| 'name-middle-initial'
|
|
142
|
+
| 'name-prefix'
|
|
143
|
+
| 'name-suffix'
|
|
144
|
+
| 'password'
|
|
145
|
+
| 'password-new'
|
|
146
|
+
| 'postal-address'
|
|
147
|
+
| 'postal-address-country'
|
|
148
|
+
| 'postal-address-extended'
|
|
149
|
+
| 'postal-address-extended-postal-code'
|
|
150
|
+
| 'postal-address-locality'
|
|
151
|
+
| 'postal-address-region'
|
|
152
|
+
| 'postal-code'
|
|
153
|
+
| 'street-address'
|
|
154
|
+
| 'sms-otp'
|
|
155
|
+
| 'tel'
|
|
156
|
+
| 'tel-country-code'
|
|
157
|
+
| 'tel-national'
|
|
158
|
+
| 'tel-device'
|
|
159
|
+
| 'username'
|
|
160
|
+
| 'username-new'
|
|
161
|
+
| 'off';
|
|
162
|
+
|
|
163
|
+
type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
|
|
164
|
+
|
|
165
|
+
export interface NativeProps extends ViewProps {
|
|
166
|
+
allowFontScaling?: boolean;
|
|
167
|
+
autoCapitalize?: WithDefault<
|
|
168
|
+
'none' | 'sentences' | 'words' | 'characters',
|
|
169
|
+
'none'
|
|
170
|
+
>;
|
|
171
|
+
autoComplete?: WithDefault<Autocomplete, 'off'>;
|
|
172
|
+
autoCorrect?: boolean;
|
|
173
|
+
autoFocus?: boolean;
|
|
174
|
+
blurOnSubmit?: boolean;
|
|
175
|
+
caretHidden?: boolean;
|
|
176
|
+
clearButtonMode?: string;
|
|
177
|
+
clearTextOnFocus?: boolean;
|
|
178
|
+
contextMenuHidden?: boolean;
|
|
179
|
+
defaultValue?: string;
|
|
180
|
+
disableCopyPaste?: boolean;
|
|
181
|
+
disableFullscreenUI?: boolean;
|
|
182
|
+
editable?: boolean;
|
|
183
|
+
enablesReturnKeyAutomatically?: boolean;
|
|
184
|
+
importantForAutofill?: string;
|
|
185
|
+
inlineImageLeft?: string;
|
|
186
|
+
inlineImagePadding?: Int32;
|
|
187
|
+
inputAccessoryViewID?: string;
|
|
188
|
+
keyboardAppearance?: string;
|
|
189
|
+
keyboardType?: WithDefault<KeyboardType, 'default'>;
|
|
190
|
+
maxFontSizeMultiplier?: Float;
|
|
191
|
+
maxLength?: Int32;
|
|
192
|
+
mostRecentEventCount?: Int32;
|
|
193
|
+
multiline?: boolean;
|
|
194
|
+
numberOfLines?: Int32;
|
|
195
|
+
passwordRules?: string;
|
|
196
|
+
placeholder?: string;
|
|
197
|
+
placeholderTextColor?: ColorValue;
|
|
198
|
+
returnKeyLabel?: string;
|
|
199
|
+
returnKeyType?: WithDefault<ReturnKeyType, 'done'>;
|
|
200
|
+
scrollEnabled?: boolean;
|
|
201
|
+
secureTextEntry?: boolean;
|
|
202
|
+
selection?: Readonly<{ start: Int32; end?: Int32 }>;
|
|
203
|
+
selectionColor?: ColorValue;
|
|
204
|
+
selectionHandleColor?: ColorValue;
|
|
205
|
+
selectTextOnFocus?: boolean;
|
|
206
|
+
showSoftInputOnFocus?: boolean;
|
|
207
|
+
smartInsertDelete?: boolean;
|
|
208
|
+
smartPunctuation?: string;
|
|
209
|
+
spellCheck?: boolean;
|
|
210
|
+
submitBehavior?: WithDefault<SubmitBehavior, 'submit'>;
|
|
211
|
+
|
|
212
|
+
text?: string;
|
|
213
|
+
textBreakStrategy?: WithDefault<
|
|
214
|
+
'simple' | 'highQuality' | 'balanced',
|
|
215
|
+
'simple'
|
|
216
|
+
>;
|
|
217
|
+
textContentType?: string;
|
|
218
|
+
underlineColorAndroid?: ColorValue;
|
|
219
|
+
value?: string;
|
|
220
|
+
|
|
221
|
+
onBlur?: BubblingEventHandler<TargetedEvent>;
|
|
222
|
+
onChange?: BubblingEventHandler<PasteTextInputChangeEventData>;
|
|
223
|
+
onChangeText?: BubblingEventHandler<PasteTextInputChangeEventData>;
|
|
224
|
+
onEndEditing?: BubblingEventHandler<PasteTextInputEditEventData>;
|
|
225
|
+
onFocus?: BubblingEventHandler<TargetedEvent>;
|
|
226
|
+
onKeyPress?: BubblingEventHandler<PasteTextInputKeyEventData>;
|
|
227
|
+
onPaste?: BubblingEventHandler<PasteTextInputPasteEventData>;
|
|
228
|
+
onSubmitEdition?: BubblingEventHandler<PasteTextInputEditEventData>;
|
|
229
|
+
|
|
230
|
+
onContentSizeChange?: DirectEventHandler<PasteTextInputContentSizeChangeEventData>;
|
|
231
|
+
onScroll?: DirectEventHandler<PasteTextInputScrollEventData>;
|
|
232
|
+
onSelectionChange?: DirectEventHandler<PasteTextInputSelectionChangeEventData>;
|
|
233
|
+
|
|
234
|
+
textShadowColor?: ColorValue;
|
|
235
|
+
textShadowRadius?: Float;
|
|
236
|
+
textDecorationLine?: string;
|
|
237
|
+
fontStyle?: string;
|
|
238
|
+
textShadowOffset?: Readonly<{ width?: Double; height?: Double }>;
|
|
239
|
+
lineHeight?: Float;
|
|
240
|
+
textTransform?: string;
|
|
241
|
+
color?: Int32;
|
|
242
|
+
letterSpacing?: Float;
|
|
243
|
+
fontSize?: Float;
|
|
244
|
+
textAlign?: string;
|
|
245
|
+
includeFontPadding?: boolean;
|
|
246
|
+
fontWeight?: string;
|
|
247
|
+
fontFamily?: string;
|
|
248
|
+
|
|
249
|
+
textAlignVertical?: string;
|
|
250
|
+
cursorColor?: ColorValue;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
type PasteTextInputNativeComponentType = HostComponent<NativeProps>;
|
|
254
|
+
|
|
255
|
+
interface NativeCommands {
|
|
256
|
+
readonly focus: (
|
|
257
|
+
viewRef: React.ElementRef<PasteTextInputNativeComponentType>
|
|
258
|
+
) => void;
|
|
259
|
+
readonly blur: (
|
|
260
|
+
viewRef: React.ElementRef<PasteTextInputNativeComponentType>
|
|
261
|
+
) => void;
|
|
262
|
+
readonly setTextAndSelection: (
|
|
263
|
+
viewRef: React.ElementRef<PasteTextInputNativeComponentType>,
|
|
264
|
+
mostRecentEventCount: Int32,
|
|
265
|
+
value: string | null | undefined, // in theory this is nullable
|
|
266
|
+
start: Int32,
|
|
267
|
+
end: Int32
|
|
268
|
+
) => void;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
272
|
+
supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
export default codegenNativeComponent<NativeProps>(
|
|
276
|
+
'PasteTextInput'
|
|
277
|
+
) as HostComponent<NativeProps>;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
// import { Platform } from 'react-native';
|
|
3
|
+
import type { PasteInputProps } from './types';
|
|
4
|
+
|
|
5
|
+
export * from './types';
|
|
6
|
+
|
|
7
|
+
let PasteInput: React.ForwardRefExoticComponent<
|
|
8
|
+
PasteInputProps & React.RefAttributes<unknown>
|
|
9
|
+
>;
|
|
10
|
+
|
|
11
|
+
PasteInput = require('./PasteTextInput').default;
|
|
12
|
+
|
|
13
|
+
export default PasteInput;
|
package/src/module.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare module 'react-native/Libraries/Components/TextInput/TextInputState';
|
|
2
|
+
declare module 'react-native/Libraries/Text/TextAncestor';
|
|
3
|
+
declare module 'react-native/Libraries/Pressability/usePressability';
|
|
4
|
+
declare module 'react-native/Libraries/StyleSheet/flattenStyle';
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ForwardedRef } from 'react';
|
|
2
|
+
import type { HostComponent, TextInputProps } from 'react-native';
|
|
3
|
+
import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
|
|
5
|
+
export type PasteTextInputInstance = React.ElementRef<
|
|
6
|
+
HostComponent<PasteInputProps>
|
|
7
|
+
> & {
|
|
8
|
+
clear: () => void;
|
|
9
|
+
isFocused: () => boolean;
|
|
10
|
+
getNativeRef?: () => React.ElementRef<HostComponent<PasteInputProps>>;
|
|
11
|
+
setSelection: (start: number, end: number) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export interface PastedFile {
|
|
15
|
+
fileName: string;
|
|
16
|
+
fileSize: Int32;
|
|
17
|
+
type: string;
|
|
18
|
+
uri: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PasteEvent {
|
|
22
|
+
nativeEvent: {
|
|
23
|
+
data: PastedFile[];
|
|
24
|
+
error?: {
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface PasteInputProps extends TextInputProps {
|
|
31
|
+
forwardedRef?: ForwardedRef<PasteTextInputInstance>;
|
|
32
|
+
disableCopyPaste?: boolean;
|
|
33
|
+
onPaste(error: string | null | undefined, files: Array<PastedFile>): void;
|
|
34
|
+
submitBehavior?: SubmitBehavior;
|
|
35
|
+
smartPunctuation?: SmartPunctuation;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface RCTPasteInputProps extends TextInputProps {
|
|
39
|
+
disableCopyPaste?: boolean;
|
|
40
|
+
mostRecentEventCount: number;
|
|
41
|
+
onPaste(event: PasteEvent): void;
|
|
42
|
+
smartPunctuation?: SmartPunctuation;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface PasteInputRef {
|
|
46
|
+
clear(): void;
|
|
47
|
+
isFocused(): boolean;
|
|
48
|
+
focus(): void;
|
|
49
|
+
blur(): void;
|
|
50
|
+
setNativeProps(nativeProps: object): void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface TextInputNativeCommands {
|
|
54
|
+
focus: (viewRef: unknown) => void;
|
|
55
|
+
blur: (viewRef: unknown) => void;
|
|
56
|
+
setTextAndSelection: (
|
|
57
|
+
viewRef: unknown,
|
|
58
|
+
mostRecentEventCount: number,
|
|
59
|
+
value: string | null, // in theory this is nullable
|
|
60
|
+
start: number,
|
|
61
|
+
end: number
|
|
62
|
+
) => void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Selection {
|
|
66
|
+
start: number;
|
|
67
|
+
end?: number | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
|
|
71
|
+
export type SmartPunctuation = 'default' | 'enable' | 'disable';
|