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.
5 /** @fileoverview Externs generated from namespace: autofillPrivate */
10 chrome.autofillPrivate = {};
14 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressField
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',
30 * summaryLabel: string,
31 * summarySublabel: (string|undefined),
32 * isLocal: (boolean|undefined),
33 * isCached: (boolean|undefined)
35 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AutofillMetadata
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 * countryCode: (string|undefined),
51 * phoneNumbers: (!Array<string>|undefined),
52 * emailAddresses: (!Array<string>|undefined),
53 * languageCode: (string|undefined),
54 * metadata: (AutofillMetadata|undefined)
56 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressEntry
62 * field: !chrome.autofillPrivate.AddressField,
64 * isLongField: boolean,
65 * placeholder: (string|undefined)
67 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponent
73 * row: !Array<AddressComponent>
75 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponentRow
77 var AddressComponentRow;
81 * components: !Array<AddressComponentRow>,
82 * languageCode: string
84 * @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponents
86 var AddressComponents;
90 * guid: (string|undefined),
91 * name: (string|undefined),
92 * cardNumber: (string|undefined),
93 * expirationMonth: (string|undefined),
94 * expirationYear: (string|undefined),
95 * metadata: (AutofillMetadata|undefined)
97 * @see https://developer.chrome.com/extensions/autofillPrivate#type-CreditCardEntry
103 * phoneNumbers: !Array<string>,
104 * indexOfNewNumber: number,
105 * countryCode: string
107 * @see https://developer.chrome.com/extensions/autofillPrivate#type-ValidatePhoneParams
109 var ValidatePhoneParams;
112 * Saves the given address. If |address| has an empty string as its ID, it will
113 * be assigned a new one and added as a new entry.
114 * @param {AddressEntry} address The address entry to save.
115 * @see https://developer.chrome.com/extensions/autofillPrivate#method-saveAddress
117 chrome.autofillPrivate.saveAddress = function(address) {};
120 * Gets the address components for a given country code.
121 * @param {string} countryCode A two-character string representing the address'
122 * country whose components should be returned. See autofill_country.cc
123 * for a list of valid codes.
124 * @param {function(AddressComponents):void} callback Callback which will be
125 * called with components.
126 * @see https://developer.chrome.com/extensions/autofillPrivate#method-getAddressComponents
128 chrome.autofillPrivate.getAddressComponents = function(countryCode, callback) {};
131 * Saves the given credit card. If |card| has an empty string as its ID, it will
132 * be assigned a new one and added as a new entry.
133 * @param {CreditCardEntry} card The card entry to save.
134 * @see https://developer.chrome.com/extensions/autofillPrivate#method-saveCreditCard
136 chrome.autofillPrivate.saveCreditCard = function(card) {};
139 * Removes the entry (address or credit card) with the given ID.
140 * @param {string} guid ID of the entry to remove.
141 * @see https://developer.chrome.com/extensions/autofillPrivate#method-removeEntry
143 chrome.autofillPrivate.removeEntry = function(guid) {};
146 * Validates a newly-added phone number and invokes the callback with a list of
147 * validated numbers. Note that if the newly-added number was invalid, it will
148 * not be returned in the list of valid numbers.
149 * @param {ValidatePhoneParams} params The parameters to this function.
150 * @param {function(!Array<string>):void} callback Callback which will be called
151 * with validated phone numbers.
152 * @see https://developer.chrome.com/extensions/autofillPrivate#method-validatePhoneNumbers
154 chrome.autofillPrivate.validatePhoneNumbers = function(params, callback) {};
157 * Clears the data associated with a wallet card which was saved locally so that
158 * the saved copy is masked (e.g., "Card ending in 1234").
159 * @param {string} guid GUID of the credit card to mask.
160 * @see https://developer.chrome.com/extensions/autofillPrivate#method-maskCreditCard
162 chrome.autofillPrivate.maskCreditCard = function(guid) {};
165 * Fired when the address list has changed, meaning that an entry has been
166 * added, removed, or changed. |entries| The updated list of entries.
167 * @type {!ChromeEvent}
168 * @see https://developer.chrome.com/extensions/autofillPrivate#event-onAddressListChanged
170 chrome.autofillPrivate.onAddressListChanged;
173 * Fired when the credit card list has changed, meaning that an entry has been
174 * added, removed, or changed. |entries| The updated list of entries.
175 * @type {!ChromeEvent}
176 * @see https://developer.chrome.com/extensions/autofillPrivate#event-onCreditCardListChanged
178 chrome.autofillPrivate.onCreditCardListChanged;