open-index/open-npm huggingface dataset:
npm package: @koimy/rn-file-upload
Description: react-native 上传文件
Author: mashizhen
Latest version: 1.0.3

# 文件上传

## 安装

```bash
yarn add @koimy/rn-file-upload
```

## 使用示例

```tsx
import React, { useState } from 'react';
import { Image, Text, TouchableOpacity } from 'react-native';
import image_picker, { ImageData } from '@koimy/rn-image-picker';
import file_upload from './index';

export default () => {

	// 图片
	const [image, set_image] = useState<ImageData>({});
	const file_url = ''
	const productid = ''


	/**
	 * 选取图片
	 */
	const picker = async () => {
		const res = await image_picker({
			multiple: false,
			mediaType: 'photo'
		});
		// 直接渲染本地图片
		// set_image(res[0]);
		if (res.length > 0) {
			const uploads = res.map((item) => {
				return {											// 上传的文件可能为多个，所以是数组
					name: item.path!,								// 上传后的文件名，如果未定义则是filename的文件名
					filename: item.path!,							// 要上传的文件名
					filepath: item.path!,							// 文件的地址
					filetype: item.mime!								// 文件的类型
				};
			});
			const ret = await file_upload(uploads,
				file_url,
				productid,
				(job_id) => {
					console.log(job_id);
				},
				(percentage) => {
					console.log(percentage);
				}
			)
			set_image(ret[0]);
		}
	};


	return (
		<TouchableOpacity style={{ width: '100%', height: '100%' }} onPress={() => picker()}>
			{
				image.path ? (
					<Image resizeMode='cover' style={{ width: '100%', height: '100%' }} source={{ uri: image.filename ? `${file_url}/getfile?productid=${productid}&id=${image.filename}` : image.path }}></Image>
				) : (
						<Text>选择图片</Text>
					)
			}
		</TouchableOpacity>
	);
};

```
npm package: @koimy/rn-image-camera
Description: 拍摄图片
Author: mashizhen
Latest version: 1.0.0

# 选择图片

## 安装

```bash
yarn add @koimy/rn-image-camera
```

## 配置

android/build.gradle

```gradle
allprojects {
	repositories {

		...
		maven { url 'https://maven.google.com' }
		maven { url 'https://www.jitpack.io' }
	}
}
```

android/app/build.gradle

```gradle
android {
	...
	defaultConfig {
		...
		vectorDrawables.useSupportLibrary = true					// 选择图片
	}
}
```

android/app/src/main/AndroidManifest.xml

```xml
	<uses-permission android:name="android.permission.CAMERA" />

	<!-- 前置摄像头 -->
	<uses-feature android:name="android.hardware.camera" android:required="false" />
	<uses-feature android:name="android.hardware.camera.front" android:required="false" />
```

## 使用示例

```tsx

import React, { useState } from 'react';
import { Image, Text, TouchableOpacity } from 'react-native';
import image_camera, { ImageData } from '@koimy/rn-image-camera';

export default () => {

	// 图片
	const [image, set_image] = useState<ImageData>({});

	/**
	 * 选取图片
	 */
	const picker = async () => {
		const res = await image_camera({
			multiple: false,
			mediaType: 'photo'
		});
		set_image(res[0]);
	};


	return (
		<TouchableOpacity style={{ width: '100%', height: '100%' }} onPress={() => picker()}>
			{
				image.path ? (
					<Image resizeMode='cover' style={{ width: '100%', height: '100%' }} source={{ uri: image.path }}></Image>
				) : (
						<Text>选择图片</Text>
					)
			}
		</TouchableOpacity>
	);
};

```
npm package: @koimy/rn-image-picker
Description: 选择图片
Author: mashizhen
Latest version: 1.0.2

# 选择图片

## 安装

```bash
yarn add @koimy/rn-image-picker
```

## 配置

android/build.gradle

```gradle
allprojects {
	repositories {

		...
		maven { url 'https://maven.google.com' }
		maven { url 'https://www.jitpack.io' }
	}
}
```

android/app/build.gradle

```gradle
android {
	...
	defaultConfig {
		...
		vectorDrawables.useSupportLibrary = true					// 选择图片
	}
}
```

