-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(save-dialog): add plugin (#4618)
* smtp-client * fix plugin ref * cloud settings * + save-dialog --------- Co-authored-by: Daniel Sogl <[email protected]>
- Loading branch information
1 parent
6d42ef5
commit 91dd8bd
Showing
5 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Save Dialog | ||
|
||
```text | ||
$ ionic cordova plugin add cordova-plugin-save-dialog | ||
$ npm install @awesome-cordova-plugins/save-dialog | ||
``` | ||
|
||
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/save-dialog/) | ||
|
||
Plugin Repo: [https://github.com/Amphiluke/cordova-plugin-save-dialog](https://github.com/Amphiluke/cordova-plugin-save-dialog) | ||
|
||
This Cordova plugin displays the native Save dialog which allows users to store a file in the selected location. | ||
|
||
## Supported platforms | ||
|
||
* Android | ||
* iOS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Save Dialog | ||
|
||
```text | ||
$ ionic cordova plugin add cordova-plugin-save-dialog | ||
$ npm install @awesome-cordova-plugins/save-dialog | ||
``` | ||
|
||
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/save-dialog/) | ||
|
||
Plugin Repo: [https://github.com/Amphiluke/cordova-plugin-save-dialog](https://github.com/Amphiluke/cordova-plugin-save-dialog) | ||
|
||
This Cordova plugin displays the native Save dialog which allows users to store a file in the selected location. | ||
|
||
## Supported platforms | ||
|
||
* Android | ||
* iOS | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core'; | ||
|
||
/** | ||
* @name SaveDialog | ||
* @description | ||
* Plugin displays the native Save dialog which allows users to store a file in the selected location. | ||
* @usage | ||
* ```typescript | ||
* import { SaveDialog } from '@awesome-cordova-plugins/save-dialog'; | ||
* | ||
* constructor(private saveDialog: SaveDialog) { } | ||
* | ||
* ... | ||
* | ||
* this.saveDialog.saveFile(blob, fileName); | ||
* | ||
* ``` | ||
*/ | ||
@Plugin({ | ||
pluginName: 'SaveDialog', | ||
plugin: 'cordova-plugin-save-dialog', | ||
pluginRef: 'SaveDialog', | ||
repo: 'https://github.com/Amphiluke/cordova-plugin-save-dialog', | ||
platforms: ['Android', 'iOS'], | ||
}) | ||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class SaveDialog extends AwesomeCordovaNativePlugin { | ||
/** | ||
* Creates a PDF using a URL, it download the document into an in memory Webkit object, and renders it into a PDF. | ||
* | ||
* @param url {string} URL to create a PDF from | ||
* @param options {PDFGeneratorOptions} options for PDF generation | ||
* @returns {Promise<string>} | ||
*/ | ||
@Cordova({ otherPromise: true }) | ||
saveFile(blob: Blob, fileName?: string): Promise<string> { | ||
return; | ||
} | ||
} |