| // services/data_decoder/public/mojom/json_parser.mojom-lite.js is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2018 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| /** |
| * @fileoverview |
| * @suppress {missingRequire} |
| */ |
| 'use strict'; |
| |
| |
| mojo.internal.exportModule('dataDecoder.mojom'); |
| |
| |
| |
| |
| |
| |
| |
| |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| * @export |
| */ |
| dataDecoder.mojom.JsonParserPendingReceiver = class { |
| /** |
| * @param {!MojoHandle|!mojo.internal.interfaceSupport.Endpoint} handle |
| */ |
| constructor(handle) { |
| /** @public {!mojo.internal.interfaceSupport.Endpoint} */ |
| this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle); |
| } |
| |
| /** @param {string=} scope */ |
| bindInBrowser(scope = 'context') { |
| mojo.internal.interfaceSupport.bind( |
| this.handle, |
| dataDecoder.mojom.JsonParser.$interfaceName, |
| scope); |
| } |
| }; |
| |
| |
| |
| /** |
| * @export |
| * @implements { dataDecoder.mojom.JsonParserInterface } |
| */ |
| dataDecoder.mojom.JsonParserRemote = class { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!dataDecoder.mojom.JsonParserPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase( |
| dataDecoder.mojom.JsonParserPendingReceiver, |
| handle); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!dataDecoder.mojom.JsonParserPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| |
| |
| /** |
| * @param { !string } json |
| * @param { !number } options |
| * @return {!Promise<{ |
| result: ?mojoBase.mojom.Value, |
| error: ?string, |
| * }>} |
| */ |
| |
| parse( |
| json, |
| options) { |
| return this.proxy.sendMessage( |
| 0, |
| dataDecoder.mojom.JsonParser_Parse_ParamsSpec.$, |
| dataDecoder.mojom.JsonParser_Parse_ResponseParamsSpec.$, |
| [ |
| json, |
| options |
| ]); |
| } |
| }; |
| |
| /** |
| * An object which receives request messages for the JsonParser |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| * |
| * @export |
| */ |
| dataDecoder.mojom.JsonParserReceiver = class { |
| /** |
| * @param {!dataDecoder.mojom.JsonParserInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!dataDecoder.mojom.JsonParserRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| dataDecoder.mojom.JsonParserRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!dataDecoder.mojom.JsonParserRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| dataDecoder.mojom.JsonParser_Parse_ParamsSpec.$, |
| dataDecoder.mojom.JsonParser_Parse_ResponseParamsSpec.$, |
| impl.parse.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| }; |
| |
| /** |
| * @export |
| */ |
| dataDecoder.mojom.JsonParser = class { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "data_decoder.mojom.JsonParser"; |
| } |
| |
| /** |
| * Returns a remote for this interface which sends messages to the browser. |
| * The browser must have an interface request binder registered for this |
| * interface and accessible to the calling document's frame. |
| * |
| * @return {!dataDecoder.mojom.JsonParserRemote} |
| * @export |
| */ |
| static getRemote() { |
| let remote = new dataDecoder.mojom.JsonParserRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| }; |
| |
| |
| /** |
| * An object which receives request messages for the JsonParser |
| * mojom interface and dispatches them as callbacks. One callback receiver exists |
| * on this object for each message defined in the mojom interface, and each |
| * receiver can have any number of listeners added to it. |
| * |
| * @export |
| */ |
| dataDecoder.mojom.JsonParserCallbackRouter = class { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal( |
| dataDecoder.mojom.JsonParserRemote); |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!dataDecoder.mojom.JsonParserRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.parse = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver( |
| this.router_); |
| |
| this.helper_internal_.registerHandler( |
| 0, |
| dataDecoder.mojom.JsonParser_Parse_ParamsSpec.$, |
| dataDecoder.mojom.JsonParser_Parse_ResponseParamsSpec.$, |
| this.parse.createReceiverHandler(true /* expectsResponse */)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| |
| /** |
| * @param {number} id An ID returned by a prior call to addListener. |
| * @return {boolean} True iff the identified listener was found and removed. |
| * @export |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| }; |
| |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| dataDecoder.mojom.JsonParser_Parse_ParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| * @export |
| */ |
| dataDecoder.mojom.JsonParser_Parse_ResponseParamsSpec = |
| { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| |
| |
| |
| |
| mojo.internal.Struct( |
| dataDecoder.mojom.JsonParser_Parse_ParamsSpec.$, |
| 'JsonParser_Parse_Params', |
| [ |
| mojo.internal.StructField( |
| 'json', 0, |
| 0, |
| mojo.internal.String, |
| null, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| mojo.internal.StructField( |
| 'options', 8, |
| 0, |
| mojo.internal.Uint32, |
| 0, |
| false, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 24],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| dataDecoder.mojom.JsonParser_Parse_Params = class { |
| constructor() { |
| /** @export { !string } */ |
| this.json; |
| /** @export { !number } */ |
| this.options; |
| } |
| }; |
| |
| |
| |
| mojo.internal.Struct( |
| dataDecoder.mojom.JsonParser_Parse_ResponseParamsSpec.$, |
| 'JsonParser_Parse_ResponseParams', |
| [ |
| mojo.internal.StructField( |
| 'result', 0, |
| 0, |
| mojoBase.mojom.ValueSpec.$, |
| null, |
| true, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| mojo.internal.StructField( |
| 'error', 16, |
| 0, |
| mojo.internal.String, |
| null, |
| true, /* nullable */ |
| 0 /* minVersion */, |
| ), |
| ], |
| [[0, 32],]); |
| |
| |
| |
| |
| |
| /** @record */ |
| dataDecoder.mojom.JsonParser_Parse_ResponseParams = class { |
| constructor() { |
| /** @export { (mojoBase.mojom.Value|undefined) } */ |
| this.result; |
| /** @export { (string|undefined) } */ |
| this.error; |
| } |
| }; |
| |