android/app/src/main/AndroidManifest.xml

```xml
	<uses-permission android:name="android.permission.CAMERA" />

	<!-- 前置摄像头 -->
	<uses-feature android:name="android.hardware.camera" android:required="false" />
	<uses-feature android:name="android.hardware.camera.front" android:required="false" />
```

## 使用示例

```tsx

import React, { useState } from 'react';
import { Image, Text, TouchableOpacity } from 'react-native';
import image_picker, { ImageData } from '@koimy/rn-image-picker';

export default () => {

	// 图片
	const [image, set_image] = useState<ImageData>({});

	/**
	 * 选取图片
	 */
	const picker = async () => {
		const res = await image_picker({
			multiple: false,
			mediaType: 'photo'
		});
		set_image(res[0]);
	};


	return (
		<TouchableOpacity style={{ width: '100%', height: '100%' }} onPress={() => picker()}>
			{
				image.path ? (
					<Image resizeMode='cover' style={{ width: '100%', height: '100%' }} source={{ uri: image.path }}></Image>
				) : (
						<Text>选择图片</Text>
					)
			}
		</TouchableOpacity>
	);
};

```
npm package: @koimy/rnw-image-upload
Description: 图片上传
Author: mashizhen
Latest version: 1.0.5

# 图片上传

## 安装

```bash
yarn add @koimy/rnw-image-upload
```

## 配置

依赖于 `@koimy/rn-image-picker`， 请参考 [@koimy/rn-image-picker配置](https://www.npmjs.com/package/@koimy/rn-image-picker)

## 属性

### productid

产品id string 必填

### file_url

string 必填

文件服务地址

### multiple

number 非必填

是否开启多选，值为文件上限。

### files

IFile[] 必填

初始文件

## 方法

### upload()

开始上传

## 使用示例

```tsx
import { IFileServer } from '@koimy/rn-file-upload';
import React, { useEffect, useRef, useState } from 'react';
import { Button, Text, View } from 'react-native';
import Upload, { IFile } from './index';

const file_url = '';
const productid = '';

export default () => {
	// 图片
	const [images, set_images] = useState<IFile[]>([]);

	const upload_ref = useRef<{
		upload(): IFileServer[]
	}>();

	/**
	 * 副作用说明
	 */
	useEffect(() => {
		(async () => {

		})();
	}, []);

	const upload = async () => {
		const res = await upload_ref.current!.upload();
		set_images(res);
	};

	return (
		<View>
			<Text>文件上传</Text>
			<Button title='上传' onPress={() => upload()}></Button>
			<View style={{ flex: 1 }}>
				<Upload ref={upload_ref} multiple={2} file_url={file_url} productid={productid} files={images} />
			</View>
		</View>
	);
};

```
npm package: @koin_payments/react-native-payments-plugin
Description: Plugin React Native oficial da Koin para integração com o SDK de Payments, permitindo adicionar funcionalidades de pagamento de forma simples e segura
Author: mauricio-bittencourt-koin
Latest version: 1.0.0
Deprecated: Version published incorrectly. Please use 1.0.0-beta.2 instead.
npm package: @koindx/v2-sdk
Description: An SDK for building applications on top of Koindx V2
Latest version: 1.3.0

# Koindx V2 SDK

## Getting Started
Check out the [documentation](https://docs.koindx.com/sdk/v2-sdk/overview) to learn more about how this package can be used.

## Links

- [Release announcement](https://blog.koindx.com/koindx-v2-sdk-release)
- [NPM Package](https://www.npmjs.com/package/@koindx/v2-sdk)
- [Github Code](https://github.com/koindx/v2-sdk)
- [Documentation](https://docs.koindx.com/sdk/v2-sdk/overview)

## License

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)

## Disclaimer

**Note of caution: The current version is an early beta version of our SDK. There is always room for improvement, and it may contain certain bugs. We urge users to carefully review the data generated by the SDK. If you encounter any inconsistencies or errors, please come forward and report the issue. Using this code for your own projects is at your own risk. The authors and contributors of this repository are not responsible for any damages or liabilities incurred from the use of this code.**