1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5[
6  {
7    "namespace": "inputMethodPrivate",
8    "compiler_options": {
9      "implemented_in": "chrome/browser/chromeos/extensions/input_method_api.h"
10    },
11    "description": "none",
12    "types": [
13      {
14        "id": "MenuItemStyle",
15        "type": "string",
16        "description": "The type of menu item. Radio buttons between separators are considered grouped.",
17        "enum": ["check", "radio", "separator"]
18      },
19      {
20        "id": "MenuItem",
21        "type": "object",
22        "description": "A menu item used by an input method to interact with the user from the language menu.",
23        "properties": {
24          "id": {"type": "string", "description": "String that will be passed to callbacks referencing this MenuItem."},
25          "label": {"type": "string", "optional": true, "description": "Text displayed in the menu for this item."},
26          "style": {
27            "$ref": "MenuItemStyle",
28            "optional": true,
29            "description": "The type of menu item."
30          },
31          "visible": {"type": "boolean", "optional": true, "description": "Indicates this item is visible."},
32          "checked": {"type": "boolean", "optional": true, "description": "Indicates this item should be drawn with a check."},
33          "enabled": {"type": "boolean", "optional": true, "description": "Indicates this item is enabled."}
34        }
35      },
36      {
37        "id": "UnderlineStyle",
38        "type": "string",
39        "description": "The type of the underline to modify a composition segment.",
40        "enum": ["underline", "doubleUnderline", "noUnderline"]
41      },
42      {
43        "id": "FocusReason",
44        "type": "string",
45        "description": "Describes how the text field was focused",
46        "enum": ["mouse", "touch", "pen", "other"]
47      },
48      {
49        "id": "InputModeType",
50        "type": "string",
51        "description": "Type of keyboard to show for this text field, (Text, Number, URL, etc) set by mode property of input tag",
52        "enum": ["noKeyboard", "text", "tel", "url", "email", "numeric", "decimal", "search"]
53      },
54      {
55        "id": "InputContextType",
56        "type": "string",
57        "description": "Type of value this text field edits, (Text, Number, URL, etc)",
58        "enum": ["text", "search", "tel", "url", "email", "number", "password", "null"]
59      },
60      {
61        "id": "AutoCapitalizeType",
62        "type": "string",
63        "description": "The auto-capitalize type of the text field.",
64        "enum": ["off", "characters", "words", "sentences"]
65      },
66      {
67        "id": "InputContext",
68        "type": "object",
69        "description": "Describes an input Context",
70        "properties": {
71          "contextID": {"type": "integer", "description": "This is used to specify targets of text field operations.  This ID becomes invalid as soon as onBlur is called."},
72          "type": {"$ref": "InputContextType", "description": "Type of value this text field edits, (Text, Number, URL, etc)"},
73          "mode": {"$ref": "InputModeType", "description": "Type of keyboard to show for this field (Text, Number, URL, etc)"},
74          "autoCorrect": {"type": "boolean", "description": "Whether the text field wants auto-correct."},
75          "autoComplete": {"type": "boolean", "description": "Whether the text field wants auto-complete."},
76          "autoCapitalize": {"$ref": "AutoCapitalizeType", "description": "The auto-capitalize type of the text field."},
77          "spellCheck": {"type": "boolean", "description": "Whether the text field wants spell-check."},
78          "shouldDoLearning": {"type": "boolean", "description": "Whether text entered into the text field should be used to improve typing suggestions for the user."},
79          "focusReason": {"$ref": "FocusReason", "description": "How the text field was focused"},
80          "hasBeenPassword": {"type": "boolean", "description": "Whether the text field has ever been a password field."},
81          "appKey": {"type": "string", "optional": true, "description": "Key of the app associated with this text field if any."}
82        }
83      },
84      {
85        "id": "InputMethodSettings",
86        "type": "object",
87        "description": "User preference settings for a specific input method. Japanese input methods are not included because they are managed separately by Mozc module.",
88        "properties": {
89          "enableCompletion": { "type": "boolean", "optional": true, "description": "Whether to enable auto completion."},
90          "enableDoubleSpacePeriod": { "type": "boolean", "optional": true, "description": "Whether to auto transform double spaces to type period."},
91          "enableGestureTyping": { "type": "boolean", "optional": true, "description": "Whether to enable gesture typing."},
92          "enablePrediction": { "type": "boolean", "optional": true, "description": "Whether to enable word prediction."},
93          "enableSoundOnKeypress": { "type": "boolean", "optional": true, "description": "Whether to enable sound on keypress."},
94          "physicalKeyboardAutoCorrectionLevel": { "type": "integer", "optional": true, "description": "The level of auto correction for physical keyboard (0: Off, 1: Modest, 2: Aggressive)."},
95          "physicalKeyboardEnableCapitalization": { "type": "boolean", "optional": true, "description": "Whether to enable auto capitalization for physical keyboard."},
96          "virtualKeyboardAutoCorrectionLevel": { "type": "integer", "optional": true, "description": "The level of auto correction for virtual keyboard (0: Off, 1: Modest, 2: Aggressive)."},
97          "virtualKeyboardEnableCapitalization": { "type": "boolean", "optional": true, "description": "Whether enable auto capitalization for virtual keyboard."},
98          "xkbLayout": { "type": "string", "optional": true, "description": "The xkb keyboard (system provided keyboard) layout."},
99          "koreanEnableSyllableInput": { "type": "boolean", "optional": true, "description": "Whether input one syllable at a time in korean input method."},
100          "koreanKeyboardLayout": { "type": "string", "optional": true, "description": "The layout of korean keyboard."},
101          "koreanShowHangulCandidate": { "type": "boolean", "optional": true, "description": "Whether to show hangul candidates in korean input method."},
102          "pinyinChinesePunctuation": { "type": "boolean", "optional": true, "description": "Whether to use Chinese punctuations in pinyin."},
103          "pinyinDefaultChinese": {
104            "type": "boolean",
105            "optional": true,
106            "description": "User can use shortcuts to switch between Chinese and English quickly when using pinyin, this flag indicates whether the default language is Chinese."
107          },
108          "pinyinEnableFuzzy": { "type": "boolean", "optional": true, "description": "Whether to enable fuzzy pinyin."},
109          "pinyinEnableLowerPaging": { "type": "boolean", "optional": true, "description": "Whether to enable using ','/'.' to page up/down the candidates in pinyin."},
110          "pinyinEnableUpperPaging": { "type": "boolean", "optional": true, "description": "Whether to enable using '-'/'=' to page up/down the candidates in pinyin."},
111          "pinyinFullWidthCharacter": { "type": "boolean", "optional": true, "description": "Whether to output full width letters and digits in pinyin."},
112          "pinyinFuzzyConfig": {
113            "type": "object",
114            "optional": true,
115            "description": "The configuration of which fuzzy pairs are enable.",
116            "properties": {
117              "an_ang": {"type": "boolean", "optional": true, "description": "Whether to enable an_ang fuzzy"},
118              "c_ch": {"type": "boolean", "optional": true, "description": "Whether to enable c_ch fuzzy"},
119              "en_eng": {"type": "boolean", "optional": true, "description": "Whether to enable en_eng fuzzy"},
120              "f_h": {"type": "boolean", "optional": true, "description": "Whether to enable f_h fuzzy"},
121              "ian_iang": {"type": "boolean", "optional": true, "description": "Whether to enable ian_iang fuzzy"},
122              "in_ing": {"type": "boolean", "optional": true, "description": "Whether to enable in_ing fuzzy"},
123              "k_g": {"type": "boolean", "optional": true, "description": "Whether to enable k_g fuzzy"},
124              "l_n": {"type": "boolean", "optional": true, "description": "Whether to enable l_n fuzzy"},
125              "r_l": {"type": "boolean", "optional": true, "description": "Whether to enable r_l fuzzy"},
126              "s_sh": {"type": "boolean", "optional": true, "description": "Whether to enable s_sh fuzzy"},
127              "uan_uang": {"type": "boolean", "optional": true, "description": "Whether to enable uan_uang fuzzy"},
128              "z_zh": {"type": "boolean", "optional": true, "description": "Whether to enable z_zh fuzzy"}
129            }
130          },
131          "zhuyinKeyboardLayout": { "type": "string", "optional": true, "description": "The layout of zhuyin keyboard."},
132          "zhuyinPageSize": { "type": "integer", "optional": true, "description": "The page size of zhuyin candidate page."},
133          "zhuyinSelectKeys": { "type": "string", "optional": true, "description": "The keys used to select candidates in zhuyin."}
134        }
135      }
136    ],
137    "functions": [
138      {
139        "name": "getInputMethodConfig",
140        "type": "function",
141        "description": "Gets configurations for input methods.",
142        "parameters": [
143          {
144            "name": "callback",
145            "type": "function",
146            "optional": false,
147            "description": "Callback which is called with the config object.",
148            "parameters": [
149              {
150                "name": "config",
151                "type": "object",
152                "description": "The input method config object.",
153                "properties": {
154                  "isPhysicalKeyboardAutocorrectEnabled": {"type": "boolean"},
155                  "isImeMenuActivated": {"type": "boolean"}
156                }
157              }
158            ]
159          }
160        ]
161      }, {
162        "name": "getInputMethods",
163        "type": "function",
164        "description": "Gets all whitelisted input methods.",
165        "parameters": [
166          {
167            "name": "callback",
168            "type": "function",
169            "optional": false,
170            "description": "Callback which is called with the input method objects.",
171            "parameters": [
172              {
173                "name": "inputMethods",
174                "type": "array",
175                "description": "Whitelisted input method objects.",
176                "items": {
177                  "type": "object",
178                  "properties": {
179                    "id": {"type": "string"},
180                    "name": {"type": "string"},
181                    "indicator": {"type": "string"}
182                  }
183                }
184              }
185            ]
186          }
187        ]
188      }, {
189        "name": "getCurrentInputMethod",
190        "type": "function",
191        "description": "Gets the current input method.",
192        "parameters": [
193          {
194            "name": "callback",
195            "type": "function",
196            "optional": false,
197            "description": "Callback which is called with the current input method.",
198            "parameters": [
199              {
200                "name": "inputMethodId",
201                "type": "string",
202                "description": "Current input method."
203              }
204            ]
205          }
206        ]
207      }, {
208        "name": "setCurrentInputMethod",
209        "type": "function",
210        "description": "Sets the current input method.",
211        "parameters": [
212          {
213            "name": "inputMethodId",
214            "type": "string",
215            "optional": false,
216            "description": "The input method ID to be set as current input method."
217          },
218          {
219            "name": "callback",
220            "type": "function",
221            "optional": true,
222            "description": "Callback which is called once the current input method is set. If unsuccessful $(ref:runtime.lastError) is set.",
223            "parameters": []
224          }
225        ]
226      }, {
227        "name": "fetchAllDictionaryWords",
228        "type": "function",
229        "description": "Fetches a list of all the words currently in the dictionary.",
230        "parameters": [
231          {
232            "name": "callback",
233            "type": "function",
234            "optional": false,
235            "description": "Callback which is called once the list of dictionary words are ready.",
236            "parameters": [
237              {
238                "name": "words",
239                "type": "array",
240                "description": "List of dictionary words.",
241                "items": {
242                  "type": "string"
243                }
244              }
245            ]
246          }
247        ]
248      }, {
249        "name": "addWordToDictionary",
250        "type": "function",
251        "description": "Adds a single word to be stored in the dictionary.",
252        "parameters": [
253          {
254            "name": "word",
255            "type": "string",
256            "optional": false,
257            "description": "A new word to add to the dictionary."
258          },
259          {
260            "name": "callback",
261            "type": "function",
262            "optional": true,
263            "description": "Callback which is called once the word is added. If unsuccessful $(ref:runtime.lastError) is set.",
264            "parameters": []
265          }
266        ]
267      }, {
268        "name": "getEncryptSyncEnabled",
269        "type": "function",
270        "description": "Gets whether the encrypt sync is enabled.",
271        "parameters": [
272          {
273            "name": "callback",
274            "type": "function",
275            "optional": true,
276            "description": "Callback which is called to provide the result.",
277            "parameters": [
278              {
279                "name": "enabled",
280                "type": "boolean",
281                "optional": false,
282                "description": "The result of whether enabled."
283              }
284            ]
285          }
286        ]
287      }, {
288        "name": "setXkbLayout",
289        "type": "function",
290        "description": "Sets the XKB layout for the given input method.",
291        "parameters": [
292          {
293            "name": "xkb_name",
294            "type": "string",
295            "description": "The XKB layout name."
296          },
297          {
298            "name": "callback",
299            "type": "function",
300            "optional": true,
301            "description": "Callback which is called when the layout is set.",
302            "parameters": []
303          }
304        ]
305      }, {
306        "name": "finishComposingText",
307        "type": "function",
308        "description": "Commits the text currently being composed without moving the selected text range. This is a no-op if the context is incorrect.",
309        "parameters": [
310          {
311            "name": "parameters",
312            "type": "object",
313            "properties": {
314              "contextID": {
315                "description": "ID of the context where we want to finish composing.",
316                "type": "integer"
317              }
318            }
319          },
320          {
321            "type": "function",
322            "name": "callback",
323            "optional": true,
324            "description": "Called when the operation completes.",
325            "parameters": []
326          }
327        ]
328      }, {
329        "name": "setSelectionRange",
330        "type": "function",
331        "description": "Sets the selection range",
332        "parameters": [
333          {
334            "name": "parameters",
335            "type": "object",
336            "properties": {
337              "contextID": {
338                "description": "ID of the context where we want to set the selection.",
339                "type": "integer"
340              },
341              "selectionStart": {
342                "description": "Selection start position. Must be a valid uint32 value (Positive and less than 0xFFFFFFFF).",
343                "optional": true,
344                "type": "integer"
345              },
346              "selectionEnd": {
347                "description": "Selection end position. Must be a valid uint32 value (Positive and less than 0xFFFFFFFF).",
348                "optional": true,
349                "type": "integer"
350              }
351            }
352          },
353          {
354            "type": "function",
355            "name": "callback",
356            "optional": true,
357            "description": "Called when the operation completes with a boolean indicating if the text was accepted or not.",
358            "parameters": [
359              {
360                "name": "success",
361                "type": "boolean"
362              }
363            ]
364          }
365        ]
366      }, {
367        "name": "notifyImeMenuItemActivated",
368        "type": "function",
369        "description": "Fires the input.ime.onMenuItemActivated event.",
370        "parameters": [
371          {
372            "name": "engineID",
373            "type": "string",
374            "description": "ID of the engine to use."
375          },
376          {
377            "name": "name",
378            "type": "string",
379            "description": "Name of the MenuItem which was activated"
380          }
381        ]
382      }, {
383        "name": "showInputView",
384        "type": "function",
385        "description": "Shows the input view window. If the input view window is already shown, this function will do nothing.",
386        "parameters": [
387          {
388            "type": "function",
389            "name": "callback",
390            "optional": true,
391            "description": "Called when the operation completes.",
392            "parameters": []
393          }
394        ]
395      }, {
396        "name": "hideInputView",
397        "type": "function",
398        "description": "Hides the input view window. If the input view window is already hidden, this function will do nothing.",
399        "parameters": [
400          {
401            "type": "function",
402            "name": "callback",
403            "optional": true,
404            "description": "Called when the operation completes.",
405            "parameters": []
406          }
407        ]
408      }, {
409        "name": "openOptionsPage",
410        "type": "function",
411        "description": "Opens the options page for the input method extension. If the input method does not have options, this function will do nothing.",
412        "parameters": [
413          {
414            "name": "inputMethodId",
415            "type": "string",
416            "description": "ID of the input method to open options for."
417          }
418        ]
419      }, {
420        "name": "getCompositionBounds",
421        "type": "function",
422        "description": "Gets the composition bounds",
423        "parameters": [
424          {
425            "type": "function",
426            "name": "callback",
427            "description": "Callback which is called to provide the result",
428            "parameters": [
429              {
430                "name": "boundsList",
431                "type": "array",
432                "description": "List of bounds information.",
433                "items": {
434                  "type": "object",
435                  "properties": {
436                    "x": {"type": "integer"},
437                    "y": {"type": "integer"},
438                    "w": {"type": "integer"},
439                    "h": {"type": "integer"}
440                  }
441                }
442              }
443            ]
444          }
445        ]
446      }, {
447        "name": "getSurroundingText",
448        "type": "function",
449        "description": "Gets the surrounding text of the current selection",
450        "parameters": [
451          {
452            "name": "beforeLength",
453            "type": "integer",
454            "description": "The number of characters before the current selection."
455          },
456          {
457            "name": "afterLength",
458            "type": "integer",
459            "description": "The number of characters after the current selection."
460          },
461          {
462            "type": "function",
463            "name": "callback",
464            "description": "Callback which is called to provide the result",
465            "parameters": [
466              {
467                "name": "surroundingInfo",
468                "type": "object",
469                "description": "The surrouding text info.",
470                "properties": {
471                  "before": {"type": "string"},
472                  "selected": {"type": "string"},
473                  "after": {"type": "string"}
474                }
475              }
476            ]
477          }
478        ]
479      }, {
480        "name": "getSettings",
481        "type": "function",
482        "description": "Gets the current values of all settings for a particular input method",
483        "parameters": [
484          {
485            "name": "engineID",
486            "type": "string",
487            "description": "The ID of the engine (e.g. 'zh-t-i0-pinyin', 'xkb:us::eng')"
488          },
489          {
490            "type": "function",
491            "name": "callback",
492            "description": "Callback to receive the settings",
493            "parameters": [
494              {
495                "name": "settings",
496                "$ref": "InputMethodSettings",
497                "optional": true,
498                "description": "The requested setting, or null if there's no value"
499              }
500            ]
501          }
502        ]
503      }, {
504        "name": "setSettings",
505        "type": "function",
506        "description": "Sets the value of all settings for a particular input method",
507        "parameters": [
508          {
509            "name": "engineID",
510            "type": "string",
511            "description": "The ID of the engine (e.g. 'zh-t-i0-pinyin', 'xkb:us::eng')"
512          },
513          {
514            "name": "settings",
515            "$ref": "InputMethodSettings",
516            "description": "The settings to set"
517          },
518          {
519            "type": "function",
520            "name": "callback",
521            "optional": true,
522            "description": "Callback to notify that the new value has been set",
523            "parameters": []
524          }
525        ]
526      }, {
527        "name": "setCompositionRange",
528        "type": "function",
529        "description": "(Deprecated) Set the composition range. If this extension does not own the active IME, this fails. Use setComposingRange instead.",
530        "parameters": [
531          {
532            "name": "parameters",
533            "type": "object",
534            "properties": {
535              "contextID": {
536                "description": "ID of the context where the composition text will be set",
537                "type": "integer"
538              },
539              "selectionBefore": {
540                "description": "How much before the current selection to set as composition.",
541                "type": "integer"
542              },
543              "selectionAfter": {
544                "description": "How much after the current selection to set as composition.",
545                "type": "integer"
546              },
547              "segments": {
548                "description": "List of segments and their associated types.",
549                "type": "array",
550                "optional": true,
551                "items": {
552                  "type": "object",
553                  "properties": {
554                    "start": {
555                      "description": "Index of the character to start this segment at",
556                      "type": "integer"
557                    },
558                    "end": {
559                      "description": "Index of the character to end this segment after.",
560                      "type": "integer"
561                    },
562                    "style": {
563                      "$ref": "UnderlineStyle",
564                      "description": "The type of the underline to modify this segment."
565                    }
566                  }
567                }
568              }
569            }
570          },
571          {
572            "type": "function",
573            "name": "callback",
574            "optional": true,
575            "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, $(ref:runtime.lastError) is set.",
576            "parameters": [
577              {
578                "name": "success",
579                "type": "boolean"
580              }
581            ]
582          }
583        ]
584      }, {
585        "name": "setComposingRange",
586        "type": "function",
587        "description": "Sets the composing range. If this extension does not own the active IME, this fails.",
588        "parameters": [
589          {
590            "name": "parameters",
591            "type": "object",
592            "properties": {
593              "contextID": {
594                "description": "ID of the context where the composition text will be set",
595                "type": "integer"
596              },
597              "start": {
598                "description": "The starting index of the composing range, in bytes.",
599                "type": "integer"
600              },
601              "end": {
602                "description": "The ending index of the composing range, in bytes. The order of the start and end index does not matter.",
603                "type": "integer"
604              },
605              "segments": {
606                "description": "List of segments and their associated types.",
607                "type": "array",
608                "optional": true,
609                "items": {
610                  "type": "object",
611                  "properties": {
612                    "start": {
613                      "description": "Index of the character to start this segment at",
614                      "type": "integer"
615                    },
616                    "end": {
617                      "description": "Index of the character to end this segment after.",
618                      "type": "integer"
619                    },
620                    "style": {
621                      "$ref": "UnderlineStyle",
622                      "description": "The type of the underline to modify this segment."
623                    }
624                  }
625                }
626              }
627            }
628          },
629          {
630            "type": "function",
631            "name": "callback",
632            "optional": true,
633            "description": "Called when the operation is complete. On failure, $(ref:runtime.lastError) is set."
634          }
635        ]
636      }, {
637        "name": "getAutocorrectRange",
638        "type": "function",
639        "description": "Get the autocorrected word's bounds. Returns an empty range if there is no autocorrected word.",
640        "parameters": [
641          {
642            "name": "parameters",
643            "type": "object",
644            "properties": {
645              "contextID": {
646                "description": "ID of the autocorrected context.",
647                "type": "integer"
648              }
649            }
650          },
651          {
652            "type": "function",
653            "name": "callback",
654            "description": "Called with the bounds of the autocorrect word when the operation completes. On failure, $(ref:runtime.lastError) is set.",
655            "parameters": [
656              {
657                "name": "autocorrectCharacterBounds",
658                "type": "object",
659                "properties": {
660                  "start": {
661                    "description": "The start index of the autocorrected word's bounds.",
662                    "type": "integer"
663                  },
664                  "end": {
665                    "description": "The end index of the autocorrected word's bounds.",
666                    "type": "integer"
667                  }
668                }
669              }
670            ]
671          }
672        ]
673      }, {
674        "name": "getAutocorrectCharacterBounds",
675        "type": "function",
676        "description": "Get the screen coordinates of the autocorrected word's bounds.",
677        "parameters": [
678          {
679            "name": "parameters",
680            "type": "object",
681            "properties": {
682              "contextID": {
683                "description": "ID of the autocorrected context.",
684                "type": "integer"
685              }
686            }
687          },
688          {
689            "type": "function",
690            "name": "callback",
691            "description": "Called with screen coordinates of the autocorrect word when the operation completes. On failure, $(ref:runtime.lastError) is set.",
692            "parameters": [
693              {
694                "name": "autocorrectCharacterBounds",
695                "type": "object",
696                "properties": {
697                  "x": {
698                    "description": "The x-coordinate of the autocorrected word's bounds.",
699                    "type": "integer"
700                  },
701                  "y": {
702                    "description": "The y-coordinate of the autocorrected word's bounds.",
703                    "type": "integer"
704                  },
705                  "width": {
706                    "description": "The width of the autocorrected word's bounds.",
707                    "type": "integer"
708                  },
709                  "height":{
710                    "description": "The height of the autocorrected word's bounds.",
711                    "type": "integer"
712                  }
713                }
714              }
715            ]
716          }
717        ]
718      }, {
719        "name": "setAutocorrectRange",
720        "type": "function",
721        "description": "Set the autocorrect range and autocorrect word. If this extension does not own the active IME, this fails.",
722        "parameters": [
723          {
724            "name": "parameters",
725            "type": "object",
726            "properties": {
727              "contextID": {
728                "description": "ID of the context to autocorrect.",
729                "type": "integer"
730              },
731              "autocorrectString": {
732                "description": "Autocorrect suggestion to display.",
733                "type": "string"
734              },
735              "selectionStart": {
736                "description": "Start of the selection range.",
737                "type": "integer"
738              },
739              "selectionEnd": {
740                "description": "End of the selection range.",
741                "type": "integer"
742              }
743            }
744          },
745          {
746            "type": "function",
747            "name": "callback",
748            "optional": true,
749            "description": "Called when the operation completes. On failure, chrome.runtime.lastError is set.",
750            "parameters": []
751          }
752        ]
753      }, {
754        "name": "reset",
755        "type": "function",
756        "description": "Resets the current engine to its initial state. Fires an OnReset event.",
757        "parameters": []
758      },
759      {
760        "name": "onAutocorrect",
761        "type": "function",
762        "description": "Called after a word has been autocorrected to show some UI for autocorrect.",
763        "platforms": ["chromeos"],
764      "parameters": [{
765            "name": "parameters",
766            "type": "object",
767            "properties": {
768                "contextID": {
769                    "description": "ID of the context where the autocorrect occurred.",
770                    "type": "integer"
771                },
772                "typedWord": {
773                    "type": "string",
774                    "description": "Corrected word will be replaced by this when clicking undo"
775                },
776                "correctedWord": {
777                    "type": "string",
778                    "description": "Needed to know the length of the autocorrected text to show the correct length of underline."
779                },
780                "startIndex": {
781                    "type": "integer",
782                    "description": "Offset index (in code units) in surroundingInfo (see onSurroundingTextChanged) for the start of the autocorrected text"
783                }
784            }
785        }]
786    }
787    ],
788    "events": [
789      {
790        "name": "onChanged",
791        "type": "function",
792        "description": "Fired when the input method is changed.",
793        "parameters": [
794          {
795            "name": "newInputMethodId",
796            "type": "string",
797            "description": "New input method which is being used."
798          }
799        ]
800      }, {
801        "name": "onCompositionBoundsChanged",
802        "type": "function",
803        "description": "Fired when the composition bounds or cursor bounds are changed.",
804        "parameters": [
805          {
806            "name": "firstBounds",
807            "type": "object",
808            "description": "The bounds information for the first character in composition.",
809            "properties": {
810              "x": {"type": "integer"},
811              "y": {"type": "integer"},
812              "w": {"type": "integer"},
813              "h": {"type": "integer"}
814            }
815          }, {
816            "name": "boundsList",
817            "type": "array",
818            "description": "List of bounds information.",
819            "items": {
820              "type": "object",
821              "properties": {
822                "x": {"type": "integer"},
823                "y": {"type": "integer"},
824                "w": {"type": "integer"},
825                "h": {"type": "integer"}
826              }
827            }
828          }
829        ]
830      }, {
831        "name": "onDictionaryLoaded",
832        "type": "function",
833        "description": "Fired when the custom spelling dictionary is loaded.",
834        "parameters": []
835      }, {
836        "name": "onDictionaryChanged",
837        "type": "function",
838        "description": "Fired when words are added or removed from the custom spelling dictionary.",
839        "parameters": [
840          {
841            "name": "added",
842            "type": "array",
843            "description": "List of added words.",
844            "items": {
845              "type": "string"
846            }
847          }, {
848            "name": "removed",
849            "type": "array",
850            "description": "List of removed words.",
851            "items": {
852              "type": "string"
853            }
854          }
855        ]
856      }, {
857        "name": "onImeMenuActivationChanged",
858        "type": "function",
859        "description": "Fired when the IME menu is activated or deactivated.",
860        "parameters": [
861          {
862            "name": "activation",
863            "type": "boolean",
864            "description": "Whether the IME menu is currently active."
865          }
866        ]
867      }, {
868        "name": "onImeMenuListChanged",
869        "type": "function",
870        "description": "Fired when the input method or the list of active input method IDs is changed.",
871        "parameters": []
872      }, {
873        "name": "onImeMenuItemsChanged",
874        "type": "function",
875        "description": "Fired when the input.ime.setMenuItems or input.ime.updateMenuItems API is called.",
876        "parameters": [
877          {
878            "name": "engineID",
879            "type": "string",
880            "description": "ID of the engine to use"
881          },
882          {
883            "name": "items",
884            "type": "array",
885            "items": {
886              "$ref": "MenuItem"
887            },
888            "description": "MenuItems to add or update."
889          }
890        ]
891      }, {
892        "name": "onFocus",
893        "type": "function",
894        "description": "This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user.",
895        "parameters": [
896          {
897            "$ref": "InputContext",
898            "name": "context",
899            "description": "Describes the text field that has acquired focus."
900          }
901        ]
902      }, {
903        "name": "onSettingsChanged",
904        "type": "function",
905        "description": "This event is sent when the settings for any input method changed. It is sent to all extensions that are listening to this event, and enabled by the user.",
906        "parameters": [
907          {
908            "name": "engineID",
909            "type": "string",
910            "description": "ID of the engine that changed"
911          },
912          {
913            "name": "settings",
914            "$ref": "InputMethodSettings",
915            "description": "The new settings"
916          }
917        ]
918      }, {
919        "name": "onScreenProjectionChanged",
920        "type": "function",
921        "description": "This event is sent when the screen is being mirrored or the desktop is being cast.",
922        "parameters": [
923          {
924            "name": "isProjected",
925            "type": "boolean",
926            "description": "Whether the screen is projected."
927          }
928        ]
929      }, {
930        "name": "onSuggestionsChanged",
931        "type": "function",
932        "description": "This event is sent when a new set of suggestions has been generated",
933        "parameters": [
934          {
935            "name": "suggestions",
936            "type": "array",
937            "description": "List of suggestions to display, in order of relevance",
938            "items": {
939              "type": "string"
940            }
941          }
942        ]
943      }, {
944        "name": "onInputMethodOptionsChanged",
945        "type": "function",
946        "description": "This event is sent when input method options are changed.",
947        "parameters": [
948          {
949            "name": "engineID",
950            "type": "string",
951            "description": "The engine ID for the input method being changed."
952          }
953        ]
954      }
955    ]
956  }
957]
958