Skip to content

Commit

Permalink
fix: add missing definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed May 4, 2022
1 parent 0165217 commit 4127f0f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Do not password encrypt this file, or it will fail to unpack.
* [`download(...)`](#download)
* [`set(...)`](#set)
* [`getId()`](#getid)
* [`getPluginVersion()`](#getpluginversion)
* [`delete(...)`](#delete)
* [`list()`](#list)
* [`reset(...)`](#reset)
Expand Down Expand Up @@ -185,6 +186,19 @@ Get unique ID used to identify device into auto update server
--------------------


### getPluginVersion()

```typescript
getPluginVersion() => Promise<{ version: string; }>
```

Get plugin version used in native code

**Returns:** <code>Promise&lt;{ version: string; }&gt;</code>

--------------------


### delete(...)

```typescript
Expand Down
5 changes: 5 additions & 0 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export interface CapacitorUpdaterPlugin {
*/
getId(): Promise<{ id: string }>;
/**
* Get plugin version used in native code
* @returns {Promise<{ id: string }>} an Promise with version for this device
*/
getPluginVersion(): Promise<{ version: string }>;
/**
* Delete version in storage
* @returns {Promise<void>} an empty Promise when the version is delete, otherwise throw an error
* @param version The version name to delete
Expand Down
4 changes: 4 additions & 0 deletions src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export class CapacitorUpdaterWeb
console.log('Cannot get ID in web');
return { id: 'default'};
}
async getPluginVersion(): Promise<{ version: string }> {
console.log('Cannot get version in web');
return { version: 'default'};
}
async delete(options: { version: string }): Promise<void> {
console.log('Cannot delete version in web', options);
}
Expand Down

0 comments on commit 4127f0f

Please sign in to comment.