mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-23 07:10:52 +00:00
print.d.ts更新 Signed-off-by:baozewei@huawei.com
Signed-off-by: 18903078203 <baozewei@huawei.com>
This commit is contained in:
parent
9e93c5f482
commit
39e0771560
173
api/@ohos.print.d.ts
vendored
173
api/@ohos.print.d.ts
vendored
@ -14,12 +14,14 @@
|
||||
*/
|
||||
|
||||
import type { AsyncCallback, Callback } from './@ohos.base';
|
||||
import type Context from './application/Context';
|
||||
|
||||
/**
|
||||
* System print
|
||||
*
|
||||
* @namespace print
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @import import print from '@ohos.app.print';
|
||||
* @since 10
|
||||
*/
|
||||
declare namespace print {
|
||||
@ -142,6 +144,30 @@ declare namespace print {
|
||||
*/
|
||||
function print(files: Array<string>): Promise<PrintTask>;
|
||||
|
||||
/**
|
||||
* Start new print task for App.
|
||||
* @permission ohos.permission.PRINT
|
||||
* @param { Array<string> } files - Indicates the filepath list to be printed. Only pdf and picture filetype are supported.
|
||||
* @param { Context } context - The ability context that initiates the call print request.
|
||||
* @param { AsyncCallback<PrintTask> } callback - The callback function for print task.
|
||||
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @since 10
|
||||
*/
|
||||
function print(files: Array<string>, context: Context, callback: AsyncCallback<PrintTask>): void;
|
||||
|
||||
/**
|
||||
* Start new print task for App.
|
||||
* @permission ohos.permission.PRINT
|
||||
* @param { Array<string> } files - Indicates the filepath list to be printed. Only pdf and picture filetype are supported.
|
||||
* @param { Context } context - The ability context that initiates the call print request.
|
||||
* @returns { Promise<PrintTask> } the promise returned by the function.
|
||||
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @since 10
|
||||
*/
|
||||
function print(files: Array<string>, context: Context): Promise<PrintTask>;
|
||||
|
||||
/**
|
||||
* defines print margin.
|
||||
* @typedef PrintMargin
|
||||
@ -383,6 +409,15 @@ declare namespace print {
|
||||
* @since 10
|
||||
*/
|
||||
minMargin?: PrintMargin;
|
||||
|
||||
/**
|
||||
* JSON object string.
|
||||
* @type { ?string }
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
option?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -622,7 +657,7 @@ declare namespace print {
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINTER_CAPABILITY_UPDATED = 2,
|
||||
PRINTER_UPDATE_CAP = 2,
|
||||
|
||||
/**
|
||||
* Printer has been connected.
|
||||
@ -736,7 +771,7 @@ declare namespace print {
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_COMPLETED_FILE_CORRUPTED = 3,
|
||||
PRINT_JOB_COMPLETED_FILE_CORRUPT = 3,
|
||||
|
||||
/**
|
||||
* Print is offline.
|
||||
@ -842,6 +877,86 @@ declare namespace print {
|
||||
*/
|
||||
PRINT_JOB_BLOCK_BAD_CERTIFICATE = 16,
|
||||
|
||||
/**
|
||||
* Print an error occurred when printing the account.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_ACCOUNT_ERROR = 18,
|
||||
|
||||
/**
|
||||
* Print the printing permission is abnormal.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_PRINT_PERMISSION_ERROR = 19,
|
||||
|
||||
/**
|
||||
* Print color printing permission exception.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_PRINT_COLOR_PERMISSION_ERROR = 20,
|
||||
|
||||
/**
|
||||
* Print the device is not connected to the network.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_NETWORK_ERROR = 21,
|
||||
|
||||
/**
|
||||
* Print unable to connect to the server.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_CONNECT_SERVER_ERROR = 22,
|
||||
|
||||
/**
|
||||
* Print large file exception.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_LARGE_FILE_ERROR = 23,
|
||||
|
||||
/**
|
||||
* Print file parsing exception.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_PARSE_FILE_ERROR = 24,
|
||||
|
||||
/**
|
||||
* Print the file conversion is too slow.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_BLOCK_FILE_CONVERT_SLOWLY = 25,
|
||||
|
||||
/**
|
||||
* Print uploading file.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_RUNNING_UPLOADING_FILES = 26,
|
||||
|
||||
/**
|
||||
* Print converting files.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
PRINT_JOB_RUNNING_CONVERTING_FILES = 27,
|
||||
|
||||
/**
|
||||
* Print unknown issue.
|
||||
* @syscap SystemCapability.Print.PrintFramework
|
||||
@ -929,7 +1044,7 @@ declare namespace print {
|
||||
* @systemapi
|
||||
* @since 10
|
||||
*/
|
||||
E_PRINT_INVALID_PRINT_JOB = 13100006,
|
||||
E_PRINT_INVALID_PRINTJOB = 13100006,
|
||||
|
||||
/**
|
||||
* File i/o error.
|
||||
@ -1484,6 +1599,58 @@ declare namespace print {
|
||||
* @since 10
|
||||
*/
|
||||
function queryAllPrintJobs(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Get printJob by jobId.
|
||||
* @permission ohos.permission.MANAGE_PRINT_JOB
|
||||
* @param { string } jobId - Indicates id of the print job.
|
||||
* @param { AsyncCallback<PrintJob> } callback - The callback function for get printJob by jobId.
|
||||
* @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 10
|
||||
*/
|
||||
function queryPrintJobById(jobId: string, callback: AsyncCallback<PrintJob>): void;
|
||||
|
||||
/**
|
||||
* Get printJob by jobId.
|
||||
* @permission ohos.permission.MANAGE_PRINT_JOB
|
||||
* @param { string } jobId - Indicates id of the print job.
|
||||
* @returns { Promise<PrintJob> } 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 10
|
||||
*/
|
||||
function queryPrintJobById(jobId: string): Promise<PrintJob>;
|
||||
|
||||
/**
|
||||
* Query printerCapability by printerUri.
|
||||
* @permission ohos.permission.MANAGE_PRINT_JOB
|
||||
* @param { string } printerUri - Indicates uri of the printer.
|
||||
* @param { AsyncCallback<PrinterCapability> } callback - The callback function for query printerCapability by printerUri.
|
||||
* @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 10
|
||||
*/
|
||||
function queryPrinterCapabilityByUri(printerUri: string, callback: AsyncCallback<PrinterCapability>): void;
|
||||
|
||||
/**
|
||||
* Query printerCapability by printerUri.
|
||||
* @permission ohos.permission.MANAGE_PRINT_JOB
|
||||
* @param { string } printerUri - Indicates uri of the printer.
|
||||
* @returns { Promise<PrinterCapability> } 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 10
|
||||
*/
|
||||
function queryPrinterCapabilityByUri(printerUri: string): Promise<PrinterCapability>;
|
||||
}
|
||||
|
||||
export default print;
|
Loading…
Reference in New Issue
Block a user