OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Closure typedefs for MD Bookmarks. | 6 * @fileoverview Closure typedefs for MD Bookmarks. |
7 */ | 7 */ |
8 | 8 |
9 /** | 9 /** |
10 * A normalized version of chrome.bookmarks.BookmarkTreeNode. | 10 * A normalized version of chrome.bookmarks.BookmarkTreeNode. |
(...skipping 19 matching lines...) Expand all Loading... |
30 * @typedef {{ | 30 * @typedef {{ |
31 * items: !Set<string>, | 31 * items: !Set<string>, |
32 * anchor: ?string, | 32 * anchor: ?string, |
33 * }} | 33 * }} |
34 * | 34 * |
35 * |items| is used as a set and all values in the map are true. | 35 * |items| is used as a set and all values in the map are true. |
36 */ | 36 */ |
37 var SelectionState; | 37 var SelectionState; |
38 | 38 |
39 /** | 39 /** |
| 40 * Note: |
| 41 * - If |results| is null, it means no search results have been returned. This |
| 42 * is different to |results| being [], which means the last search returned 0 |
| 43 * results. |
| 44 * - |term| is the last search that was performed by the user, and |results| are |
| 45 * the last results that were returned from the backend. We don't clear |
| 46 * |results| on incremental searches, meaning that |results| can be 'stale' |
| 47 * data from a previous search term (while |inProgress| is true). If you need |
| 48 * to know the exact search term used to generate |results|, you'll need to |
| 49 * add a new field to the state to track it (eg, SearchState.resultsTerm). |
40 * @typedef {{ | 50 * @typedef {{ |
41 * term: string, | 51 * term: string, |
42 * inProgress: boolean, | 52 * inProgress: boolean, |
43 * results: !Array<string>, | 53 * results: ?Array<string>, |
44 * }} | 54 * }} |
45 */ | 55 */ |
46 var SearchState; | 56 var SearchState; |
47 | 57 |
48 /** @typedef {!Set<string>} */ | 58 /** @typedef {!Set<string>} */ |
49 var ClosedFolderState; | 59 var ClosedFolderState; |
50 | 60 |
51 /** | 61 /** |
52 * @typedef {{ | 62 * @typedef {{ |
53 * canEdit: boolean, | 63 * canEdit: boolean, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 105 |
96 /** @type {boolean} */ | 106 /** @type {boolean} */ |
97 this.sameProfile = false; | 107 this.sameProfile = false; |
98 } | 108 } |
99 | 109 |
100 /** @interface */ | 110 /** @interface */ |
101 function StoreObserver() {} | 111 function StoreObserver() {} |
102 | 112 |
103 /** @param {!BookmarksPageState} newState */ | 113 /** @param {!BookmarksPageState} newState */ |
104 StoreObserver.prototype.onStateChanged = function(newState) {}; | 114 StoreObserver.prototype.onStateChanged = function(newState) {}; |
OLD | NEW |