open-index/open-npm huggingface dataset:
npm package: @sishuguojixuefu/react-native-office-viewer
Description: Office Preview Plugin for React Native（support png,pdf,doc,docx,xls,txt...）
Author: 杨俊宁
Latest version: 0.0.5

# @sishuguojixuefu/react-native-officeapps-wrapper

## Install

```sh
$ npm install @sishuguojixuefu/react-native-office-viewer
```

or

```sh
$ yarn add @sishuguojixuefu/react-native-office-viewer
```

## Link

```sh
$ react-native link react-native-webview
```

## Use

```js
...
import { OfficeViewer } from '@sishuguojixuefu/react-native-office-viewer'
...
<OfficeViewer containerStyle={{ marginTop: 10 }} source="http://storage.xuetangx.com/public_assets/xuetangx/PDF/1.xls" />
...
```

## Thanks

- [Office Web Viewer: View Office documents in a browser](http://t.cn/EorILXa)
- [前端实现在线预览 pdf、word、xls、ppt 等文件](http://t.cn/Rg3RgaR)
- [android 你所不知道的 word,pdf 预览方案](http://t.cn/EorICdn)
- [android 使用 webview 预览 png,pdf,doc,xls,txt，等文件](http://t.cn/EorITHh)
npm package: @sishuguojixuefu/react-native-qiniu
Description: Qiniu React Native SDK ,A pure javascript implements.
Author: buhe
Latest version: 0.3.0

# React Native Qiniu SDK

纯JavaScript实现的Qiniu SDK,

## 安装
npm i react-native-qiniu  --save

## 使用方法

```javascript
import Qiniu,{Auth,ImgOps,Conf,Rs,Rpc} from 'react-native-qiniu';
Conf.ACCESS_KEY = <AK>
Conf.SECRET_KEY = <SK>
//强烈不建议在客户端保存 AK 和 SK ，反编译后 hacker 获取到可以对你的资源为所欲为，建议通过安全渠道从服务器端获取。

//upload file to Qiniu
var putPolicy = new Auth.PutPolicy2(
    {scope: "<Bucket>:<Key>"}
);
var uptoken = putPolicy.token();
let formInput = {
    key : "<Key>",
    // formInput对象如何配置请参考七牛官方文档“直传文件”一节
}
Rpc.uploadFile(<LOCAL_URL>, uptoken, formInput);

//download private file
var getPolicy = new Auth.GetPolicy();
let url = getPolicy.makeRequest('http://7xp19y.com2.z0.glb.qiniucdn.com/5.jpg');
//fetch from this url

//image sync operation
var imgInfo = new ImgOps.ImageView(1,100,200);
let url = imgInfo.makeRequest('http://7xoaqn.com2.z0.glb.qiniucdn.com/16704/6806d20a359f43c88f1cb3c59980e5ef');
//fetch from this url

//image info 
var self = this;
var imgInfo = new ImgOps.ImageInfo();
let url = imgInfo.makeRequest('http://7xoaqn.com2.z0.glb.qiniucdn.com/16704/6806d20a359f43c88f1cb3c59980e5ef');
fetch(url).then((response) => {
      return response.text();
    }).then((responseText) => {
      self.setState({info: responseText});
    }).catch((error) => {
      console.warn(error);
    });

//resource operation
//stat info
var self = this;
Rs.stat(<BUCKET>, <KEY)
        .then((response) => response.text())
        .then((responseText) => {
          self.setState({info: responseText});
        })
        .catch((error) => {
          console.warn(error);
        });
```

## 进行中

[RoadMap](https://github.com/qiniu/react-native-sdk/issues/1)

## Release Note
### 0.1.0
- [x] 上传文件
- [x] 私有库中文件下载功能
- [x] Image Ops
- [x] 资源管理

### 0.1.1
- 重构 upload 方法 (CaveyChan)

### 0.2.0
- es6 style

### 0.3.0
- 增加 progress callback

## Contributor
- CaveyChan
- laukey
- cdmalcl


## 相关文章

[React Native 文件上传 和 react-native-qiniu](https://medium.com/@bugu1986/react-native-%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0-%E5%92%8C-react-native-qiniu-4b3f7335090e#.ooux7ospa)
npm package: @sishuguojixuefu/react-native-screenshot
Description: React Native 截屏组件（支持ios、android）
Author: sishu
Latest version: 1.5.1

## 安装

```sh
$ yarn add @sishuguojixuefu/react-native-screenshot react-native-screenshot-notifier react-native-screenshot-observer react-native-view-shot
```

## link

```sh
$ react-native link react-native-screenshot-notifier react-native-screenshot-observer react-native-view-shot
```

## API

### 概览

```js
export interface filePropsType {
  id?: string
  fileName?: string
  path: string
}

export interface optionsPropsType {
  width?: number
  height?: number
  format?: 'png' | 'jpg' | 'webm'
  quality?: 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 |0.8 | 0.9| 1.0
  result?: 'tmpfile' | 'base64' | 'data-uri'
}

export interface screenshotPropsType {
  ViewShot: any
  captureScreen: (callback: (file: filePropsType) => void, options?: optionsPropsType) => void
  startListener: (callback: (file: filePropsType) => void) => void
  stopListener: () => void
}
```

### startListener(func)

开始监听系统截屏并添加一个回调接收返回的截屏信息

```js
componentDidMount() {
  startListener(({ uri, path }) => {
    // path: /xxx/yyy
    // uri: file:///xxx/yyy
    this.setState({
      shotImage: file.uri,
    })
  })
}
```

### stopListener()

停止监听系统监听系统截屏

```js
componentWillUnmount() {
  stopListener()
}
```

### captureScreen

捕获当前显示的屏幕并返回图片地址

```js
import { captureScreen } from '@sishuguojixuefu/react-native-screenshot'

captureScreen(
  ({ path, uri }) => {
    // path: /xxx/yyy
    // uri: file:///xxx/yyy
    console.log('screenshotPatah', uri, path)
  },
  {
    format: 'jpg',
    quality: 0.8,
  }
)
```

## 致谢

- [rhdeck/react-native-screenshot-notifier](https://github.com/rhdeck/react-native-screenshot-notifier) for android
- [WangZiXiao-ChenDu/react-native-screenshot-observer](https://github.com/WangZiXiao-ChenDu/react-native-screenshot-observer) for ios
- [gre/react-native-view-shot](https://github.com/gre/react-native-view-shot) for captureScreen