| 1 | /* |
| 2 | * Copyright 2012 Closure Compiler Authors |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * @fileoverview Definitions for W3C's Web Intents specification. |
| 19 | * |
| 20 | * Created from |
| 21 | * http://dvcs.w3.org/hg/web-intents/raw-file/tip/spec/Overview.html |
| 22 | * and |
| 23 | * http://srcs.cc/w/Source/WebCore/Modules/intents/DOMWindowIntents.idl |
| 24 | * http://srcs.cc/w/Source/WebCore/Modules/intents/DeliveredIntent.idl |
| 25 | * http://srcs.cc/w/Source/WebCore/Modules/intents/Intent.idl |
| 26 | * http://srcs.cc/w/Source/WebCore/Modules/intents/IntentResultCallback.idl |
| 27 | * http://srcs.cc/w/Source/WebCore/Modules/intents/NavigatorIntents.idl |
| 28 | * http://srcs.cc/w/Source/WebCore/html/HTMLIntentElement.idl |
| 29 | * |
| 30 | * @externs |
| 31 | */ |
| 32 | |
| 33 | /** |
| 34 | * @param {string} action |
| 35 | * @param {string} type |
| 36 | * @param {*=} opt_data |
| 37 | * @param {Array.<Transferable>=} opt_transferList |
| 38 | * @constructor |
| 39 | */ |
| 40 | function Intent(action, type, opt_data, opt_transferList) {} |
| 41 | |
| 42 | /** @type {string} */ |
| 43 | Intent.prototype.action; |
| 44 | |
| 45 | /** @type {string} */ |
| 46 | Intent.prototype.type; |
| 47 | |
| 48 | /** @type {*} */ |
| 49 | Intent.prototype.data; |
| 50 | |
| 51 | /** |
| 52 | * @constructor |
| 53 | * @extends {Intent} |
| 54 | */ |
| 55 | function DeliveredIntent() {} |
| 56 | |
| 57 | /** @type {Array.<MessagePort>} */ |
| 58 | DeliveredIntent.prototype.ports; |
| 59 | |
| 60 | /** |
| 61 | * @param {string} key |
| 62 | * @return {string} |
| 63 | * @nosideeffects |
| 64 | */ |
| 65 | DeliveredIntent.prototype.getExtra = function(key) {}; |
| 66 | |
| 67 | /** |
| 68 | * @param {*} result |
| 69 | */ |
| 70 | DeliveredIntent.prototype.postResult = function(result) {}; |
| 71 | |
| 72 | /** |
| 73 | * @param {*} result |
| 74 | */ |
| 75 | DeliveredIntent.prototype.postFailure = function(result) {}; |
| 76 | |
| 77 | /** @type {DeliveredIntent} */ |
| 78 | Window.prototype.intent; |
| 79 | |
| 80 | /** |
| 81 | * @param {Intent} intent |
| 82 | * @param {function(*) : void=} opt_successCallback |
| 83 | * @param {function(*) : void=} opt_failureCallback |
| 84 | */ |
| 85 | Navigator.prototype.startActivity = |
| 86 | function(intent, opt_successCallback, opt_failureCallback) {}; |
| 87 | |
| 88 | /** |
| 89 | * @constructor |
| 90 | * @extends {HTMLElement} |
| 91 | */ |
| 92 | function HTMLIntentElement() {} |
| 93 | |
| 94 | /** |
| 95 | * @type {string} |
| 96 | */ |
| 97 | HTMLIntentElement.prototype.action; |
| 98 | |
| 99 | /** |
| 100 | * @type {string} |
| 101 | */ |
| 102 | HTMLIntentElement.prototype.type; |
| 103 | |
| 104 | /** |
| 105 | * @type {string} |
| 106 | */ |
| 107 | HTMLIntentElement.prototype.href; |
| 108 | |
| 109 | /** |
| 110 | * @type {string} |
| 111 | */ |
| 112 | HTMLIntentElement.prototype.title; |
| 113 | |
| 114 | /** |
| 115 | * @type {string} |
| 116 | */ |
| 117 | HTMLIntentElement.prototype.disposition; |
| 118 | |
| 119 | // Variants of the above for the implementation inside WebKit, which is |
| 120 | // vendor-prefixed. |
| 121 | |
| 122 | /** @type {DeliveredIntent} */ |
| 123 | Window.prototype.webkitIntent; |
| 124 | |
| 125 | /** |
| 126 | * @param {string} action |
| 127 | * @param {string} type |
| 128 | * @param {*=} opt_data |
| 129 | * @param {Array.<Transferable>=} opt_transferList |
| 130 | * @constructor |
| 131 | * @extends {Intent} |
| 132 | */ |
| 133 | function WebKitIntent(action, type, opt_data, opt_transferList) {} |
| 134 | |
| 135 | /** |
| 136 | * @param {WebKitIntent} intent |
| 137 | * @param {function(*) : void=} opt_successCallback |
| 138 | * @param {function(*) : void=} opt_failureCallback |
| 139 | */ |
| 140 | Navigator.prototype.webkitStartActivity = |
| 141 | function(intent, opt_successCallback, opt_failureCallback) {}; |