@vnejs/plugins.platform.android 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import "@vnejs/plugins.platform.android.contract";
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import "@vnejs/plugins.platform.android.contract";
2
+ import { regPlugin } from "@vnejs/shared";
3
+ import { PLUGIN_NAME } from "@vnejs/plugins.platform.android.contract";
4
+ import { Android } from "./modules/android.js";
5
+ regPlugin(PLUGIN_NAME, {}, [Android]);
@@ -0,0 +1,8 @@
1
+ import { Module } from "@vnejs/module";
2
+ import type { AndroidPluginConstants, AndroidPluginEvents, AndroidPluginParams, AndroidPluginSettings } from "../types.js";
3
+ export declare class Android extends Module<AndroidPluginEvents, AndroidPluginConstants, AndroidPluginSettings, AndroidPluginParams> {
4
+ name: string;
5
+ subscribe: () => void;
6
+ onStarted: () => Promise<void>;
7
+ onExit: () => Promise<void>;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { App } from "@capacitor/app";
2
+ import { SplashScreen } from "@capacitor/splash-screen";
3
+ import { Module } from "@vnejs/module";
4
+ export class Android extends Module {
5
+ name = "android";
6
+ subscribe = () => {
7
+ if (this.PARAMS.PLATFORMS.CURRENT_PLATFORM !== this.CONST.PLATFORMS.MOBILE)
8
+ return;
9
+ this.on(this.EVENTS.SYSTEM.STARTED, this.onStarted);
10
+ this.on(this.EVENTS.SYSTEM.CLOSE, this.onExit);
11
+ };
12
+ onStarted = async () => {
13
+ await this.waitRender();
14
+ SplashScreen.hide({ fadeOutDuration: 1000 });
15
+ };
16
+ onExit = () => App.exitApp();
17
+ }
@@ -0,0 +1,7 @@
1
+ import type { VnePluginConstantsMapRegistry, VnePluginEventsMapRegistry, VnePluginParamsMapRegistry, VnePluginSettingsMapRegistry } from "@vnejs/shared";
2
+ import type { Constants as PlatformsConstants, Params as PlatformsParams, PluginName as PlatformsPluginName } from "@vnejs/plugins.core.platforms.contract";
3
+ import type { PluginName as SystemPluginName, SubscribeEvents as SystemSubscribeEvents } from "@vnejs/plugins.core.system.contract";
4
+ export type AndroidPluginEvents = VnePluginEventsMapRegistry & Record<SystemPluginName, SystemSubscribeEvents>;
5
+ export type AndroidPluginConstants = VnePluginConstantsMapRegistry & Record<PlatformsPluginName, PlatformsConstants>;
6
+ export type AndroidPluginSettings = VnePluginSettingsMapRegistry;
7
+ export type AndroidPluginParams = VnePluginParamsMapRegistry & Record<PlatformsPluginName, PlatformsParams>;
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,17 +1,46 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.platform.android",
3
- "version": "0.0.2",
4
- "main": "index.js",
3
+ "version": "0.0.4",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "src",
18
+ "tsconfig.json"
19
+ ],
5
20
  "scripts": {
6
21
  "test": "echo \"Error: no test specified\" && exit 1",
22
+ "build": "npx @vnejs/monorepo package",
7
23
  "publish:major:plugin": "npm run publish:major",
8
24
  "publish:minor:plugin": "npm run publish:minor",
9
25
  "publish:patch:plugin": "npm run publish:patch",
10
- "publish:major": "npm version major && npm publish --access public",
11
- "publish:minor": "npm version minor && npm publish --access public",
12
- "publish:patch": "npm version patch && npm publish --access public"
26
+ "publish:major": "npx @vnejs/monorepo publish major --access public",
27
+ "publish:minor": "npx @vnejs/monorepo publish minor --access public",
28
+ "publish:patch": "npx @vnejs/monorepo publish patch --access public"
13
29
  },
14
30
  "author": "",
15
31
  "license": "ISC",
16
- "description": ""
32
+ "dependencies": {
33
+ "@vnejs/plugins.platform.android.contract": "~0.0.1"
34
+ },
35
+ "peerDependencies": {
36
+ "@capacitor/app": "~5.0.8",
37
+ "@capacitor/splash-screen": "~5.0.8",
38
+ "@vnejs/module": "~0.0.1",
39
+ "@vnejs/plugins.core.platforms.contract": "~0.0.1",
40
+ "@vnejs/plugins.core.system.contract": "~0.0.1",
41
+ "@vnejs/shared": "~0.0.9"
42
+ },
43
+ "devDependencies": {
44
+ "@vnejs/configs.ts-common": "~0.0.1"
45
+ }
17
46
  }
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ import "@vnejs/plugins.platform.android.contract";
2
+
3
+ import { regPlugin } from "@vnejs/shared";
4
+ import { PLUGIN_NAME } from "@vnejs/plugins.platform.android.contract";
5
+
6
+ import { Android } from "./modules/android.js";
7
+
8
+ regPlugin(PLUGIN_NAME, {}, [Android]);
@@ -1,9 +1,10 @@
1
1
  import { App } from "@capacitor/app";
2
2
  import { SplashScreen } from "@capacitor/splash-screen";
3
-
4
3
  import { Module } from "@vnejs/module";
5
4
 
6
- export class Android extends Module {
5
+ import type { AndroidPluginConstants, AndroidPluginEvents, AndroidPluginParams, AndroidPluginSettings } from "../types.js";
6
+
7
+ export class Android extends Module<AndroidPluginEvents, AndroidPluginConstants, AndroidPluginSettings, AndroidPluginParams> {
7
8
  name = "android";
8
9
 
9
10
  subscribe = () => {
package/src/types.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { VnePluginConstantsMapRegistry, VnePluginEventsMapRegistry, VnePluginParamsMapRegistry, VnePluginSettingsMapRegistry } from "@vnejs/shared";
2
+ import type { Constants as PlatformsConstants, Params as PlatformsParams, PluginName as PlatformsPluginName } from "@vnejs/plugins.core.platforms.contract";
3
+ import type { PluginName as SystemPluginName, SubscribeEvents as SystemSubscribeEvents } from "@vnejs/plugins.core.system.contract";
4
+
5
+ export type AndroidPluginEvents = VnePluginEventsMapRegistry & Record<SystemPluginName, SystemSubscribeEvents>;
6
+
7
+ export type AndroidPluginConstants = VnePluginConstantsMapRegistry & Record<PlatformsPluginName, PlatformsConstants>;
8
+
9
+ export type AndroidPluginSettings = VnePluginSettingsMapRegistry;
10
+
11
+ export type AndroidPluginParams = VnePluginParamsMapRegistry & Record<PlatformsPluginName, PlatformsParams>;
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@vnejs/configs.ts-common/tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["dist", "node_modules"]
9
+ }
package/index.js DELETED
@@ -1,5 +0,0 @@
1
- import { regPlugin } from "@vnejs/shared";
2
-
3
- import { Android } from "./modules/android";
4
-
5
- regPlugin("ANDROID", {}, [Android]);