Skip to content

Commit 4fd127e

Browse files
authored
chore(text-recognition): README update (#39)
1 parent f871b90 commit 4fd127e

File tree

1 file changed

+79
-3
lines changed

1 file changed

+79
-3
lines changed
Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,88 @@
11
# @nativescript/mlkit-text-recognition
22

3-
```javascript
3+
A plugin used with [@nativescript/mlkit-core](../mlkit-core) to enable Text Recognition in your app and provide [TextResult](#textresult) type for the text recognition event data.
4+
5+
## Contents
6+
* [Installation](#installation)
7+
* [Use @nativescript/mlkit-text-recognition](#use-nativescriptmlkit-text-recognition)
8+
* [API](#api)
9+
* [TextResult](#textresult)
10+
* [License](#license)
11+
12+
## Installation
13+
14+
```cli
415
npm install @nativescript/mlkit-text-recognition
516
```
617

7-
## Usage
18+
## Use @nativescript/mlkit-text-recognition
19+
20+
For an example, read [Use @nativescript/mlkit-core](../mlkit-core#use-nativescriptmlkit-core) and [Text Recognition](../mlkit-core#text-recognition).
21+
22+
## API
23+
24+
### TextResult
25+
26+
The Text Recognition event data type.
27+
28+
```ts
29+
interface TextResult {
30+
text?: string
31+
bounds: Bounds
32+
lines: TextLine[]
33+
points: Point[]
34+
}
35+
```
36+
---
37+
#### Point
38+
39+
```ts
40+
interface Point {
41+
x: number;
42+
y: number;
43+
}
44+
```
45+
---
46+
#### Bounds
47+
```ts
48+
interface Bounds {
49+
origin: Origin;
50+
size: Size;
51+
}
52+
```
53+
#### Origin
54+
```ts
55+
interface Origin {
56+
x: number;
57+
y: number;
58+
}
59+
```
860

9-
See [@nativescript/mlkit-core](/packages/mlkit-core/README.md) Usage
61+
#### Size
62+
```ts
63+
interface Size {
64+
width: number;
65+
height: number;
66+
}
67+
```
68+
---
69+
#### TextLine
70+
```ts
71+
interface TextLine {
72+
text?: string
73+
bounds: Bounds
74+
elements: TextElement[]
75+
points?: Point[]
76+
}
77+
```
78+
#### TextElement
79+
```ts
80+
interface TextElement {
81+
text?: string
82+
bounds: Bounds
83+
}
84+
```
85+
---
1086
## License
1187

1288
Apache License Version 2.0

0 commit comments

Comments
 (0)