or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

app-component.mdbiometric-auth.mdbluetooth.mddevice-system.mdevents.mdindex.mdlocation-maps.mdmedia-camera.mdnative-integration.mdnavigation.mdnetwork.mdstorage-filesystem.mdui.mdutilities.md
tile.json

tessl/npm-dcloudio--uni-app-plus

A runtime library for uni-app's app-plus platform, which provides mobile app functionality for the uni-app cross-platform framework

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@dcloudio/uni-app-plus@2.0.x

To install, run

npx @tessl/cli install tessl/npm-dcloudio--uni-app-plus@2.0.0

index.mddocs/

@dcloudio/uni-app-plus

@dcloudio/uni-app-plus is a runtime library specifically designed for uni-app's app-plus platform, enabling cross-platform mobile application development using Vue.js syntax. It provides comprehensive APIs for mobile app functionality including native device access, network operations, media handling, and platform-specific features.

Package Information

  • Package Name: @dcloudio/uni-app-plus
  • Package Type: npm
  • Language: JavaScript
  • Installation: npm install @dcloudio/uni-app-plus

Core Imports

import { createApp, createPage, createComponent } from "@dcloudio/uni-app-plus";

For default uni API object:

import uni from "@dcloudio/uni-app-plus";

CommonJS:

const { createApp, createPage, createComponent } = require("@dcloudio/uni-app-plus");
const uni = require("@dcloudio/uni-app-plus").default;

Basic Usage

import { createApp } from "@dcloudio/uni-app-plus";
import uni from "@dcloudio/uni-app-plus";

// Create app instance
const app = createApp({
  onLaunch() {
    console.log('App launched');
  }
});

// Use uni APIs
uni.showToast({
  title: 'Hello World',
  icon: 'success'
});

// Convert upx to pixels
const pixels = uni.upx2px(100);

// Make network request
uni.request({
  url: 'https://api.example.com/data',
  success: (res) => {
    console.log(res.data);
  }
});

Architecture

@dcloudio/uni-app-plus is built around several key components:

  • Application Lifecycle: createApp, createPage, createComponent for Vue.js integration
  • Uni API Object: Comprehensive API surface accessible via the uni object
  • Promise Support: Automatic promisification of async APIs with callback support
  • Interceptors: Global and method-specific API interceptors for customization
  • Native Integration: Direct access to platform-specific native plugins
  • Context Management: Specialized context objects for complex functionality

Capabilities

Application & Component Creation

Core functions for creating uni-app applications and components with Vue.js integration.

function createApp(options: AppOptions): App;
function createPage(options: PageOptions): Page;
function createComponent(options: ComponentOptions): Component;
function createSubpackageApp(vm: VueInstance): VueInstance;
function createPlugin(vm: VueInstance): VueInstance;

Application & Component Management

Network & Communication

Network request capabilities, WebSocket connections, and file transfer operations.

function request(options: RequestOptions): RequestTask;
function uploadFile(options: UploadFileOptions): UploadTask;
function downloadFile(options: DownloadFileOptions): DownloadTask;
function connectSocket(options: ConnectSocketOptions): SocketTask;

Network & Communication APIs

Device & System

Device information, sensors, system capabilities, and hardware integration.

function getSystemInfo(options?: GetSystemInfoOptions): void;
function getSystemInfoSync(): SystemInfo;
function canIUse(schema: string): boolean;
function makePhoneCall(options: MakePhoneCallOptions): void;

Device & System APIs

Storage & File System

Local storage operations and file system management.

function setStorage(options: SetStorageOptions): void;
function setStorageSync(key: string, data: any): void;
function getStorage(options: GetStorageOptions): void;
function getFileSystemManager(): FileSystemManager;

Storage & File System APIs

Media & Camera

Image, video, audio processing and camera integration.

function chooseImage(options?: ChooseImageOptions): void;
function chooseVideo(options?: ChooseVideoOptions): void;
function getRecorderManager(): RecorderManager;
function createVideoContext(videoId: string): VideoContext;

Media & Camera APIs

User Interface

UI components, dialogs, navigation, and visual feedback.

function showToast(options: ShowToastOptions): void;
function showModal(options: ShowModalOptions): void;
function setNavigationBarTitle(options: SetNavigationBarTitleOptions): void;
function createAnimation(options?: CreateAnimationOptions): Animation;

User Interface APIs

Location & Maps

GPS location services and map integration.

function getLocation(options: GetLocationOptions): void;
function chooseLocation(options?: ChooseLocationOptions): void;
function createMapContext(mapId: string): MapContext;

Location & Maps APIs

Event System

Custom event handling and communication between components.

function $on(eventName: string, callback: Function): void;
function $emit(eventName: string, ...args: any[]): void;
function $once(eventName: string, callback: Function): void;
function $off(eventName?: string, callback?: Function): void;

Event System APIs

Native Integration

Direct access to native plugins and platform-specific functionality.

function requireNativePlugin(pluginName: string): object;
function getSubNVueById(id: string): object;
function getCurrentSubNVue(): object;

Native Integration APIs

Utility Functions

Helper functions for common operations and data conversions.

function upx2px(upx: number): number;
function base64ToArrayBuffer(base64: string): ArrayBuffer;
function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
function addInterceptor(method: string, interceptor: object): void;

Utility Functions

Bluetooth & BLE

Comprehensive Bluetooth and Bluetooth Low Energy capabilities for device discovery and data exchange.

function openBluetoothAdapter(options: OpenBluetoothAdapterOptions): void;
function startBluetoothDevicesDiscovery(options: StartBluetoothDevicesDiscoveryOptions): void;
function createBLEConnection(options: CreateBLEConnectionOptions): void;
function readBLECharacteristicValue(options: ReadBLECharacteristicValueOptions): void;

Bluetooth & BLE APIs

Navigation & Routing

Page navigation, route management, and application flow control.

function navigateTo(options: NavigateToOptions): void;
function redirectTo(options: RedirectToOptions): void;
function navigateBack(options?: NavigateBackOptions): void;
function switchTab(options: SwitchTabOptions): void;

Navigation & Routing APIs

Biometric Authentication

Secure biometric authentication using fingerprint, face recognition, and voice authentication.

function checkIsSupportSoterAuthentication(options: CheckIsSupportSoterAuthenticationOptions): void;
function startSoterAuthentication(options: StartSoterAuthenticationOptions): void;
function checkIsSoterEnrolledInDevice(options: CheckIsSoterEnrolledInDeviceOptions): void;

Biometric Authentication APIs

Types

Common Types

interface RequestOptions {
  url: string;
  data?: any;
  header?: object;
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
  dataType?: string;
  responseType?: string;
  success?: (result: RequestResult) => void;
  fail?: (error: any) => void;
  complete?: () => void;
}

interface SystemInfo {
  brand: string;
  model: string;
  system: string;
  platform: string;
  version: string;
  screenWidth: number;
  screenHeight: number;
  windowWidth: number;
  windowHeight: number;
  pixelRatio: number;
}

interface AppOptions {
  onLaunch?: (options: any) => void;
  onShow?: (options: any) => void;
  onHide?: () => void;
  onError?: (error: string) => void;
  onPageNotFound?: (options: any) => void;
  globalData?: any;
}