• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import Contact from '../entity/Contact';
17import ContactList from './ContactList';
18import ContactDelta from './ContactDelta';
19import ContactListItem from './ContactListItem';
20
21/**
22 * Contact storage management, shielding dependency on the CP layer
23 * Contacts Only
24 */
25export default interface IContactRepository {
26  save: (contact: ContactDelta, callback) => void;
27  findById: (id: number, callback) => void;
28  findByQuickSearchKey: (searchKey: string, callback) => void;
29  findAll: (favorite: number, actionData: any, callback) => void;
30  findAllWithBookIndex: () => ContactList;
31  search: (queryStr: string) => ContactList;
32  findByPhoneIsNotNull: (favorite: number, editContact: number, callback) => void;
33  findByMailIsNotNull: () => ContactList;
34  deleteByIdIn: (ids: number[]) => boolean;
35  deleteById: (id: number, callback) => void;
36  notifyChange: () => void;
37  registerDataChangeObserver: (callback) => void;
38  unRegisterDataChangeObserver: (callback) => void;
39}