OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 /** @fileoverview Externs generated from namespace: autofillPrivate */ |
| 6 |
| 7 /** |
| 8 * @const |
| 9 */ |
| 10 chrome.autofillPrivate = {}; |
| 11 |
| 12 /** |
| 13 * @enum {string} |
| 14 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressFiel
d |
| 15 */ |
| 16 chrome.autofillPrivate.AddressField = { |
| 17 FULL_NAME: 'FULL_NAME', |
| 18 COMPANY_NAME: 'COMPANY_NAME', |
| 19 ADDRESS_LINES: 'ADDRESS_LINES', |
| 20 ADDRESS_LEVEL1: 'ADDRESS_LEVEL1', |
| 21 ADDRESS_LEVEL2: 'ADDRESS_LEVEL2', |
| 22 ADDRESS_LEVEL3: 'ADDRESS_LEVEL3', |
| 23 ADDRESS_LEVEL4: 'ADDRESS_LEVEL4', |
| 24 POSTAL_CODE: 'POSTAL_CODE', |
| 25 SORTING_CODE: 'SORTING_CODE', |
| 26 COUNTRY_CODE: 'COUNTRY_CODE', |
| 27 }; |
| 28 |
| 29 /** |
| 30 * @typedef {{ |
| 31 * summaryLabel: string, |
| 32 * summarySublabel: (string|undefined), |
| 33 * isLocal: (boolean|undefined), |
| 34 * isCached: (boolean|undefined) |
| 35 * }} |
| 36 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AutofillMet
adata |
| 37 */ |
| 38 var AutofillMetadata; |
| 39 |
| 40 /** |
| 41 * @typedef {{ |
| 42 * guid: (string|undefined), |
| 43 * fullNames: (!Array<string>|undefined), |
| 44 * companyName: (string|undefined), |
| 45 * addressLines: (string|undefined), |
| 46 * addressLevel1: (string|undefined), |
| 47 * addressLevel2: (string|undefined), |
| 48 * addressLevel3: (string|undefined), |
| 49 * addressLevel4: (string|undefined), |
| 50 * postalCode: (string|undefined), |
| 51 * sortingCode: (string|undefined), |
| 52 * country: (string|undefined), |
| 53 * phoneNumbers: (!Array<string>|undefined), |
| 54 * emailAddresses: (!Array<string>|undefined), |
| 55 * languageCode: (string|undefined), |
| 56 * metadata: (AutofillMetadata|undefined) |
| 57 * }} |
| 58 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressEntr
y |
| 59 */ |
| 60 var AddressEntry; |
| 61 |
| 62 /** |
| 63 * @typedef {{ |
| 64 * field: !chrome.autofillPrivate.AddressField, |
| 65 * fieldName: string, |
| 66 * isLongField: boolean |
| 67 * }} |
| 68 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComp
onent |
| 69 */ |
| 70 var AddressComponent; |
| 71 |
| 72 /** |
| 73 * @typedef {{ |
| 74 * guid: (string|undefined), |
| 75 * cardNumber: (string|undefined), |
| 76 * expirationMonth: (number|undefined), |
| 77 * expirationYear: (number|undefined), |
| 78 * metadata: (AutofillMetadata|undefined) |
| 79 * }} |
| 80 * @see https://developer.chrome.com/extensions/autofillPrivate#type-CreditCardE
ntry |
| 81 */ |
| 82 var CreditCardEntry; |
| 83 |
| 84 /** |
| 85 * @typedef {{ |
| 86 * phoneNumbers: !Array<string>, |
| 87 * indexOfNewNumber: number, |
| 88 * countryCode: string |
| 89 * }} |
| 90 * @see https://developer.chrome.com/extensions/autofillPrivate#type-ValidatePho
neParams |
| 91 */ |
| 92 var ValidatePhoneParams; |
| 93 |
| 94 /** |
| 95 * Saves the given address. If |address| has an empty string as its ID, it will |
| 96 * be assigned a new one and added as a new entry. |
| 97 * @param {AddressEntry} address The address entry to save. |
| 98 * @see https://developer.chrome.com/extensions/autofillPrivate#method-saveAddre
ss |
| 99 */ |
| 100 chrome.autofillPrivate.saveAddress = function(address) {}; |
| 101 |
| 102 /** |
| 103 * Gets the address components for a given country code. This function invokes |
| 104 * the callback with an array of arrays of AddressComponents. Each entry in the |
| 105 * top-level array constitutes a row in the UI, while each inner array/ contains |
| 106 * the list of components to use in that row. For example, city, state, and zip |
| 107 * code are all included on the same line for US addresses. |
| 108 * @param {string} countryCode The country code for which to fetch the |
| 109 * components. |
| 110 * @param {function(!Array<AddressComponent>):void} callback Callback which will |
| 111 * be called with components. |
| 112 * @see https://developer.chrome.com/extensions/autofillPrivate#method-getAddres
sComponents |
| 113 */ |
| 114 chrome.autofillPrivate.getAddressComponents = function(countryCode, callback) {}
; |
| 115 |
| 116 /** |
| 117 * Saves the given credit card. If |card| has an empty string as its ID, it will |
| 118 * be assigned a new one and added as a new entry. |
| 119 * @param {CreditCardEntry} card The card entry to save. |
| 120 * @see https://developer.chrome.com/extensions/autofillPrivate#method-saveCredi
tCard |
| 121 */ |
| 122 chrome.autofillPrivate.saveCreditCard = function(card) {}; |
| 123 |
| 124 /** |
| 125 * Removes the entry (address or credit card) with the given ID. |
| 126 * @param {string} guid ID of the entry to remove. |
| 127 * @see https://developer.chrome.com/extensions/autofillPrivate#method-removeEnt
ry |
| 128 */ |
| 129 chrome.autofillPrivate.removeEntry = function(guid) {}; |
| 130 |
| 131 /** |
| 132 * Validates a newly-added phone number and invokes the callback with a list of |
| 133 * validated numbers. Note that if the newly-added number was invalid, it will |
| 134 * not be returned in the list of valid numbers. |
| 135 * @param {ValidatePhoneParams} params The parameters to this function. |
| 136 * @param {function(!Array<string>):void} callback Callback which will be called |
| 137 * with validated phone numbers. |
| 138 * @return {!Array<string>} |
| 139 * @see https://developer.chrome.com/extensions/autofillPrivate#method-validateP
honeNumbers |
| 140 */ |
| 141 chrome.autofillPrivate.validatePhoneNumbers = function(params, callback) {}; |
| 142 |
| 143 /** |
| 144 * Clears the data associated with a wallet card which was saved locally so that |
| 145 * the saved copy is masked (e.g., "Card ending in 1234"). |
| 146 * @param {string} guid GUID of the credit card to mask. |
| 147 * @see https://developer.chrome.com/extensions/autofillPrivate#method-maskCredi
tCard |
| 148 */ |
| 149 chrome.autofillPrivate.maskCreditCard = function(guid) {}; |
| 150 |
| 151 /** |
| 152 * Fired when the address list has changed, meaning that an entry has been |
| 153 * added, removed, or changed. |entries| The updated list of entries. |
| 154 * @type {!ChromeEvent} |
| 155 * @see https://developer.chrome.com/extensions/autofillPrivate#event-onAddressL
istChanged |
| 156 */ |
| 157 chrome.autofillPrivate.onAddressListChanged; |
| 158 |
| 159 /** |
| 160 * Fired when the credit card list has changed, meaning that an entry has been |
| 161 * added, removed, or changed. |entries| The updated list of entries. |
| 162 * @type {!ChromeEvent} |
| 163 * @see https://developer.chrome.com/extensions/autofillPrivate#event-onCreditCa
rdListChanged |
| 164 */ |
| 165 chrome.autofillPrivate.onCreditCardListChanged; |
| 166 |
| 167 |
OLD | NEW |