@biso_gmbh/capacitor-plugin-rest-information-from-image
v1.0.1
Published
Gets image based information from a REST api that can be configured. The information returned has to be in json format
Downloads
28
Readme
capacitor-plugin-rest-information-from-image
Gets image based information from a REST api that can be configured. The information returned has to be in json format, and it only does POST calls. The image will be sent as part of the body as a base64 string, the key is configurable. Also part of the body is the image type, currently hardcoded as jpeg, whose key can also be configured.
Install
npm install capacitor-plugin-rest-information-from-image
npx cap sync
API
scan(...)
scan(scanCall: IScanCall) => Promise<Object>
| Param | Type |
| -------------- | ----------------------------------------------- |
| scanCall
| IScanCall |
Returns: Promise<Object>
Interfaces
Object
Provides functionality common to all JavaScript objects.
| Prop | Type | Description |
| ----------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| constructor
| Function | The initial value of Object.prototype.constructor is the standard built-in Object constructor. |
| Method | Signature | Description | | ------------------------ | --------------------------------------------------------- | ------------------------------------------------------------------------ | | toString | () => string | Returns a string representation of an object. | | toLocaleString | () => string | Returns a date converted to a string using the current locale. | | valueOf | () => Object | Returns the primitive value of the specified object. | | hasOwnProperty | (v: PropertyKey) => boolean | Determines whether an object has a property with the specified name. | | isPrototypeOf | (v: Object) => boolean | Determines whether an object exists in another object's prototype chain. | | propertyIsEnumerable | (v: PropertyKey) => boolean | Determines whether a specified property is enumerable. |
Function
Creates a new function.
| Prop | Type |
| --------------- | --------------------------------------------- |
| prototype
| any |
| length
| number |
| arguments
| any |
| caller
| Function |
| Method | Signature | Description | | ------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | apply | (this: Function, thisArg: any, argArray?: any) => any | Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. | | call | (this: Function, thisArg: any, ...argArray: any[]) => any | Calls a method of an object, substituting another object for the current object. | | bind | (this: Function, thisArg: any, ...argArray: any[]) => any | For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters. | | toString | () => string | Returns a string representation of a function. |
IScanCall
The configuration object for the plugin. IRequest is mandatory because it configures needed things like the url, settings can be left empty, which will use the default settings.
| Prop | Type |
| -------------- | ----------------------------------------------- |
| request
| IRequest |
| settings
| ISettings |
IRequest
Data used for the http request. Url, headers and body are required, though both header and body can be an empty object. base64Key and imageTypeKey configure how the image and the image type will be named when they are added to the body.
| Prop | Type |
| ------------------ | --------------------------------------------------------------- |
| url
| string |
| headers
| Record<string, string> |
| body
| Record<string, any> |
| base64Key
| string |
| imageTypeKey
| string |
ISettings
All settings that can be passed to the plugin. The detectorSize
value must be between
0
and 1
, because it determines how many percent of the screen should be covered by
the detector.
If the value is greater than 1 the detector will not be visible on the screen.
| Prop | Type |
| ------------------------------ | -------------------- |
| beepOnSuccess
| boolean |
| vibrateOnSuccess
| boolean |
| detectorSize
| number |
| detectorAspectRatio
| string |
| drawFocusRect
| boolean |
| focusRectColor
| string |
| focusRectBorderRadius
| number |
| focusRectBorderThickness
| number |
| drawFocusLine
| boolean |
| focusLineColor
| string |
| focusLineThickness
| number |
| drawFocusBackground
| boolean |
| focusBackgroundColor
| string |
| loadingCircleColor
| string |
| loadingCircleSize
| number |
Type Aliases
PropertyKey
string | number | symbol
Record
Construct a type with a set of properties K of type T
{ [P in K]: T; }