From d9263848b8b1c72104f3e3573205258171008b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E8=BF=85?= Date: Tue, 8 Jul 2025 19:54:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A1=86=E6=9E=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E2=E4=B8=AA=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=BC=80?= =?UTF-8?q?=E6=94=BE3=E4=B8=AA=E7=B3=BB=E7=BB=9F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=BA=E5=85=AC=E5=85=B1=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A04=E4=B8=AA=E7=8A=B6=E6=80=81=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 田迅 --- api/@ohos.print.d.ts | 142 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 133 insertions(+), 9 deletions(-) diff --git a/api/@ohos.print.d.ts b/api/@ohos.print.d.ts index bb0acedf50..328e8520cb 100644 --- a/api/@ohos.print.d.ts +++ b/api/@ohos.print.d.ts @@ -1397,6 +1397,14 @@ declare namespace print { */ PRINT_JOB_BLOCK_BAD_CERTIFICATE = 16, + /** + * Print printer driver exception. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ + PRINT_JOB_BLOCK_DRIVER_EXCEPTION = 17, + /** * Print an error occurred when printing the account. * @syscap SystemCapability.Print.PrintFramework @@ -1485,6 +1493,30 @@ declare namespace print { */ PRINT_JOB_BLOCK_FILE_UPLOADING_ERROR = 30, + /** + * Print driver file missing. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ + PRINT_JOB_BLOCK_DRIVER_MISSING = 34, + + /** + * Print job interrupt. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ + PRINT_JOB_BLOCK_INTERRUPT = 35, + + /** + * Print on an unavailable printer. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ + PRINT_JOB_BLOCK_PRINTER_UNAVAILABLE = 98, + /** * Print unknown issue. * @syscap SystemCapability.Print.PrintFramework @@ -1714,32 +1746,56 @@ declare namespace print { * Load the specific printer extension and start to discover printer. * @permission ohos.permission.MANAGE_PRINT_JOB * @param { Array } extensionList - Indicates the list of printer extension. - * empty list of extensionList Indicates to find printer with all installed extension. + * empty list of extensionList Indicates to find printer with all installed extension. * @param { AsyncCallback } callback - The callback function for indcating the result of API execution. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 202 - not system application - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.Print.PrintFramework * @systemapi Hide this for inner system use. * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Load the specific printer extension and start to discover printer. + * @permission ohos.permission.MANAGE_PRINT_JOB or ohos.permission.PRINT + * @param { Array } extensionList - Indicates the list of printer extension. + * empty list of extensionList Indicates to find printer with all installed extension. + * @param { AsyncCallback } callback - The callback function for indcating the result of API execution. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ function startDiscoverPrinter(extensionList: Array, callback: AsyncCallback): void; /** * Load the specific printer extension and start to discover printer. * @permission ohos.permission.MANAGE_PRINT_JOB * @param { Array } extensionList - Indicates the list of printer extension. - * empty list of extensionList Indicates to find printer with all installed extension. + * empty list of extensionList Indicates to find printer with all installed extension. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 202 - not system application - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.Print.PrintFramework * @systemapi Hide this for inner system use. * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Load the specific printer extension and start to discover printer. + * @permission ohos.permission.MANAGE_PRINT_JOB or ohos.permission.PRINT + * @param { Array } extensionList - Indicates the list of printer extension. + * empty list of extensionList Indicates to find printer with all installed extension. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ function startDiscoverPrinter(extensionList: Array): Promise; /** @@ -1753,6 +1809,15 @@ declare namespace print { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Stop discovering the printer with specific printer extension. + * @permission ohos.permission.MANAGE_PRINT_JOB or ohos.permission.PRINT + * @param { AsyncCallback } callback - The callback function for indcating the result of API execution. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ function stopDiscoverPrinter(callback: AsyncCallback): void; /** @@ -1766,6 +1831,15 @@ declare namespace print { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Stop discovering the printer with specific printer extension. + * @permission ohos.permission.MANAGE_PRINT_JOB or ohos.permission.PRINT + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ function stopDiscoverPrinter(): Promise; /** @@ -1775,12 +1849,23 @@ declare namespace print { * @param { AsyncCallback } callback - The callback function for indcating the result of API execution. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 202 - not system application - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.Print.PrintFramework * @systemapi Hide this for inner system use. * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Connect the specific printer. + * @permission ohos.permission.MANAGE_PRINT_JOB or ohos.permission.PRINT + * @param { string } printerId - Indicates id of the printer. + * @param { AsyncCallback } callback - The callback function for indcating the result of API execution. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ function connectPrinter(printerId: string, callback: AsyncCallback): void; /** @@ -1790,12 +1875,23 @@ declare namespace print { * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 202 - not system application - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.Print.PrintFramework * @systemapi Hide this for inner system use. * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ + /** + * Connect the specific printer. + * @permission ohos.permission.MANAGE_PRINT_JOB or ohos.permission.PRINT + * @param { string } printerId - Indicates id of the printer. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @syscap SystemCapability.Print.PrintFramework + * @since 20 + * @arkts 1.1&1.2 + */ function connectPrinter(printerId: string): Promise; /** @@ -1918,6 +2014,20 @@ declare namespace print { */ function cancelPrintJob(jobId: string): Promise; + /** + * Restart the print job has been sent. + * @permission ohos.permission.MANAGE_PRINT_JOB + * @param { string } jobId - Indicates the specific print job. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 202 - not system application + * @syscap SystemCapability.Print.PrintFramework + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.1&1.2 + */ + function restartPrintJob(jobId: string): Promise; + /** * Request preview of the print job. * @permission ohos.permission.MANAGE_PRINT_JOB @@ -2233,9 +2343,9 @@ declare namespace print { * @syscap SystemCapability.Print.PrintFramework * @systemapi Hide this for inner system use. * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 * @deprecated since 11 * @useinstead print#queryPrintJobList + * @arkts 1.1&1.2 */ function queryAllPrintJobs(callback: AsyncCallback): void; @@ -2248,12 +2358,25 @@ declare namespace print { * @syscap SystemCapability.Print.PrintFramework * @systemapi Hide this for inner system use. * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 * @deprecated since 11 * @useinstead print#queryPrintJobList + * @arkts 1.1&1.2 */ function queryAllPrintJobs(): Promise; + /** + * Get all active printJobs in the queue. + * @permission ohos.permission.MANAGE_PRINT_JOB + * @returns { Promise } Returns a list of all active print jobs. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 202 - not system application + * @syscap SystemCapability.Print.PrintFramework + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.1&1.2 + */ + function queryAllActivePrintJobs(): Promise; + /** * Get all the printJobs in the queue. * @permission ohos.permission.MANAGE_PRINT_JOB @@ -2378,7 +2501,8 @@ declare namespace print { * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 202 - not system application - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.Print.PrintFramework * @systemapi Hide this for inner system use. * @since arkts {'1.1':'12','1.2':'20'} -- Gitee