|
96 | 96 | /**
|
97 | 97 | * <b>not mutable</b><br />
|
98 | 98 | * The current recognition protocol (WebSocket or REST). We strongly recommend using WebSocket.
|
| 99 | + * @type String |
99 | 100 | * @default 'WebSocket'
|
100 | 101 | */
|
101 | 102 | protocol: {
|
|
105 | 106 | /**
|
106 | 107 | * <b>not mutable</b><br />
|
107 | 108 | * The current recognition service host.
|
| 109 | + * @type String |
| 110 | + * @default 'cloud.myscript.com' |
108 | 111 | */
|
109 | 112 | host: {
|
110 | 113 | type: String,
|
|
113 | 116 | /**
|
114 | 117 | * <b>not mutable</b><br />
|
115 | 118 | * The recognition timeout, only use in REST mode.
|
| 119 | + * @type Number |
| 120 | + * @default 2000 |
116 | 121 | */
|
117 | 122 | timeout: {
|
118 | 123 | type: Number,
|
|
123 | 128 | * Application key to use for recognition on MyScript handwriting recognition server.<br />
|
124 | 129 | * You have to create your own MyScript Developer account at http://dev.myscript.com and then generate your application key at http://cloud.myscript.com. See the Developer Guide to learn how to register.<br /><br />
|
125 | 130 | * <b>Warning</b>: This parameter is <b>mandatory</b> and its value should be a string.
|
| 131 | + * @type String |
126 | 132 | */
|
127 | 133 | applicationkey: {
|
128 | 134 | type: String
|
|
132 | 138 | * HMAC key to use for recognition on MyScript handwriting recognition server.<br />
|
133 | 139 | * You have to create your own HMAC key corresponding to your own application key in your account at http://cloud.myscript.com.<br /><br />
|
134 | 140 | * <b>Warning</b>: This parameter may be <b>mandatory</b> if HMAC signature security is enabled for your application. The value should be a string.
|
| 141 | + * @type String |
135 | 142 | */
|
136 | 143 | hmackey: {
|
137 | 144 | type: String
|
138 | 145 | },
|
139 | 146 | /**
|
140 | 147 | * True if undo is available
|
141 | 148 | * @private
|
| 149 | + * @type Boolean |
| 150 | + * @default false |
142 | 151 | */
|
143 | 152 | canundo: {
|
144 | 153 | type: Boolean,
|
|
148 | 157 | /**
|
149 | 158 | * True if redo is available
|
150 | 159 | * @private
|
| 160 | + * @type Boolean |
| 161 | + * @default false |
151 | 162 | */
|
152 | 163 | canredo: {
|
153 | 164 | type: Boolean,
|
|
157 | 168 | /**
|
158 | 169 | * True if there is something to clear
|
159 | 170 | * @private
|
| 171 | + * @type Boolean |
160 | 172 | * @default false
|
161 | 173 | */
|
162 | 174 | canclear: {
|
|
167 | 179 | /**
|
168 | 180 | * <b>not mutable</b><br />
|
169 | 181 | * If set to true, hide the buttons (Trash, Undo, Redo).
|
| 182 | + * @type Boolean |
| 183 | + * @default false |
170 | 184 | */
|
171 | 185 | hidebuttons: {
|
172 | 186 | type: Boolean,
|
|
175 | 189 | /**
|
176 | 190 | * <b>not mutable</b><br />
|
177 | 191 | * If set to true, hide the result div tag.
|
| 192 | + * @type Boolean |
| 193 | + * @default false |
178 | 194 | */
|
179 | 195 | hideresult: {
|
180 | 196 | type: Boolean,
|
|
183 | 199 | },
|
184 | 200 | /**
|
185 | 201 | * The recognition language used by the recognition process.
|
| 202 | + * @type String |
| 203 | + * @default 'en_US' |
186 | 204 | */
|
187 | 205 | language: {
|
188 | 206 | type: String,
|
|
192 | 210 | /**
|
193 | 211 | * The available recognition languages as configured for your application on MyScript Cloud or Server.
|
194 | 212 | * @type {Array<String>}
|
| 213 | + * @default ['en_US'] |
195 | 214 | */
|
196 | 215 | availablelanguages: {
|
197 | 216 | type: Array,
|
|
201 | 220 | },
|
202 | 221 | /**
|
203 | 222 | * The result detail to use (TEXT, WORD or CHARACTER).
|
| 223 | + * @type String |
| 224 | + * @default TEXT |
204 | 225 | */
|
205 | 226 | resultdetail: {
|
206 | 227 | type: String,
|
207 | 228 | value: MyScript.ResultDetail.TEXT
|
208 | 229 | },
|
209 | 230 | /**
|
210 | 231 | * The input mode to use (CURSIVE, ISOLATED, SUPERIMPOSED or VERTICAL).
|
| 232 | + * @type String |
| 233 | + * @default CURSIVE |
211 | 234 | */
|
212 | 235 | inputmode: {
|
213 | 236 | type: String,
|
|
216 | 239 | },
|
217 | 240 | /**
|
218 | 241 | * The desired count of recognition candidates.
|
| 242 | + * @type Number |
| 243 | + * @default 1 |
219 | 244 | */
|
220 | 245 | recognitioncandidates: {
|
221 | 246 | type: Number,
|
222 | 247 | value: 1
|
223 | 248 | },
|
224 | 249 | /**
|
225 | 250 | * The desired count of prediction candidates.
|
| 251 | + * @type Number |
| 252 | + * @default 0 |
226 | 253 | */
|
227 | 254 | predictioncandidates: {
|
228 | 255 | type: Number,
|
229 | 256 | value: 0
|
230 | 257 | },
|
231 | 258 | /**
|
232 | 259 | * The desired count of completion candidates.
|
| 260 | + * @type Number |
| 261 | + * @default 0 |
233 | 262 | */
|
234 | 263 | completioncandidates: {
|
235 | 264 | type: Number,
|
|
238 | 267 | /**
|
239 | 268 | * The content types to use for the recognition.
|
240 | 269 | * @type {Array<String>}
|
| 270 | + * @default [] |
241 | 271 | */
|
242 | 272 | contenttypes: {
|
243 | 273 | type: Array,
|
|
246 | 276 | /**
|
247 | 277 | * The user resources to use for the recognition.
|
248 | 278 | * @type {Array<String>}
|
| 279 | + * @default [] |
249 | 280 | */
|
250 | 281 | userresources: {
|
251 | 282 | type: Array,
|
|
269 | 300 | /**
|
270 | 301 | * The text recognition result document.
|
271 | 302 | * @private
|
| 303 | + * @type {{tagItems: Array, wordCandidates: Array, charCandidates: Array}} |
272 | 304 | * @default {}
|
273 | 305 | */
|
274 | 306 | textdocument: {
|
|
309 | 341 | /**
|
310 | 342 | * True if SSL is activated, false otherwise
|
311 | 343 | * @private
|
| 344 | + * @type Boolean |
| 345 | + * @default true |
312 | 346 | */
|
313 | 347 | ssl: {
|
314 | 348 | type: Boolean,
|
|
327 | 361 | },
|
328 | 362 | /**
|
329 | 363 | * Clear the current document.
|
| 364 | + * @deprecated Use clear instead of delete |
| 365 | + * @private |
330 | 366 | */
|
331 | 367 | delete: function () {
|
332 | 368 | this._clear();
|
333 | 369 | },
|
| 370 | + /** |
| 371 | + * Clear the current document. |
| 372 | + */ |
| 373 | + clear: function () { |
| 374 | + this._clear(); |
| 375 | + }, |
334 | 376 | /**
|
335 | 377 | * Undo the last action.
|
336 | 378 | */
|
|
361 | 403 | _onChanged: function (e) {
|
362 | 404 | this.fire(e.type, e.detail);
|
363 | 405 | },
|
| 406 | + /** |
| 407 | + * Recognition success listener. |
| 408 | + * |
| 409 | + * @private |
| 410 | + * @method _onSuccess |
| 411 | + */ |
364 | 412 | _onSuccess: function (e) {
|
365 | 413 | if (e.detail && e.detail.getDocument) {
|
366 | 414 | this.textdocument = e.detail.getDocument();
|
|
0 commit comments