speech_recognition_private.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Copyright 2021 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. // This file was generated by:
  5. // tools/json_schema_compiler/compiler.py.
  6. // NOTE: The format of types has changed. 'FooType' is now
  7. // 'chrome.speechRecognitionPrivate.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/main/docs/closure_compilation.md
  10. /** @fileoverview Externs generated from namespace: speechRecognitionPrivate */
  11. /** @const */
  12. chrome.speechRecognitionPrivate = {};
  13. /**
  14. * @enum {string}
  15. */
  16. chrome.speechRecognitionPrivate.SpeechRecognitionType = {
  17. ON_DEVICE: 'onDevice',
  18. NETWORK: 'network',
  19. };
  20. /**
  21. * @typedef {{
  22. * clientId: (number|undefined)
  23. * }}
  24. */
  25. chrome.speechRecognitionPrivate.SpeechRecognitionStopEvent;
  26. /**
  27. * @typedef {{
  28. * clientId: (number|undefined),
  29. * transcript: string,
  30. * isFinal: boolean
  31. * }}
  32. */
  33. chrome.speechRecognitionPrivate.SpeechRecognitionResultEvent;
  34. /**
  35. * @typedef {{
  36. * clientId: (number|undefined),
  37. * message: string
  38. * }}
  39. */
  40. chrome.speechRecognitionPrivate.SpeechRecognitionErrorEvent;
  41. /**
  42. * @typedef {{
  43. * clientId: (number|undefined),
  44. * locale: (string|undefined),
  45. * interimResults: (boolean|undefined)
  46. * }}
  47. */
  48. chrome.speechRecognitionPrivate.StartOptions;
  49. /**
  50. * @typedef {{
  51. * clientId: (number|undefined)
  52. * }}
  53. */
  54. chrome.speechRecognitionPrivate.StopOptions;
  55. /**
  56. * Starts listening to audio from the user. The callback is invoked when speech
  57. * recognition has started. If speech recognition is already active when calling
  58. * start(), the callback is run with an error.
  59. * @param {!chrome.speechRecognitionPrivate.StartOptions} options
  60. * @param {function(!chrome.speechRecognitionPrivate.SpeechRecognitionType): void}
  61. * callback Called when speech recognition has begun listening to the user's
  62. * audio. The callback's parameter specifies which type of speech
  63. * recognition is being used.
  64. */
  65. chrome.speechRecognitionPrivate.start = function(options, callback) {};
  66. /**
  67. * Stops listening to audio from the user. The callback is invoked when speech
  68. * recognition has stopped. If speech recognition has already stopped when
  69. * calling stop(), the callback is run with an error.
  70. * @param {!chrome.speechRecognitionPrivate.StopOptions} options
  71. * @param {function(): void} callback Called when speech recognition has stopped
  72. * listening to the user's audio.
  73. */
  74. chrome.speechRecognitionPrivate.stop = function(options, callback) {};
  75. /**
  76. * Fired when speech recognition stops.
  77. * @type {!ChromeEvent}
  78. */
  79. chrome.speechRecognitionPrivate.onStop;
  80. /**
  81. * Fired when a speech recognition result is returned.
  82. * @type {!ChromeEvent}
  83. */
  84. chrome.speechRecognitionPrivate.onResult;
  85. /**
  86. * Fired when a speech recognition error occurs.
  87. * @type {!ChromeEvent}
  88. */
  89. chrome.speechRecognitionPrivate.onError;