!13770 更新打印API13相关接口

Merge pull request !13770 from 郑志豪/master
This commit is contained in:
openharmony_ci 2024-09-30 07:27:31 +00:00 committed by Gitee
commit a52a318479
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 42 additions and 48 deletions

View File

@ -26,55 +26,50 @@ import type print from './@ohos.print';
*
* @syscap SystemCapability.Print.PrintFramework
* @stagemodelonly
* @since 12
* @since 13
*/
export default class PrintExtensionAbility {
/**
* Called once to initialize the extensionAbility.
* @param { Want } want - call print page want params.
* @throws { BusinessError } 202 - not system application
* @syscap SystemCapability.Print.PrintFramework
* @stagemodelonly
* @since 12
* @since 13
*/
onCreate(want: Want): void;
/**
* Called once to start to discover the printers connected with the device.
* @throws { BusinessError } 202 - not system application
* @syscap SystemCapability.Print.PrintFramework
* @stagemodelonly
* @since 12
* @since 13
*/
onStartDiscoverPrinter(): void;
/**
* Called once to stop discovering the printer.
* @throws { BusinessError } 202 - not system application
* @syscap SystemCapability.Print.PrintFramework
* @stagemodelonly
* @since 12
* @since 13
*/
onStopDiscoverPrinter(): void;
/**
* Called once to connect to the specific printer.
* @param { number } printerId - connect the printerId.
* @throws { BusinessError } 202 - not system application
* @syscap SystemCapability.Print.PrintFramework
* @stagemodelonly
* @since 12
* @since 13
*/
onConnectPrinter(printerId: number): void;
/**
* Called once to disconnect to the specific printer.
* @param { number } printerId - connect the printerId.
* @throws { BusinessError } 202 - not system application
* @syscap SystemCapability.Print.PrintFramework
* @stagemodelonly
* @since 12
* @since 13
*/
onDisconnectPrinter(printerId: number): void;
@ -126,10 +121,9 @@ export default class PrintExtensionAbility {
/**
* Called once to finalize the extensionAbility.
* @throws { BusinessError } 202 - not system application
* @syscap SystemCapability.Print.PrintFramework
* @stagemodelonly
* @since 12
* @since 13
*/
onDestroy(): void;
}

70
api/@ohos.print.d.ts vendored
View File

@ -2226,7 +2226,7 @@ declare namespace print {
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
function addPrinterToDiscovery(printerInformation: PrinterInformation): Promise<void>;
@ -2238,7 +2238,7 @@ declare namespace print {
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
function updatePrinterInDiscovery(printerInformation: PrinterInformation): Promise<void>;
@ -2250,7 +2250,7 @@ declare namespace print {
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
function removePrinterFromDiscovery(printerId: string): Promise<void>;
@ -2262,7 +2262,7 @@ declare namespace print {
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
function getPrinterInformationById(printerId: string): Promise<PrinterInformation>;
@ -2270,14 +2270,14 @@ declare namespace print {
* defines printer information.
* @typedef PrinterInformation
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
interface PrinterInformation {
/**
* Printer id.
* @type { string }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
printerId: string;
@ -2285,7 +2285,7 @@ declare namespace print {
* Printer name.
* @type { string }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
printerName: string;
@ -2293,7 +2293,7 @@ declare namespace print {
* Current printer status.
* @type { PrinterStatus }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
printerStatus: PrinterStatus;
@ -2301,7 +2301,7 @@ declare namespace print {
* Printer description.
* @type { ?string }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
description?: string;
@ -2309,7 +2309,7 @@ declare namespace print {
* Printer capabilities.
* @type { ?PrinterCapabilities }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
capability?: PrinterCapabilities;
@ -2317,7 +2317,7 @@ declare namespace print {
* Printer uri.
* @type { ?string }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
uri?: string;
@ -2325,7 +2325,7 @@ declare namespace print {
* Printer make.
* @type { ?string }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
printerMake?: string;
@ -2333,7 +2333,7 @@ declare namespace print {
* Detail information in json format.
* @type { ?string }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
options?: string;
}
@ -2342,14 +2342,14 @@ declare namespace print {
* defines printer capabilities.
* @typedef PrinterCapabilities
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
interface PrinterCapabilities {
/**
* The page size list supported by the printer.
* @type { Array<PrintPageSize> }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
supportedPageSizes: Array<PrintPageSize>;
@ -2357,7 +2357,7 @@ declare namespace print {
* Array of supported color mode.
* @type { Array<PrintColorMode> }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
supportedColorModes: Array<PrintColorMode>;
@ -2365,7 +2365,7 @@ declare namespace print {
* Array of supported duplex mode.
* @type { Array<PrintDuplexMode> }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
supportedDuplexModes: Array<PrintDuplexMode>;
@ -2373,7 +2373,7 @@ declare namespace print {
* Array of supported print media types.
* @type { ?Array<string> }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
supportedMediaTypes?: Array<string>;
@ -2381,7 +2381,7 @@ declare namespace print {
* Array of supported print quality.
* @type { ?Array<PrintQuality> }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
supportedQualities?: Array<PrintQuality>;
@ -2389,7 +2389,7 @@ declare namespace print {
* Array of supported print orientation.
* @type { ?Array<PrintOrientationMode> }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
supportedOrientations?: Array<PrintOrientationMode>;
@ -2397,7 +2397,7 @@ declare namespace print {
* Advanced capability in json format.
* @type { ?string }
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
options?: string;
}
@ -2406,27 +2406,27 @@ declare namespace print {
* Enumeration of Print Quality.
* @enum { number } PrintQuality
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
enum PrintQuality {
/**
* Draft quality mode.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
QUALITY_DRAFT = 3,
/**
* Normal quality mode.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
QUALITY_NORMAL = 4,
/**
* High quality mode.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
QUALITY_HIGH = 5,
}
@ -2435,41 +2435,41 @@ declare namespace print {
* Enumeration of Print OrientationMode.
* @enum { number } PrintOrientationMode
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
enum PrintOrientationMode {
/**
* Portrait mode.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
ORIENTATION_MODE_PORTRAIT = 0,
/**
* Landscape mode.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
ORIENTATION_MODE_LANDSCAPE= 1,
/**
* Reverse landscape mode.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
ORIENTATION_MODE_REVERSE_LANDSCAPE = 2,
/**
* Reverse portrait mode.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
ORIENTATION_MODE_REVERSE_PORTRAIT = 3,
/**
* Not specified.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
ORIENTATION_MODE_NONE = 4,
}
@ -2478,27 +2478,27 @@ declare namespace print {
* Enumeration of Printer Status.
* @enum { number } PrinterStatus
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
enum PrinterStatus {
/**
* Printer idle.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
PRINTER_IDLE = 0,
/**
* Printer busy.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
PRINTER_BUSY = 1,
/**
* Printer not available.
* @syscap SystemCapability.Print.PrintFramework
* @since 12
* @since 13
*/
PRINTER_UNAVAILABLE = 2,
}