diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputMethod.d.ts similarity index 96% rename from api/@ohos.inputmethod.d.ts rename to api/@ohos.inputMethod.d.ts index 2ec69c2eeb4b37a92c26744b2e753eb227fa02a3..ad479ea249bdc34f755c6c174be5375f0689d46f 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputMethod.d.ts @@ -1,53 +1,53 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {AsyncCallback} from './basic'; - -/** - * inputmethod - * - * @since 6 - * @syscap SystemCapability.MiscServices.InputMethodFramework - */ -declare namespace inputMethod { - const MAX_TYPE_NUM: number - - function getInputMethodSetting(): InputMethodSetting; - - function getInputMethodController(): InputMethodController; - - interface InputMethodSetting { - listInputMethod(callback: AsyncCallback>): void; - - listInputMethod(): Promise>; - - displayOptionalInputMethod(callback: AsyncCallback): void; - - displayOptionalInputMethod(): Promise; - } - - interface InputMethodController { - stopInput(callback: AsyncCallback): void; - - stopInput(): Promise; - } - - interface InputMethodProperty { - readonly packageName: string; - readonly methodId: string; - } -} - -export default inputMethod; +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {AsyncCallback} from './basic'; + +/** + * inputmethod + * + * @since 6 + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ +declare namespace inputMethod { + const MAX_TYPE_NUM: number + + function getInputMethodSetting(): InputMethodSetting; + + function getInputMethodController(): InputMethodController; + + interface InputMethodSetting { + listInputMethod(callback: AsyncCallback>): void; + + listInputMethod(): Promise>; + + displayOptionalInputMethod(callback: AsyncCallback): void; + + displayOptionalInputMethod(): Promise; + } + + interface InputMethodController { + stopInput(callback: AsyncCallback): void; + + stopInput(): Promise; + } + + interface InputMethodProperty { + readonly packageName: string; + readonly methodId: string; + } +} + +export default inputMethod; diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputMethodEngine.d.ts similarity index 97% rename from api/@ohos.inputmethodengine.d.ts rename to api/@ohos.inputMethodEngine.d.ts index 332c396c47aef608d08cf72af2d690f25c9a0d08..76894e631b6b4988d23427f6edfc684a995e2a02 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputMethodEngine.d.ts @@ -1,135 +1,135 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {AsyncCallback} from './basic'; - -/** - * inputmethodengine - * - * @since 8 - * @syscap SystemCapability.MiscServices.InputMethodFramework - */ -declare namespace inputMethodEngine { - const ENTER_KEY_TYPE_UNSPECIFIED: number; - const ENTER_KEY_TYPE_GO: number; - const ENTER_KEY_TYPE_SEARCH: number; - const ENTER_KEY_TYPE_SEND: number; - const ENTER_KEY_TYPE_NEXT: number; - const ENTER_KEY_TYPE_DONE: number; - const ENTER_KEY_TYPE_PREVIOUS: number; - - const PATTERN_NULL: number; - const PATTERN_TEXT: number; - const PATTERN_NUMBER: number; - const PATTERN_PHONE: number; - const PATTERN_DATETIME: number; - const PATTERN_EMAIL: number; - const PATTERN_URI: number; - const PATTERN_PASSWORD: number; - - const FLAG_SELECTING: number; - const FLAG_SINGLE_LINE: number; - - const DISPLAY_MODE_PART: number; - const DISPLAY_MODE_FULL: number; - - const OPTION_ASCII: number; - const OPTION_NONE: number; - const OPTION_AUTO_CAP_CHARACTERS: number; - const OPTION_AUTO_CAP_SENTENCES: number; - const OPTION_AUTO_WORDS: number; - const OPTION_MULTI_LINE: number; - const OPTION_NO_FULLSCREEN: number; - - function getInputMethodEngine(): InputMethodEngine; - - function createKeyboardDelegate(): KeyboardDelegate; - - interface KeyboardController { - hideKeyboard(callback: AsyncCallback): void; - - hideKeyboard(): Promise; - } - - interface InputMethodEngine { - on(type: 'inputStart', callback: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; - - off(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; - - on(type: 'keyboardShow'|'keyboardHide', callback: () => void): void; - - off(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void; - } - - interface TextInputClient { - sendKeyFunction(action: number, callback: AsyncCallback): void; - - sendKeyFunction(action: number): Promise; - - deleteForward(length: number, callback: AsyncCallback): void; - - deleteForward(length: number): Promise; - - deleteBackward(length: number, callback: AsyncCallback): void; - - deleteBackward(length: number): Promise; - - insertText(text: string, callback: AsyncCallback): void; - - insertText(text: string): Promise; - - getForward(length: number, callback: AsyncCallback): void; - - getForward(length: number): Promise; - - getBackward(length: number, callback: AsyncCallback): void; - - getBackward(length: number): Promise; - - getEditorAttribute(callback: AsyncCallback): void; - - getEditorAttribute(): Promise; - } - - interface KeyboardDelegate { - on(type: 'keyDown'|'keyUp', callback: (event: KeyEvent) => boolean): void; - - off(type: 'keyDown'|'keyUp', callback?: (event: KeyEvent) => boolean): void; - - on(type: 'cursorContextChange', callback: (x: number, y: number, height: number) => void): void; - - off(type: 'cursorContextChange', callback?: (x: number, y: number, height: number) => void): void; - - on(type: 'selectionChange', callback: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; - - off(type: 'selectionChange', callback?: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; - - on(type: 'textChange', callback: (text: string) => void): void; - - off(type: 'textChange', callback?: (text: string) => void): void; - } - - interface EditorAttribute { - readonly inputPattern: number; - readonly enterKeyType: number; - } - - interface KeyEvent { - readonly keyCode: number; - readonly keyAction: number; - } -} - -export default inputMethodEngine; +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {AsyncCallback} from './basic'; + +/** + * inputmethodengine + * + * @since 8 + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ +declare namespace inputMethodEngine { + const ENTER_KEY_TYPE_UNSPECIFIED: number; + const ENTER_KEY_TYPE_GO: number; + const ENTER_KEY_TYPE_SEARCH: number; + const ENTER_KEY_TYPE_SEND: number; + const ENTER_KEY_TYPE_NEXT: number; + const ENTER_KEY_TYPE_DONE: number; + const ENTER_KEY_TYPE_PREVIOUS: number; + + const PATTERN_NULL: number; + const PATTERN_TEXT: number; + const PATTERN_NUMBER: number; + const PATTERN_PHONE: number; + const PATTERN_DATETIME: number; + const PATTERN_EMAIL: number; + const PATTERN_URI: number; + const PATTERN_PASSWORD: number; + + const FLAG_SELECTING: number; + const FLAG_SINGLE_LINE: number; + + const DISPLAY_MODE_PART: number; + const DISPLAY_MODE_FULL: number; + + const OPTION_ASCII: number; + const OPTION_NONE: number; + const OPTION_AUTO_CAP_CHARACTERS: number; + const OPTION_AUTO_CAP_SENTENCES: number; + const OPTION_AUTO_WORDS: number; + const OPTION_MULTI_LINE: number; + const OPTION_NO_FULLSCREEN: number; + + function getInputMethodEngine(): InputMethodEngine; + + function createKeyboardDelegate(): KeyboardDelegate; + + interface KeyboardController { + hideKeyboard(callback: AsyncCallback): void; + + hideKeyboard(): Promise; + } + + interface InputMethodEngine { + on(type: 'inputStart', callback: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; + + off(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; + + on(type: 'keyboardShow'|'keyboardHide', callback: () => void): void; + + off(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void; + } + + interface TextInputClient { + sendKeyFunction(action: number, callback: AsyncCallback): void; + + sendKeyFunction(action: number): Promise; + + deleteForward(length: number, callback: AsyncCallback): void; + + deleteForward(length: number): Promise; + + deleteBackward(length: number, callback: AsyncCallback): void; + + deleteBackward(length: number): Promise; + + insertText(text: string, callback: AsyncCallback): void; + + insertText(text: string): Promise; + + getForward(length: number, callback: AsyncCallback): void; + + getForward(length: number): Promise; + + getBackward(length: number, callback: AsyncCallback): void; + + getBackward(length: number): Promise; + + getEditorAttribute(callback: AsyncCallback): void; + + getEditorAttribute(): Promise; + } + + interface KeyboardDelegate { + on(type: 'keyDown'|'keyUp', callback: (event: KeyEvent) => boolean): void; + + off(type: 'keyDown'|'keyUp', callback?: (event: KeyEvent) => boolean): void; + + on(type: 'cursorContextChange', callback: (x: number, y: number, height: number) => void): void; + + off(type: 'cursorContextChange', callback?: (x: number, y: number, height: number) => void): void; + + on(type: 'selectionChange', callback: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; + + off(type: 'selectionChange', callback?: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; + + on(type: 'textChange', callback: (text: string) => void): void; + + off(type: 'textChange', callback?: (text: string) => void): void; + } + + interface EditorAttribute { + readonly inputPattern: number; + readonly enterKeyType: number; + } + + interface KeyEvent { + readonly keyCode: number; + readonly keyAction: number; + } +} + +export default inputMethodEngine;