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 16const ExtensionContext = requireNapi('application.ExtensionContext'); 17 18class InputMethodExtensionContext extends ExtensionContext { 19 constructor(obj) { 20 super(obj); 21 this.extensionAbilityInfo = obj.extensionAbilityInfo; 22 } 23 24 startAbility(want, options, callback) { 25 return this.__context_impl__.startAbility(want, options, callback); 26 } 27 28 connectAbility(want, options) { 29 return this.__context_impl__.connectAbility(want, options); 30 } 31 32 connectServiceExtensionAbility(want, options) { 33 return this.__context_impl__.connectAbility(want, options); 34 } 35 36 37 startAbilityWithAccount(want, accountId, options, callback) { 38 return this.__context_impl__.startAbilityWithAccount(want, accountId, options, callback); 39 } 40 41 connectAbilityWithAccount(want, accountId, options) { 42 return this.__context_impl__.connectAbilityWithAccount(want, accountId, options); 43 } 44 45 disconnectServiceExtensionAbility(want, options) { 46 return this.__context_impl__.disconnectAbility(want, options); 47 } 48 49 disconnectAbility(connection, callback) { 50 return this.__context_impl__.disconnectAbility(connection, callback); 51 } 52 53 terminateSelf(callback) { 54 return this.__context_impl__.terminateSelf(callback); 55 } 56 57 destroy(callback) { 58 return this.__context_impl__.destroy(callback); 59 } 60} 61 62export default InputMethodExtensionContext;