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