Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# node files
dist
node_modules

# iOS files
Expand Down
156 changes: 156 additions & 0 deletions dist/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"api": {
"name": "DocumentScannerPlugin",
"slug": "documentscannerplugin",
"docs": "",
"tags": [],
"methods": [
{
"name": "scanDocument",
"signature": "(options?: ScanDocumentOptions | undefined) => Promise<ScanDocumentResponse>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "ScanDocumentOptions | undefined"
}
],
"returns": "Promise<ScanDocumentResponse>",
"tags": [],
"docs": "Opens the camera, and starts the document scan",
"complexTypes": [
"ScanDocumentResponse",
"ScanDocumentOptions"
],
"slug": "scandocument"
}
],
"properties": []
},
"interfaces": [
{
"name": "ScanDocumentResponse",
"slug": "scandocumentresponse",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "scannedImages",
"tags": [],
"docs": "This is an array with either file paths or base64 images for the\r\ndocument scan.",
"complexTypes": [],
"type": "string[] | undefined"
},
{
"name": "status",
"tags": [],
"docs": "The status lets you know if the document scan completes successfully,\r\nor if the user cancels before completing the document scan.",
"complexTypes": [
"ScanDocumentResponseStatus"
],
"type": "ScanDocumentResponseStatus"
}
]
},
{
"name": "ScanDocumentOptions",
"slug": "scandocumentoptions",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "croppedImageQuality",
"tags": [
{
"text": ": 100",
"name": "default"
}
],
"docs": "Android only: The quality of the cropped image from 0 - 100. 100 is the best quality.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "letUserAdjustCrop",
"tags": [
{
"text": ": true",
"name": "default"
}
],
"docs": "Android only: If true then once the user takes a photo, they get to preview the automatically\r\ndetected document corners. They can then move the corners in case there needs to\r\nbe an adjustment. If false then the user can't adjust the corners, and the user\r\ncan only take 1 photo (maxNumDocuments can't be more than 1 in this case).",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "maxNumDocuments",
"tags": [
{
"text": ": 24",
"name": "default"
}
],
"docs": "Android only: The maximum number of photos an user can take (not counting photo retakes)",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "responseType",
"tags": [
{
"text": ": ResponseType.ImageFilePath",
"name": "default"
}
],
"docs": "The response comes back in this format on success. It can be the document\r\nscan image file paths or base64 images.",
"complexTypes": [
"ResponseType"
],
"type": "ResponseType"
}
]
}
],
"enums": [
{
"name": "ScanDocumentResponseStatus",
"slug": "scandocumentresponsestatus",
"members": [
{
"name": "Success",
"value": "'success'",
"tags": [],
"docs": "The status comes back as success if the document scan completes\r\nsuccessfully."
},
{
"name": "Cancel",
"value": "'cancel'",
"tags": [],
"docs": "The status comes back as cancel if the user closes out of the camera\r\nbefore completing the document scan."
}
]
},
{
"name": "ResponseType",
"slug": "responsetype",
"members": [
{
"name": "Base64",
"value": "'base64'",
"tags": [],
"docs": "Use this response type if you want document scan returned as base64 images."
},
{
"name": "ImageFilePath",
"value": "'imageFilePath'",
"tags": [],
"docs": "Use this response type if you want document scan returned as inmage file paths."
}
]
}
],
"typeAliases": [],
"pluginConfigs": []
}
66 changes: 66 additions & 0 deletions dist/esm/definitions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
export interface DocumentScannerPlugin {
/**
* Opens the camera, and starts the document scan
*/
scanDocument(options?: ScanDocumentOptions): Promise<ScanDocumentResponse>;
}
export interface ScanDocumentOptions {
/**
* Android only: The quality of the cropped image from 0 - 100. 100 is the best quality.
* @default: 100
*/
croppedImageQuality?: number;
/**
* Android only: If true then once the user takes a photo, they get to preview the automatically
* detected document corners. They can then move the corners in case there needs to
* be an adjustment. If false then the user can't adjust the corners, and the user
* can only take 1 photo (maxNumDocuments can't be more than 1 in this case).
* @default: true
*/
letUserAdjustCrop?: boolean;
/**
* Android only: The maximum number of photos an user can take (not counting photo retakes)
* @default: 24
*/
maxNumDocuments?: number;
/**
* The response comes back in this format on success. It can be the document
* scan image file paths or base64 images.
* @default: ResponseType.ImageFilePath
*/
responseType?: ResponseType;
}
export declare enum ResponseType {
/**
* Use this response type if you want document scan returned as base64 images.
*/
Base64 = "base64",
/**
* Use this response type if you want document scan returned as inmage file paths.
*/
ImageFilePath = "imageFilePath"
}
export interface ScanDocumentResponse {
/**
* This is an array with either file paths or base64 images for the
* document scan.
*/
scannedImages?: string[];
/**
* The status lets you know if the document scan completes successfully,
* or if the user cancels before completing the document scan.
*/
status?: ScanDocumentResponseStatus;
}
export declare enum ScanDocumentResponseStatus {
/**
* The status comes back as success if the document scan completes
* successfully.
*/
Success = "success",
/**
* The status comes back as cancel if the user closes out of the camera
* before completing the document scan.
*/
Cancel = "cancel"
}
25 changes: 25 additions & 0 deletions dist/esm/definitions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/esm/definitions.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { DocumentScannerPlugin } from './definitions';
declare const DocumentScanner: DocumentScannerPlugin;
export * from './definitions';
export { DocumentScanner };
7 changes: 7 additions & 0 deletions dist/esm/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/esm/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions dist/esm/web.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WebPlugin } from '@capacitor/core';
import type { DocumentScannerPlugin, ScanDocumentOptions, ScanDocumentResponse } from './definitions';
export declare class DocumentScannerWeb extends WebPlugin implements DocumentScannerPlugin {
scanDocument(options?: ScanDocumentOptions): Promise<ScanDocumentResponse>;
}
8 changes: 8 additions & 0 deletions dist/esm/web.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/esm/web.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions dist/plugin.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/plugin.cjs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading