Socket
Socket
Sign inDemoInstall

capacitor-android-shortcuts

Package Overview
Dependencies
2
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

android/src/main/java/nepheus/capacitor/androidshortcuts/ShortcutIcon.java

16

dist/docs.json

@@ -30,3 +30,3 @@ {

"name": "addDynamic",
"signature": "(options: { items: { id: string; shortLabel: string; longLabel: string; iconBitmap: string; data: string; }[]; }) => any",
"signature": "(options: { items: ShortcutItem[]; }) => any",
"parameters": [

@@ -47,3 +47,5 @@ {

"docs": "Created dynamic shortcuts",
"complexTypes": [],
"complexTypes": [
"ShortcutItem"
],
"slug": "adddynamic"

@@ -53,3 +55,3 @@ },

"name": "addPinned",
"signature": "(options: { id: string; shortLabel: string; longLabel: string; iconBitmap: string; data: string; }) => any",
"signature": "(options: ShortcutItem) => any",
"parameters": [

@@ -59,3 +61,3 @@ {

"docs": "An option object for the pinned shortcut",
"type": "{ id: string; shortLabel: string; longLabel: string; iconBitmap: string; data: string; }"
"type": "{ id: string; shortLabel: string; longLabel: string; icon?: { type: AvailableIconTypes; name: string; } | undefined; data: string; }"
}

@@ -71,3 +73,5 @@ ],

"docs": "Created a pinned shortcut",
"complexTypes": [],
"complexTypes": [
"ShortcutItem"
],
"slug": "addpinned"

@@ -87,3 +91,3 @@ },

"docs": "",
"type": "(response: any) => void"
"type": "(response: { data: string; }) => void"
}

@@ -90,0 +94,0 @@ ],

@@ -1,2 +0,40 @@

