fix(printer): fix implementation and add pick method

This commit is contained in:
Ibby Hadeed 2017-05-17 07:03:07 -04:00
parent 7d63e808ad
commit 55071c0d65

View File

@ -84,13 +84,22 @@ export class Printer extends IonicNativePlugin {
@Cordova() @Cordova()
isAvailable(): Promise<boolean> { return; } isAvailable(): Promise<boolean> { return; }
/**
* Displays a system interface allowing the user to select an available printer. To speak with a printer directly you need to know the network address by picking them before via `printer.pick`.
*/
@Cordova()
pick(): Promise<any> { return; }
/** /**
* Sends content to the printer. * Sends content to the printer.
* @param content {string | HTMLElement} The content to print. Can be a URL or an HTML string. If a HTML DOM Object is provided, its innerHtml property value will be used. * @param content {string | HTMLElement} The content to print. Can be a URL or an HTML string. If a HTML DOM Object is provided, its innerHtml property value will be used.
* @param options {PrintOptions} optional. The options to pass to the printer * @param options {PrintOptions} optional. The options to pass to the printer
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova({
successIndex: 2,
errorIndex: 4
})
print(content: string | HTMLElement, options?: PrintOptions): Promise<any> { return; } print(content: string | HTMLElement, options?: PrintOptions): Promise<any> { return; }
} }