From a50f49ad3a4ca0a0371c70143721d79de0ae982c Mon Sep 17 00:00:00 2001 From: "@chuangda_1" Date: Mon, 27 Feb 2023 10:25:30 +0800 Subject: [PATCH 1/6] add print.dts and printExtension.dts 0227 Signed-off-by: @chuangda_1 --- api/@ohos.PrintExtensionAbility.d.ts | 139 ++++++++ api/@ohos.print.d.ts | 476 +++++++++++++++++++++++++++ 2 files changed, 615 insertions(+) create mode 100644 api/@ohos.PrintExtensionAbility.d.ts create mode 100644 api/@ohos.print.d.ts diff --git a/api/@ohos.PrintExtensionAbility.d.ts b/api/@ohos.PrintExtensionAbility.d.ts new file mode 100644 index 0000000000..028be95463 --- /dev/null +++ b/api/@ohos.PrintExtensionAbility.d.ts @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * class of print extensionAbility. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @StageModelOnly + */ +import Want from './@ohos.application.Want'; +import print from "./@ohos.print"; + + +export default class PrintExtensionAbility { + + /** + * Called once to initialize the extensionAbility. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onCreate(want: Want): void; + + /** + * Called once to start to discover the printers connected with the device. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onStartDiscoverPrinter(): void; + + /** + * Called once to stop discovering the printer. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onStopDiscoverPrinter(): void; + + /** + * Called once to connect to the specific printer. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onConnectPrinter(printerId: number): void; + + /** + * Called once to disconnect the specific printer. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onDisconnectPrinter(printerId: number): void; + + /** + * Called once to start print job. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onStartPrintJob(jobInfo: print.PrintJob): void; + + /** + * Called once to remove the print job has been started. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onCancelPrintJob(jobInfo: print.PrintJob): void; + + /** + * Called once to request the capability of the printer. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onRequestPrinterCapability(printerId: number): print.PrinterCapability; + + /** + * Called once to request preview and send result to Print SA. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onRequestPreview(jobInfo: print.PrintJob): string; + + /** + * Called once to finalize the extensionAbility. + * + * @systemapi Hide this for inner system use. + * @since 9 + * @syscap SystemCapability.Print.PrintFramework + * @return - + * @StageModelOnly + */ + onDestroy(): void; +} \ No newline at end of file diff --git a/api/@ohos.print.d.ts b/api/@ohos.print.d.ts new file mode 100644 index 0000000000..e5b113ad5b --- /dev/null +++ b/api/@ohos.print.d.ts @@ -0,0 +1,476 @@ +/* + * Copyright (c) 2022 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'; + +/** + * System print + * @syscap SystemCapability.Print.PrintFramework + * @import import print from '@ohos.app.print'; + * @since 9 + */ +declare namespace print { + + interface PrintTask { + /** + * Register event callback when the current print task is in process. + * @since 9 + * @param type blocked Indicates the print task has been blocked. + * type success Indicates the print task succeed. + * type failed Indicates the print task has completed with failure. + * type cancelled Indicates the print task has been cancelled. + * @param callback The callback function for print task change event + * @permission {@code ohos.permission.PRINT} + * @return - + */ + on(type: 'blocked' | 'success' | 'failed' | 'cancelled', callback: () => void): void; + + /** + * Unregister event callback when the current print task is in process. + * @since 9 + * @param type block Indicates the print task has been blocked. + * type success Indicates the print task succeed. + * type fail Indicates the print task has completed with failure. + * type cancel Indicates the print task has been cancelled. + * @param callback The callback function for print task change event + * @permission {@code ohos.permission.PRINT} + * @return - + */ + off(type: 'blocked' | 'success' | 'failed' | 'cancelled', callback?: (boolean) => void): void; + } + + /** + * Start new print task for App. + * @since 9 + * @param files Indicates the filepath list to be printed. Only pdf and picture filetype are supported. + * @param callback The callback function for print task. + * @permission {@code ohos.permission.PRINT} + * @return - + */ + function print(files: Array, callback: AsyncCallback): void; + function print(files: Array): Promise; + + interface PrintMargin { + top?: number; // top margin + bottom?: number; // bottom margin + left?: number; // left side margin + right?: number; // right side margin + } + + interface PrinterRange { + startPage?: number; // start page of sequence + endPage?: number; // end page of sequence + pages?: Array; // discrete page of sequence + } + + interface PreviewAttribute { + previewRange: PrinterRange; // preview page range + result?: number; // preview file + } + + interface PrintResolution { + id: string; // resolution id + horizontalDpi: number // horizontal DPI + verticalDpi: number; // vertical DPI + } + + interface PrintPageSize { + id: string; // page size id + name: string; // page size name + width: number; // unit: millimeter + height: number; // unit: millimeter + } + + interface PrinterCapability { + /* Printer Capability */ + colorMode: number; // color mode + duplexMode: number; // duplex mode + pageSize: Array; // the page size list supported by the printer + resolution?: Array; // the resolution list supported by the printer + minMargin?: PrintMargin; // min margin of printer + } + + interface PrinterInfo { + printerId: string; // printer id + printerName: string; // printer name + printerState: PrinterState; // current printer state + printerIcon?: number; // resource id of printer icon + description?: string; // printer description + capability?: PrinterCapability; // printer capability + option?:string; // json object string + } + + interface PrintJob { + fdList: Array; // document fd list to be printed + jobId: string; // job id + printerId: string; // printer id to take charge of printing + jobState: PrintJobState; // current print job state + copyNumber: number; // copies of document list + pageRange: PrinterRange; // range size to be printed + isSequential: boolean; // sequential print + pageSize: PrintPageSize; // the selected page size + isLandscape: boolean; // vertical printing + colorMode: number; // color mode + duplexMode: number; // duplex mode + margin?: PrintMargin; // current margin setting + preview?: PreviewAttribute; // preview setting + option?:string; // json object string + } + + enum PrinterState { + PRINTER_ADDED = 0, // new printers arrival + PRINTER_REMOVED = 1, // printers lost + PRINTER_UPDATE_CAP = 2, // printers update + PRINTER_CONNECTED = 3, // printer has been connected + PRINTER_DISCONNECTED = 4, // printer has been disconnected + PRINTER_RUNNING = 5, // printer is working + } + + enum PrintJobState { + PRINT_JOB_PREPARE = 0, // initial state of print job + PRINT_JOB_QUEUED = 1, // deliver print job to the printer + PRINT_JOB_RUNNING = 2, // executing print job + PRINT_JOB_BLOCKED = 3, // print job has been blocked + PRINT_JOB_COMPLETED = 4, // print job cmpleted + } + + enum PrintJobSubState { + PRINT_JOB_COMPLETED_SUCCESS = 0, // print job succeed + PRINT_JOB_COMPLETED_FAILED = 1, // print job fail + PRINT_JOB_COMPLETED_CANCELLED = 2, // print job has been cancelled + PRINT_JOB_COMPLETED_FILE_CORRUPT = 3, // print job has been corrupted + PRINT_JOB_BLOCK_OFFLINE = 4, // printer is offline + PRINT_JOB_BLOCK_BUSY = 5, // printer is occupied by other process + PRINT_JOB_BLOCK_CANCELLED = 6, // print job has been cancelled + PRINT_JOB_BLOCK_OUT_OF_PAPER = 7, // out of paper + PRINT_JOB_BLOCK_OUT_OF_INK = 8, // out of ink + PRINT_JOB_BLOCK_OUT_OF_TONER = 9, // out of toner + PRINT_JOB_BLOCK_JAMMED = 10, // paper jam + PRINT_JOB_BLOCK_DOOR_OPEN = 11, // cover open + PRINT_JOB_BLOCK_SERVICE_REQUEST = 12, // service request + PRINT_JOB_BLOCK_LOW_ON_INK = 13, // low on ink + PRINT_JOB_BLOCK_LOW_ON_TONER = 14, // low on toner + PRINT_JOB_BLOCK_REALLY_LOW_ON_INK = 15, // really low on ink + PRINT_JOB_BLOCK_BAD_CERTIFICATE = 16, // bad certification + PRINT_JOB_BLOCK_UNKNOWN = 17, // unknown issue + } + + enum PrintErrorCode { + E_PRINT_NONE = 0, // no error + E_PRINT_NO_PERMISSION = 201, // no permission + E_PRINT_INVALID_PARAMETER = 401, // invalid parameter + E_PRINT_GENERIC_FAILURE = 13100001, // generic failure of print + E_PRINT_RPC_FAILURE = 13100002, // RPC failure + E_PRINT_SERVER_FAILURE = 13100003, // failure of print service + E_PRINT_INVALID_EXTENSION = 13100004, // invalid print extension + E_PRINT_INVALID_PRINTER = 13100005, // invalid printer + E_PRINT_INVALID_PRINTJOB = 13100006, // invalid print job + E_PRINT_FILE_IO = 13100007, // file i/o error + } + + interface PrinterExtensionInfo { + extensionId: string; // extension id of printer extension + vendorId: string; // vendor id of extension + vendorName: string; // vendor name + vendorIcon: number; // resource id of vendor + version: string; // version of current printer extension + } + + /** + * Get all printer extension installed. + * + * @since 9 + * @param callback The callback function for handling the extension list found. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function queryAllPrinterExtensionInfos(callback: AsyncCallback>): void; + function queryAllPrinterExtensionInfos(): Promise>; + + /** + * Load the specific printer extension and start to discover printer. + * + * @since 9 + * @param extensionList Indicates the list of printer extension. + * empty list of extensionList Indicates to find printer with all installed extension. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function startDiscoverPrinter(extensionList: Array, callback: AsyncCallback): void; + function startDiscoverPrinter(extensionList: Array): Promise; + + /** + * Stop discovering the printer with specific printer extension. + * + * @since 9 + * @param extensionList Indicates the list of printer extension. + * empty list of extensionList Indicates to find printer with all installed extension. + * @param callback The callback function for indcating the result of API execution. + * @permission {@ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function stopDiscoverPrinter(callback: AsyncCallback): void; + function stopDiscoverPrinter(): Promise; + + /** + * Connect the specific printer. + * + * @since 9 + * @param printerId Indicates id of the printer. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function connectPrinter(printerId: string, callback: AsyncCallback): void; + function connectPrinter(printerId: string): Promise; + + /** + * Disconnect the specific printer. + * + * @since 9 + * @param printerId Indicates id of the printer. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function disconnectPrinter(printerId: string, callback: AsyncCallback): void; + function disconnectPrinter(printerId: string): Promise; + + /** + * Query capability for the specific printer. + * + * @since 9 + * @param printerId Indicates id of the printer. + * @param callback The callback function for capability from printer. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function queryPrinterCapability(printerId: string, callback: AsyncCallback): void; + function queryPrinterCapability(printerId: string): Promise + + /** + * Start print job. + * + * @since 9 + * @param jobInfo Indicates the information of print job. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function startPrintJob(jobInfo: PrintJob, callback: AsyncCallback): void; + function startPrintJob(jobInfo: PrintJob): Promise; + + /** + * Cancel the print job has been sent to printer. + * + * @since 9 + * @param jobId Indicates the specific print job. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function cancelPrintJob(jobId: string, callback: AsyncCallback): void; + function cancelPrintJob(jobId: string): Promise; + + /** + * Request preview of the print job. + * + * @since 9 + * @param jobInfo Indicates the information of print job. + * @param callback The callback function for preview result from printer. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function requestPrintPreview(jobInfo: PrintJob, callback: (result: number) => void): void; + function requestPrintPreview(jobInfo: PrintJob): Promise; + + /** + * Register event callback for the state change of printer. + * + * @since 9 + * @param printerStateChange Indicates state change of printer. + * @param callback The callback function for state change of printer. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function on(type: 'printerStateChange', callback: (state: PrinterState, info: PrinterInfo) => void): void; + + /** + * Unregister event callback for the state change of printer. + * + * @since 9 + * @param printerStateChange Indicates state change of printer. + * @param callback The callback function for state change of printer. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function off(type: 'printerStateChange', callback?: (boolean) => void): void; + + /** + * Register event callback for the state change of print job. + * + * @since 9 + * @param jobStateChange Indicates state change of print job. + * @param callback The callback function for state change of print job. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function on(type: 'jobStateChange', callback: (state: PrintJobState, job: PrintJob) => void): void; + + /** + * Unregister event callback for the state change of print job. + * + * @since 9 + * @param printerStateChange Indicates state change of print job. + * @param callback The callback function for state change of print job. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function off(type: 'jobStateChange', callback?: (boolean) => void): void; + + /** + * Register event callback for the information change of print extension. + * + * @since 9 + * @param extInfoChange Indicates information change of print extension. + * @param callback The callback function for information change of print extension. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function on(type: 'extInfoChange', callback: (extensionId: string, info: string) => void): void; + + /** + * Unregister event callback for the information change of print extension. + * + * @since 9 + * @param extInfoChange Indicates information change of print extension. + * @param callback The callback function for information change of print extension. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function off(type: 'extInfoChange', callback?: (boolean) => void): void; + + /** + * New printers have been found and notify Print SA. + * + * @since 9 + * @param printers Indicates new arrived printer lists. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function addPrinters(printers: Array, callback: AsyncCallback): void; + function addPrinters(printers: Array): Promise; + + /** + * Printers have been lost and notify Print SA. + * + * @since 9 + * + * @param printerIds Indicates the lost printer lists. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function removePrinters(printerIds: Array, callback: AsyncCallback): void; + function removePrinters(printerIds: Array): Promise; + + /** + * Update the information of the specific printers + * + * @since 9 + * @param printers Indicates to be updated printer lists. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function updatePrinters(printers: Array, callback: AsyncCallback): void; + function updatePrinters(printers: Array): Promise; + + /** + * Notify Print SA the state of printer has been changed. + * + * @since 9 + * @param printerId Indicates id of the printer. + * @param state Indicates new state of printer. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function updatePrinterState(printerId: string, state: PrinterState, callback: AsyncCallback): void; + function updatePrinterState(printerId: string, state: PrinterState): Promise; + + /** + * Notify Print SA the state of print job has been changed. + * + * @since 9 + * @param jobId Indicates id of the print job. + * @param state Indicates new state of print job. + * @param subState Indicates sub state of print job. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState, callback: AsyncCallback): void; + function updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState): Promise; + + /** + * Notify Print SA the state of print extension has been changed. + * + * @since 9 + * @param info Indicates changed information of print extension. + * @param callback The callback function for indcating the result of API execution. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + function updateExtensionInfo(info: string, callback: AsyncCallback): void; + function updateExtensionInfo(info: string): Promise; + + /** + * Get all the printJobs in the queue. + * + * @since 9 + * @param callback The callback function for handling the printJob list found. + * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @systemapi Hide this for inner system use. + * @return - + */ + + function queryAllPrintJobs(callback: AsyncCallback): void; + function queryAllPrintJobs(): Promise +} + +export default print; \ No newline at end of file -- Gitee From b04613541b1f695456a9ebc9a0b8af444faa263b Mon Sep 17 00:00:00 2001 From: "@chuangda_1" Date: Mon, 27 Feb 2023 10:28:46 +0800 Subject: [PATCH 2/6] modify since 9 to since 10 --0227 Signed-off-by: @chuangda_1 --- api/@ohos.PrintExtensionAbility.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/api/@ohos.PrintExtensionAbility.d.ts b/api/@ohos.PrintExtensionAbility.d.ts index 028be95463..49a49ce86b 100644 --- a/api/@ohos.PrintExtensionAbility.d.ts +++ b/api/@ohos.PrintExtensionAbility.d.ts @@ -17,7 +17,7 @@ * class of print extensionAbility. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @StageModelOnly */ @@ -31,7 +31,7 @@ export default class PrintExtensionAbility { * Called once to initialize the extensionAbility. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -42,7 +42,7 @@ export default class PrintExtensionAbility { * Called once to start to discover the printers connected with the device. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -53,7 +53,7 @@ export default class PrintExtensionAbility { * Called once to stop discovering the printer. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -64,7 +64,7 @@ export default class PrintExtensionAbility { * Called once to connect to the specific printer. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -75,7 +75,7 @@ export default class PrintExtensionAbility { * Called once to disconnect the specific printer. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -86,7 +86,7 @@ export default class PrintExtensionAbility { * Called once to start print job. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -97,7 +97,7 @@ export default class PrintExtensionAbility { * Called once to remove the print job has been started. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -108,7 +108,7 @@ export default class PrintExtensionAbility { * Called once to request the capability of the printer. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -119,7 +119,7 @@ export default class PrintExtensionAbility { * Called once to request preview and send result to Print SA. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly @@ -130,7 +130,7 @@ export default class PrintExtensionAbility { * Called once to finalize the extensionAbility. * * @systemapi Hide this for inner system use. - * @since 9 + * @since 10 * @syscap SystemCapability.Print.PrintFramework * @return - * @StageModelOnly -- Gitee From b7be9fcb3bf0d303913fdb5ef3515038439d6f11 Mon Sep 17 00:00:00 2001 From: "@chuangda_1" Date: Mon, 27 Feb 2023 11:22:29 +0800 Subject: [PATCH 3/6] modify sdk format --0227 Signed-off-by: @chuangda_1 --- api/@ohos.PrintExtensionAbility.d.ts | 10 --- api/@ohos.print.d.ts | 125 +++++++++++---------------- 2 files changed, 50 insertions(+), 85 deletions(-) diff --git a/api/@ohos.PrintExtensionAbility.d.ts b/api/@ohos.PrintExtensionAbility.d.ts index 49a49ce86b..a5bf7499f3 100644 --- a/api/@ohos.PrintExtensionAbility.d.ts +++ b/api/@ohos.PrintExtensionAbility.d.ts @@ -33,7 +33,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onCreate(want: Want): void; @@ -44,7 +43,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onStartDiscoverPrinter(): void; @@ -55,7 +53,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onStopDiscoverPrinter(): void; @@ -66,7 +63,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onConnectPrinter(printerId: number): void; @@ -77,7 +73,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onDisconnectPrinter(printerId: number): void; @@ -88,7 +83,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onStartPrintJob(jobInfo: print.PrintJob): void; @@ -99,7 +93,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onCancelPrintJob(jobInfo: print.PrintJob): void; @@ -110,7 +103,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onRequestPrinterCapability(printerId: number): print.PrinterCapability; @@ -121,7 +113,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onRequestPreview(jobInfo: print.PrintJob): string; @@ -132,7 +123,6 @@ export default class PrintExtensionAbility { * @systemapi Hide this for inner system use. * @since 10 * @syscap SystemCapability.Print.PrintFramework - * @return - * @StageModelOnly */ onDestroy(): void; diff --git a/api/@ohos.print.d.ts b/api/@ohos.print.d.ts index e5b113ad5b..4d51db0b7f 100644 --- a/api/@ohos.print.d.ts +++ b/api/@ohos.print.d.ts @@ -18,45 +18,42 @@ import {AsyncCallback} from './basic'; * System print * @syscap SystemCapability.Print.PrintFramework * @import import print from '@ohos.app.print'; - * @since 9 + * @since 10 */ declare namespace print { interface PrintTask { /** * Register event callback when the current print task is in process. - * @since 9 + * @since 10 * @param type blocked Indicates the print task has been blocked. * type success Indicates the print task succeed. * type failed Indicates the print task has completed with failure. * type cancelled Indicates the print task has been cancelled. * @param callback The callback function for print task change event - * @permission {@code ohos.permission.PRINT} - * @return - + * @permission ohos.permission.PRINT */ on(type: 'blocked' | 'success' | 'failed' | 'cancelled', callback: () => void): void; /** * Unregister event callback when the current print task is in process. - * @since 9 + * @since 10 * @param type block Indicates the print task has been blocked. * type success Indicates the print task succeed. * type fail Indicates the print task has completed with failure. * type cancel Indicates the print task has been cancelled. * @param callback The callback function for print task change event - * @permission {@code ohos.permission.PRINT} - * @return - + * @permission ohos.permission.PRINT */ off(type: 'blocked' | 'success' | 'failed' | 'cancelled', callback?: (boolean) => void): void; } /** * Start new print task for App. - * @since 9 + * @since 10 * @param files Indicates the filepath list to be printed. Only pdf and picture filetype are supported. * @param callback The callback function for print task. - * @permission {@code ohos.permission.PRINT} - * @return - + * @permission ohos.permission.PRINT */ function print(files: Array, callback: AsyncCallback): void; function print(files: Array): Promise; @@ -190,11 +187,10 @@ declare namespace print { /** * Get all printer extension installed. * - * @since 9 + * @since 10 * @param callback The callback function for handling the extension list found. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function queryAllPrinterExtensionInfos(callback: AsyncCallback>): void; function queryAllPrinterExtensionInfos(): Promise>; @@ -202,13 +198,12 @@ declare namespace print { /** * Load the specific printer extension and start to discover printer. * - * @since 9 + * @since 10 * @param extensionList Indicates the list of printer extension. * empty list of extensionList Indicates to find printer with all installed extension. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function startDiscoverPrinter(extensionList: Array, callback: AsyncCallback): void; function startDiscoverPrinter(extensionList: Array): Promise; @@ -216,13 +211,12 @@ declare namespace print { /** * Stop discovering the printer with specific printer extension. * - * @since 9 + * @since 10 * @param extensionList Indicates the list of printer extension. * empty list of extensionList Indicates to find printer with all installed extension. * @param callback The callback function for indcating the result of API execution. * @permission {@ohos.permission.MANAGE_PRINT_JOB} * @systemapi Hide this for inner system use. - * @return - */ function stopDiscoverPrinter(callback: AsyncCallback): void; function stopDiscoverPrinter(): Promise; @@ -230,12 +224,11 @@ declare namespace print { /** * Connect the specific printer. * - * @since 9 + * @since 10 * @param printerId Indicates id of the printer. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function connectPrinter(printerId: string, callback: AsyncCallback): void; function connectPrinter(printerId: string): Promise; @@ -243,12 +236,11 @@ declare namespace print { /** * Disconnect the specific printer. * - * @since 9 + * @since 10 * @param printerId Indicates id of the printer. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function disconnectPrinter(printerId: string, callback: AsyncCallback): void; function disconnectPrinter(printerId: string): Promise; @@ -256,12 +248,11 @@ declare namespace print { /** * Query capability for the specific printer. * - * @since 9 + * @since 10 * @param printerId Indicates id of the printer. * @param callback The callback function for capability from printer. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function queryPrinterCapability(printerId: string, callback: AsyncCallback): void; function queryPrinterCapability(printerId: string): Promise @@ -269,12 +260,11 @@ declare namespace print { /** * Start print job. * - * @since 9 + * @since 10 * @param jobInfo Indicates the information of print job. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function startPrintJob(jobInfo: PrintJob, callback: AsyncCallback): void; function startPrintJob(jobInfo: PrintJob): Promise; @@ -282,12 +272,11 @@ declare namespace print { /** * Cancel the print job has been sent to printer. * - * @since 9 + * @since 10 * @param jobId Indicates the specific print job. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function cancelPrintJob(jobId: string, callback: AsyncCallback): void; function cancelPrintJob(jobId: string): Promise; @@ -295,12 +284,11 @@ declare namespace print { /** * Request preview of the print job. * - * @since 9 + * @since 10 * @param jobInfo Indicates the information of print job. * @param callback The callback function for preview result from printer. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function requestPrintPreview(jobInfo: PrintJob, callback: (result: number) => void): void; function requestPrintPreview(jobInfo: PrintJob): Promise; @@ -308,84 +296,77 @@ declare namespace print { /** * Register event callback for the state change of printer. * - * @since 9 + * @since 10 * @param printerStateChange Indicates state change of printer. * @param callback The callback function for state change of printer. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function on(type: 'printerStateChange', callback: (state: PrinterState, info: PrinterInfo) => void): void; /** * Unregister event callback for the state change of printer. * - * @since 9 + * @since 10 * @param printerStateChange Indicates state change of printer. * @param callback The callback function for state change of printer. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function off(type: 'printerStateChange', callback?: (boolean) => void): void; /** * Register event callback for the state change of print job. * - * @since 9 + * @since 10 * @param jobStateChange Indicates state change of print job. * @param callback The callback function for state change of print job. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function on(type: 'jobStateChange', callback: (state: PrintJobState, job: PrintJob) => void): void; /** * Unregister event callback for the state change of print job. * - * @since 9 + * @since 10 * @param printerStateChange Indicates state change of print job. * @param callback The callback function for state change of print job. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function off(type: 'jobStateChange', callback?: (boolean) => void): void; /** * Register event callback for the information change of print extension. * - * @since 9 + * @since 10 * @param extInfoChange Indicates information change of print extension. * @param callback The callback function for information change of print extension. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function on(type: 'extInfoChange', callback: (extensionId: string, info: string) => void): void; /** * Unregister event callback for the information change of print extension. * - * @since 9 + * @since 10 * @param extInfoChange Indicates information change of print extension. * @param callback The callback function for information change of print extension. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function off(type: 'extInfoChange', callback?: (boolean) => void): void; /** * New printers have been found and notify Print SA. * - * @since 9 + * @since 10 * @param printers Indicates new arrived printer lists. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function addPrinters(printers: Array, callback: AsyncCallback): void; function addPrinters(printers: Array): Promise; @@ -393,13 +374,12 @@ declare namespace print { /** * Printers have been lost and notify Print SA. * - * @since 9 + * @since 10 * * @param printerIds Indicates the lost printer lists. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function removePrinters(printerIds: Array, callback: AsyncCallback): void; function removePrinters(printerIds: Array): Promise; @@ -407,12 +387,11 @@ declare namespace print { /** * Update the information of the specific printers * - * @since 9 + * @since 10 * @param printers Indicates to be updated printer lists. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function updatePrinters(printers: Array, callback: AsyncCallback): void; function updatePrinters(printers: Array): Promise; @@ -420,13 +399,12 @@ declare namespace print { /** * Notify Print SA the state of printer has been changed. * - * @since 9 + * @since 10 * @param printerId Indicates id of the printer. * @param state Indicates new state of printer. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function updatePrinterState(printerId: string, state: PrinterState, callback: AsyncCallback): void; function updatePrinterState(printerId: string, state: PrinterState): Promise; @@ -434,14 +412,13 @@ declare namespace print { /** * Notify Print SA the state of print job has been changed. * - * @since 9 + * @since 10 * @param jobId Indicates id of the print job. * @param state Indicates new state of print job. * @param subState Indicates sub state of print job. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState, callback: AsyncCallback): void; function updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState): Promise; @@ -449,12 +426,11 @@ declare namespace print { /** * Notify Print SA the state of print extension has been changed. * - * @since 9 + * @since 10 * @param info Indicates changed information of print extension. * @param callback The callback function for indcating the result of API execution. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function updateExtensionInfo(info: string, callback: AsyncCallback): void; function updateExtensionInfo(info: string): Promise; @@ -462,11 +438,10 @@ declare namespace print { /** * Get all the printJobs in the queue. * - * @since 9 + * @since 10 * @param callback The callback function for handling the printJob list found. - * @permission {@code ohos.permission.MANAGE_PRINT_JOB} + * @permission MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. - * @return - */ function queryAllPrintJobs(callback: AsyncCallback): void; -- Gitee From 9d202f92f0352e63f32fb5ef6a72c9797ad6442f Mon Sep 17 00:00:00 2001 From: "@chuangda_1" Date: Mon, 27 Feb 2023 12:56:48 +0800 Subject: [PATCH 4/6] modify sdk format --0227_1 Signed-off-by: @chuangda_1 --- api/@ohos.print.d.ts | 47 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/api/@ohos.print.d.ts b/api/@ohos.print.d.ts index 4d51db0b7f..1f20368779 100644 --- a/api/@ohos.print.d.ts +++ b/api/@ohos.print.d.ts @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import {AsyncCallback} from './basic'; /** @@ -139,7 +140,7 @@ declare namespace print { PRINT_JOB_QUEUED = 1, // deliver print job to the printer PRINT_JOB_RUNNING = 2, // executing print job PRINT_JOB_BLOCKED = 3, // print job has been blocked - PRINT_JOB_COMPLETED = 4, // print job cmpleted + PRINT_JOB_COMPLETED = 4, // print job completed } enum PrintJobSubState { @@ -189,7 +190,7 @@ declare namespace print { * * @since 10 * @param callback The callback function for handling the extension list found. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function queryAllPrinterExtensionInfos(callback: AsyncCallback>): void; @@ -202,7 +203,7 @@ declare namespace print { * @param extensionList Indicates the list of printer extension. * empty list of extensionList Indicates to find printer with all installed extension. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function startDiscoverPrinter(extensionList: Array, callback: AsyncCallback): void; @@ -215,7 +216,7 @@ declare namespace print { * @param extensionList Indicates the list of printer extension. * empty list of extensionList Indicates to find printer with all installed extension. * @param callback The callback function for indcating the result of API execution. - * @permission {@ohos.permission.MANAGE_PRINT_JOB} + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function stopDiscoverPrinter(callback: AsyncCallback): void; @@ -227,7 +228,7 @@ declare namespace print { * @since 10 * @param printerId Indicates id of the printer. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function connectPrinter(printerId: string, callback: AsyncCallback): void; @@ -239,7 +240,7 @@ declare namespace print { * @since 10 * @param printerId Indicates id of the printer. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function disconnectPrinter(printerId: string, callback: AsyncCallback): void; @@ -251,7 +252,7 @@ declare namespace print { * @since 10 * @param printerId Indicates id of the printer. * @param callback The callback function for capability from printer. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function queryPrinterCapability(printerId: string, callback: AsyncCallback): void; @@ -263,7 +264,7 @@ declare namespace print { * @since 10 * @param jobInfo Indicates the information of print job. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function startPrintJob(jobInfo: PrintJob, callback: AsyncCallback): void; @@ -275,7 +276,7 @@ declare namespace print { * @since 10 * @param jobId Indicates the specific print job. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function cancelPrintJob(jobId: string, callback: AsyncCallback): void; @@ -287,7 +288,7 @@ declare namespace print { * @since 10 * @param jobInfo Indicates the information of print job. * @param callback The callback function for preview result from printer. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function requestPrintPreview(jobInfo: PrintJob, callback: (result: number) => void): void; @@ -299,7 +300,7 @@ declare namespace print { * @since 10 * @param printerStateChange Indicates state change of printer. * @param callback The callback function for state change of printer. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function on(type: 'printerStateChange', callback: (state: PrinterState, info: PrinterInfo) => void): void; @@ -310,7 +311,7 @@ declare namespace print { * @since 10 * @param printerStateChange Indicates state change of printer. * @param callback The callback function for state change of printer. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function off(type: 'printerStateChange', callback?: (boolean) => void): void; @@ -321,7 +322,7 @@ declare namespace print { * @since 10 * @param jobStateChange Indicates state change of print job. * @param callback The callback function for state change of print job. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function on(type: 'jobStateChange', callback: (state: PrintJobState, job: PrintJob) => void): void; @@ -332,7 +333,7 @@ declare namespace print { * @since 10 * @param printerStateChange Indicates state change of print job. * @param callback The callback function for state change of print job. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function off(type: 'jobStateChange', callback?: (boolean) => void): void; @@ -343,7 +344,7 @@ declare namespace print { * @since 10 * @param extInfoChange Indicates information change of print extension. * @param callback The callback function for information change of print extension. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function on(type: 'extInfoChange', callback: (extensionId: string, info: string) => void): void; @@ -354,7 +355,7 @@ declare namespace print { * @since 10 * @param extInfoChange Indicates information change of print extension. * @param callback The callback function for information change of print extension. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function off(type: 'extInfoChange', callback?: (boolean) => void): void; @@ -365,7 +366,7 @@ declare namespace print { * @since 10 * @param printers Indicates new arrived printer lists. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function addPrinters(printers: Array, callback: AsyncCallback): void; @@ -378,7 +379,7 @@ declare namespace print { * * @param printerIds Indicates the lost printer lists. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function removePrinters(printerIds: Array, callback: AsyncCallback): void; @@ -390,7 +391,7 @@ declare namespace print { * @since 10 * @param printers Indicates to be updated printer lists. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function updatePrinters(printers: Array, callback: AsyncCallback): void; @@ -403,7 +404,7 @@ declare namespace print { * @param printerId Indicates id of the printer. * @param state Indicates new state of printer. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function updatePrinterState(printerId: string, state: PrinterState, callback: AsyncCallback): void; @@ -417,7 +418,7 @@ declare namespace print { * @param state Indicates new state of print job. * @param subState Indicates sub state of print job. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState, callback: AsyncCallback): void; @@ -429,7 +430,7 @@ declare namespace print { * @since 10 * @param info Indicates changed information of print extension. * @param callback The callback function for indcating the result of API execution. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ function updateExtensionInfo(info: string, callback: AsyncCallback): void; @@ -440,7 +441,7 @@ declare namespace print { * * @since 10 * @param callback The callback function for handling the printJob list found. - * @permission MANAGE_PRINT_JOB + * @permission ohos.permission.MANAGE_PRINT_JOB * @systemapi Hide this for inner system use. */ -- Gitee From 8e07c35e6b31b95ddf59aa2261550f9a70ae2dee Mon Sep 17 00:00:00 2001 From: "@chuangda_1" Date: Mon, 27 Feb 2023 14:05:06 +0800 Subject: [PATCH 5/6] modify sdk format --0227_2 Signed-off-by: @chuangda_1 --- api/@ohos.print.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.print.d.ts b/api/@ohos.print.d.ts index 1f20368779..b5b05c7518 100644 --- a/api/@ohos.print.d.ts +++ b/api/@ohos.print.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from './basic'; +import { AsyncCallback } from './basic'; /** * System print -- Gitee From 9968ce3990f264370cf15ee797b42a60e2069b87 Mon Sep 17 00:00:00 2001 From: "@chuangda_1" Date: Thu, 9 Mar 2023 19:27:50 +0800 Subject: [PATCH 6/6] modify print spelling Signed-off-by: @chuangda_1 --- api/@ohos.print.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.print.d.ts b/api/@ohos.print.d.ts index b5b05c7518..5285e78e6f 100644 --- a/api/@ohos.print.d.ts +++ b/api/@ohos.print.d.ts @@ -173,7 +173,7 @@ declare namespace print { E_PRINT_SERVER_FAILURE = 13100003, // failure of print service E_PRINT_INVALID_EXTENSION = 13100004, // invalid print extension E_PRINT_INVALID_PRINTER = 13100005, // invalid printer - E_PRINT_INVALID_PRINTJOB = 13100006, // invalid print job + E_PRINT_INVALID_PRINT_JOB = 13100006, // invalid print job E_PRINT_FILE_IO = 13100007, // file i/o error } -- Gitee