import { PluginListenerHandle } from '@capacitor/core';
import type { PluginListenerHandle } from '@capacitor/core';
export declare type AvailableIconTypes = "Bitmap" | "Resource";
export declare type ShortcutItem = {
/**
* ID of the shortcut
*/
id: string;
/**
* Sets the short title of a shortcut.
* This is a mandatory field when publishing a new shortcut with ShortcutManager.addDynamicShortcuts(List) or ShortcutManager.setDynamicShortcuts(List).
* This field is intended to be a concise description of a shortcut.
* The recommended maximum length is 10 characters.
*/
shortLabel: string;
/**
* Sets the text of a shortcut.
* This field is intended to be more descriptive than the shortcut title. The launcher shows this instead of the short title when it has enough space.
* The recommend maximum length is 25 characters.
*/
longLabel: string;
/**
* Defines the icon of the shortcut.
* You can set the icon as a BASE64-Bitmap or as a Resource name
*/
icon?: {
/**
* Type of the icon
*/
type: AvailableIconTypes;
/**
* Name of te Resource or data of the encoded Bitmap
*/
name: string;
};
/**
* Data you will receive when the shortcut is opened
*/
data: string;
};
export interface AndroidShortcutsPlugin {

@@ -20,9 +58,3 @@ /**

addDynamic(options: {
items: {
id: string;
shortLabel: string;
longLabel: string;
iconBitmap: string;
data: string;
}[];
items: ShortcutItem[];
}): Promise<void>;

@@ -33,9 +65,3 @@ /**

*/
addPinned(options: {
id: string;
shortLabel: string;
longLabel: string;
iconBitmap: string;
data: string;
}): Promise<void>;
addPinned(options: ShortcutItem): Promise<void>;
/**

@@ -48,2 +74,4 @@ * Add a listener to a shortcut tap event

}
export declare type MessageListener = (response: any) => void;
export declare type MessageListener = (response: {
data: string;
}) => void;
import { WebPlugin } from '@capacitor/core';
import { MessageListener, AndroidShortcutsPlugin } from './definitions';
import { ShortcutItem, MessageListener, AndroidShortcutsPlugin } from './definitions';
export declare class AndroidShortcutsWeb extends WebPlugin implements AndroidShortcutsPlugin {

@@ -11,18 +11,6 @@ isDynamicSupported(): Promise<{

addDynamic(options: {
items: {
id: string;
shortLabel: string;
longLabel: string;
iconBitmap: string;
data: string;
}[];
items: ShortcutItem[];
}): Promise<void>;
addPinned(options: {
id: string;
shortLabel: string;
longLabel: string;
iconBitmap: string;
data: string;
}): Promise<void>;
addPinned(options: ShortcutItem): Promise<void>;
addListener(eventName: 'shortcut', listenerFunc: MessageListener): any;
}

@@ -18,3 +18,3 @@ import { WebPlugin } from '@capacitor/core';

addListener(eventName, listenerFunc) {
listenerFunc(null);
listenerFunc({ data: "" });
return Promise.reject(`Listener for '${eventName}' not implemented.`);

@@ -21,0 +21,0 @@ }

@@ -27,3 +27,3 @@ 'use strict';

addListener(eventName, listenerFunc) {
listenerFunc(null);
listenerFunc({ data: "" });
return Promise.reject(`Listener for '${eventName}' not implemented.`);

@@ -30,0 +30,0 @@ }

@@ -24,3 +24,3 @@ var capacitorAndroidShortcuts = (function (exports, core) {

addListener(eventName, listenerFunc) {
listenerFunc(null);
listenerFunc({ data: "" });
return Promise.reject(`Listener for '${eventName}' not implemented.`);

@@ -27,0 +27,0 @@ }

{
"name": "capacitor-android-shortcuts",
"version": "1.0.1",
"version": "1.0.2",
"description": "Add shortcuts in Android",

@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js",

@@ -47,3 +47,6 @@ [![npm version](https://badge.fury.io/js/capacitor-android-shortcuts.svg)](https://badge.fury.io/js/capacitor-android-shortcuts)

longLabel: "My first long label",
iconBitmap: "BASE64DATA",
icon: {
type: "Bitmap",
name: "<base64-string>"
},
data: "I am a simple string",

@@ -55,3 +58,6 @@ },

longLabel: "My first long label",
iconBitmap: "BASE64DATA",
icon: {
type: "Resource",
name: "<vector-asset-name>"
},
data: JSON.stringify({

@@ -74,3 +80,6 @@ myProperty: "Pass a stringified JSON object",

longLabel: "My pinned long label",
iconBitmap: "BASE64DATA",
icon: {
type: "Bitmap",
name: "<base64-string>"
},
data: "I am a simple string",

@@ -125,3 +134,3 @@ });

```typescript
addDynamic(options: { items: { id: string; shortLabel: string; longLabel: string; iconBitmap: string; data: string; }[]; }) => any
addDynamic(options: { items: ShortcutItem[]; }) => any
```

@@ -143,3 +152,3 @@

```typescript
addPinned(options: { id: string; shortLabel: string; longLabel: string; iconBitmap: string; data: string; }) => any
addPinned(options: ShortcutItem) => any
```

@@ -149,5 +158,5 @@

| Param | Type | Description |
| ------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| **`options`** | <code>{ id: string; shortLabel: string; longLabel: string; iconBitmap: string; data: string; }</code> | An option object for the pinned shortcut |
| Param | Type | Description |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| **`options`** | <code>{ id: string; shortLabel: string; longLabel: string; icon?: { type: AvailableIconTypes; name: string; }; data: string; }</code> | An option object for the pinned shortcut |

@@ -167,6 +176,6 @@ **Returns:** <code>any</code>

| Param | Type |
| ------------------ | --------------------------------------- |
| **`eventName`** | <code>"shortcut"</code> |
| **`listenerFunc`** | <code>(response: any) =&gt; void</code> |
| Param | Type |
| ------------------ | ----------------------------------------------------- |
| **`eventName`** | <code>"shortcut"</code> |
| **`listenerFunc`** | <code>(response: { data: string; }) =&gt; void</code> |

@@ -173,0 +182,0 @@ **Returns:** <code>any</code>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc