The main uni object provides unified access to QQ mini-program APIs with consistent interface across platforms, automatic Promise handling, and comprehensive API coverage.
The unified API object that proxies all QQ mini-program native APIs with consistent interface.
/**
* Main unified API object providing access to all QQ mini-program APIs
* Auto-promisifies async APIs and provides consistent error handling
*/
declare const uni: UniInstance;
interface UniInstance {
// All QQ mini-program APIs are available through uni object
[key: string]: any;
}Page navigation and routing functionality.
/**
* Navigate to a new page
* @param options - Navigation options
* @returns Promise resolving when navigation completes
*/
uni.navigateTo(options: NavigateToOptions): Promise<NavigateResult>;
/**
* Redirect to a new page (replaces current page)
* @param options - Redirect options
* @returns Promise resolving when redirect completes
*/
uni.redirectTo(options: RedirectToOptions): Promise<any>;
/**
* Switch to a tab page
* @param options - Tab switch options
* @returns Promise resolving when switch completes
*/
uni.switchTab(options: SwitchTabOptions): Promise<any>;
/**
* Navigate back to previous page
* @param options - Navigation back options
* @returns Promise resolving when navigation completes
*/
uni.navigateBack(options?: NavigateBackOptions): Promise<any>;
/**
* Reroute to a page (with conditional navigation logic)
* @param options - Reroute options
* @returns Promise resolving when reroute completes
*/
uni.reLaunch(options: ReLaunchOptions): Promise<any>;
interface NavigateToOptions {
/** Target page path */
url: string;
/** Event channel for page communication */
events?: Record<string, Function>;
/** Success callback */
success?: (res: NavigateResult) => void;
/** Failure callback */
fail?: (res: any) => void;
/** Completion callback */
complete?: (res: any) => void;
}
interface NavigateResult {
/** Event channel for communication */
eventChannel: EventChannel;
}
interface RedirectToOptions {
/** Target page path */
url: string;
/** Conditional navigation: 'back' for back navigation */
exists?: 'back';
/** Delta for back navigation when exists='back' */
delta?: number;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface SwitchTabOptions {
/** Tab page path */
url: string;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface NavigateBackOptions {
/** Number of pages to go back */
delta?: number;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface ReLaunchOptions {
/** Target page path */
url: string;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}Usage Examples:
// Navigate to new page with event communication
const result = await uni.navigateTo({
url: '/pages/detail/detail?id=123',
events: {
// Listen for events from target page
pageDataUpdated: (data) => {
console.log('Received data from detail page:', data);
}
}
});
// Use event channel for communication
result.eventChannel.emit('sendDataToDetail', {
userInfo: getCurrentUserInfo()
});
// Conditional redirect with back navigation fallback
await uni.redirectTo({
url: '/pages/profile/profile',
exists: 'back', // Try to go back to existing profile page
delta: 2 // Go back 2 pages if exists
});
// Switch to tab page
await uni.switchTab({
url: '/pages/home/home'
});User interface and interaction APIs.
/**
* Show toast notification
* @param options - Toast options
* @returns Promise resolving when toast is shown
*/
uni.showToast(options: ShowToastOptions): Promise<any>;
/**
* Show modal dialog
* @param options - Modal options
* @returns Promise resolving with user action
*/
uni.showModal(options: ShowModalOptions): Promise<ShowModalResult>;
/**
* Show action sheet
* @param options - Action sheet options
* @returns Promise resolving with selected index
*/
uni.showActionSheet(options: ShowActionSheetOptions): Promise<ShowActionSheetResult>;
/**
* Show loading indicator
* @param options - Loading options
* @returns Promise resolving when loading is shown
*/
uni.showLoading(options: ShowLoadingOptions): Promise<any>;
/**
* Hide loading indicator
* @returns Promise resolving when loading is hidden
*/
uni.hideLoading(): Promise<any>;
/**
* Show navigation bar loading
* @returns Promise resolving when loading is shown
*/
uni.showNavigationBarLoading(): Promise<any>;
/**
* Hide navigation bar loading
* @returns Promise resolving when loading is hidden
*/
uni.hideNavigationBarLoading(): Promise<any>;
interface ShowToastOptions {
/** Toast message */
title: string;
/** Toast icon */
icon?: 'success' | 'loading' | 'none';
/** Custom icon image */
image?: string;
/** Display duration in milliseconds */
duration?: number;
/** Show mask to prevent touch */
mask?: boolean;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface ShowModalOptions {
/** Modal title */
title?: string;
/** Modal content */
content?: string;
/** Show cancel button */
showCancel?: boolean;
/** Cancel button text */
cancelText?: string;
/** Cancel button color */
cancelColor?: string;
/** Confirm button text */
confirmText?: string;
/** Confirm button color */
confirmColor?: string;
success?: (res: ShowModalResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface ShowModalResult {
/** Whether confirm was tapped */
confirm: boolean;
/** Whether cancel was tapped */
cancel: boolean;
}
interface ShowActionSheetOptions {
/** Action item texts */
itemList: string[];
/** Item text color */
itemColor?: string;
success?: (res: ShowActionSheetResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface ShowActionSheetResult {
/** Selected item index */
tapIndex: number;
}
interface ShowLoadingOptions {
/** Loading message */
title?: string;
/** Show mask to prevent touch */
mask?: boolean;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}Usage Examples:
// Show success toast
await uni.showToast({
title: 'Success!',
icon: 'success',
duration: 2000
});
// Show confirmation modal
const modalResult = await uni.showModal({
title: 'Confirm Delete',
content: 'Are you sure you want to delete this item?',
confirmText: 'Delete',
confirmColor: '#ff4757'
});
if (modalResult.confirm) {
// User confirmed deletion
await deleteItem();
}
// Show action sheet
const actionResult = await uni.showActionSheet({
itemList: ['Camera', 'Photo Album', 'Cancel'],
itemColor: '#007aff'
});
switch (actionResult.tapIndex) {
case 0: // Camera
await takePhoto();
break;
case 1: // Photo Album
await chooseFromAlbum();
break;
}System information and device capabilities.
/**
* Get system information
* @returns Promise resolving with system info
*/
uni.getSystemInfo(): Promise<SystemInfo>;
/**
* Get system information synchronously
* @returns System information object
*/
uni.getSystemInfoSync(): SystemInfo;
/**
* Get network type
* @returns Promise resolving with network info
*/
uni.getNetworkType(): Promise<NetworkTypeResult>;
/**
* Get battery info
* @returns Promise resolving with battery info
*/
uni.getBatteryInfo(): Promise<BatteryInfo>;
interface SystemInfo {
/** Device brand */
brand: string;
/** Device model */
model: string;
/** Device pixel ratio */
pixelRatio: number;
/** Screen width in pixels */
screenWidth: number;
/** Screen height in pixels */
screenHeight: number;
/** Window width in pixels */
windowWidth: number;
/** Window height in pixels */
windowHeight: number;
/** Status bar height in pixels */
statusBarHeight: number;
/** System language */
language: string;
/** QQ version */
version: string;
/** Operating system version */
system: string;
/** Platform: ios, android */
platform: string;
/** Font size setting */
fontSizeSetting: number;
/** QQ SDK version */
SDKVersion: string;
/** Device unique identifier */
deviceId?: string;
/** Safe area coordinates */
safeArea?: SafeArea;
/** Safe area insets */
safeAreaInsets?: SafeAreaInsets;
}
interface SafeArea {
left: number;
right: number;
top: number;
bottom: number;
width: number;
height: number;
}
interface SafeAreaInsets {
top: number;
right: number;
bottom: number;
left: number;
}
interface NetworkTypeResult {
/** Network type */
networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none';
}
interface BatteryInfo {
/** Battery level (0-100) */
level: number;
/** Whether device is charging */
isCharging: boolean;
}Local data storage and retrieval.
/**
* Set storage data
* @param options - Storage set options
* @returns Promise resolving when data is stored
*/
uni.setStorage(options: SetStorageOptions): Promise<any>;
/**
* Get storage data
* @param options - Storage get options
* @returns Promise resolving with stored data
*/
uni.getStorage(options: GetStorageOptions): Promise<GetStorageResult>;
/**
* Remove storage data
* @param options - Storage remove options
* @returns Promise resolving when data is removed
*/
uni.removeStorage(options: RemoveStorageOptions): Promise<any>;
/**
* Clear all storage data
* @returns Promise resolving when storage is cleared
*/
uni.clearStorage(): Promise<any>;
/**
* Get storage info
* @returns Promise resolving with storage information
*/
uni.getStorageInfo(): Promise<StorageInfo>;
interface SetStorageOptions {
/** Storage key */
key: string;
/** Data to store */
data: any;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface GetStorageOptions {
/** Storage key */
key: string;
success?: (res: GetStorageResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface GetStorageResult {
/** Retrieved data */
data: any;
}
interface RemoveStorageOptions {
/** Storage key */
key: string;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface StorageInfo {
/** All storage keys */
keys: string[];
/** Current storage size in KB */
currentSize: number;
/** Storage size limit in KB */
limitSize: number;
}HTTP requests and file transfers.
/**
* Make HTTP request
* @param options - Request options
* @returns Promise resolving with response data
*/
uni.request(options: RequestOptions): Promise<RequestResult>;
/**
* Upload file
* @param options - Upload options
* @returns Promise resolving with upload result
*/
uni.uploadFile(options: UploadFileOptions): Promise<UploadFileResult>;
/**
* Download file
* @param options - Download options
* @returns Promise resolving with download result
*/
uni.downloadFile(options: DownloadFileOptions): Promise<DownloadFileResult>;
interface RequestOptions {
/** Request URL */
url: string;
/** Request data */
data?: any;
/** Request headers */
header?: Record<string, string>;
/** Request method */
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS';
/** Response data type */
dataType?: 'json' | 'text';
/** Response type */
responseType?: 'text' | 'arraybuffer';
/** Request timeout */
timeout?: number;
success?: (res: RequestResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface RequestResult {
/** Response data */
data: any;
/** HTTP status code */
statusCode: number;
/** Response headers */
header: Record<string, string>;
/** Request cookies */
cookies: string[];
}
interface UploadFileOptions {
/** Upload URL */
url: string;
/** File path to upload */
filePath: string;
/** Form field name for file */
name: string;
/** Additional form data */
formData?: Record<string, any>;
/** Request headers */
header?: Record<string, string>;
/** Request timeout */
timeout?: number;
success?: (res: UploadFileResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface UploadFileResult {
/** Response data */
data: string;
/** HTTP status code */
statusCode: number;
}
interface DownloadFileOptions {
/** Download URL */
url: string;
/** Save file path */
filePath?: string;
/** Request headers */
header?: Record<string, string>;
/** Request timeout */
timeout?: number;
success?: (res: DownloadFileResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface DownloadFileResult {
/** Downloaded file path */
tempFilePath: string;
/** HTTP status code */
statusCode: number;
}Global event communication system.
/**
* Register event listener
* @param event - Event name
* @param callback - Event handler function
*/
uni.$on(event: string, callback: Function): void;
/**
* Remove event listener
* @param event - Event name
* @param callback - Event handler function to remove (optional)
*/
uni.$off(event: string, callback?: Function): void;
/**
* Register one-time event listener
* @param event - Event name
* @param callback - Event handler function
*/
uni.$once(event: string, callback: Function): void;
/**
* Emit event
* @param event - Event name
* @param args - Event arguments
*/
uni.$emit(event: string, ...args: any[]): void;Usage Examples:
// Register event listener
uni.$on('userLogin', (userInfo) => {
console.log('User logged in:', userInfo);
updateUIForLoggedInUser(userInfo);
});
// Emit event from another page/component
uni.$emit('userLogin', {
id: 123,
name: 'John Doe',
avatar: 'https://example.com/avatar.jpg'
});
// One-time listener
uni.$once('appInitialized', () => {
console.log('App initialized - this will only run once');
});
// Remove specific listener
const loginHandler = (userInfo) => {
console.log('User logged in:', userInfo);
};
uni.$on('userLogin', loginHandler);
// Later...
uni.$off('userLogin', loginHandler);
// Remove all listeners for an event
uni.$off('userLogin');All async APIs are automatically converted to Promises while maintaining callback support:
// Promise style (recommended)
const result = await uni.request({
url: 'https://api.example.com/data',
method: 'GET'
});
// Callback style (still supported)
uni.request({
url: 'https://api.example.com/data',
method: 'GET',
success: (res) => {
console.log('Success:', res.data);
},
fail: (err) => {
console.error('Error:', err);
}
});APIs support interceptors for request/response processing:
// Add global interceptor
uni.addInterceptor('request', {
invoke(args) {
// Process request before sending
args.header = args.header || {};
args.header['Authorization'] = getAuthToken();
return args;
},
success(res) {
// Process successful response
console.log('Request successful:', res);
return res;
},
fail(err) {
// Process error response
console.error('Request failed:', err);
return err;
}
});
// Add interceptor for specific API
uni.addInterceptor('showModal', {
invoke(args) {
// Add default styling
args.confirmColor = args.confirmColor || '#007aff';
return args;
}
});APIs for managing application subpackages and plugins.
/**
* Preload a subpackage for improved performance
* @param options - Preload options
* @returns Promise resolving when preload completes
*/
uni.preloadPage(options: PreloadPageOptions): Promise<any>;
/**
* Unload a preloaded subpackage
* @param options - Unload options
* @returns Promise resolving when unload completes
*/
uni.unPreloadPage(options: UnPreloadPageOptions): Promise<any>;
/**
* Load a subpackage dynamically
* @param options - Load options
* @returns Promise resolving when subpackage is loaded
*/
uni.loadSubPackage(options: LoadSubPackageOptions): Promise<LoadSubPackageResult>;
interface PreloadPageOptions {
url: string;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface LoadSubPackageOptions {
name: string;
success?: (res: LoadSubPackageResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface LoadSubPackageResult {
errMsg: string;
}APIs for custom tab bar interactions and push notifications.
/**
* Handle middle button tap on custom tab bar
* @param callback - Callback function for middle button tap
*/
uni.onTabBarMidButtonTap(callback: () => void): void;
/**
* Subscribe to push notifications
* @param options - Subscription options
* @returns Promise resolving when subscription completes
*/
uni.subscribePush(options: SubscribePushOptions): Promise<any>;
/**
* Unsubscribe from push notifications
* @param options - Unsubscription options
* @returns Promise resolving when unsubscription completes
*/
uni.unsubscribePush(options: UnsubscribePushOptions): Promise<any>;
/**
* Listen for push notifications
* @param callback - Callback function for push events
*/
uni.onPush(callback: (res: PushEventResult) => void): void;
/**
* Remove push notification listener
* @param callback - Callback function to remove
*/
uni.offPush(callback?: (res: PushEventResult) => void): void;
/**
* Share content via QQ mini-program sharing
* @param options - Share options
* @returns Promise resolving when share completes
*/
uni.share(options: ShareOptions): Promise<any>;
interface SubscribePushOptions {
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface PushEventResult {
messageId: string;
data: Record<string, any>;
}
interface ShareOptions {
title?: string;
path?: string;
imageUrl?: string;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}Device hardware and sensor access APIs (availability depends on QQ mini-program support).
/**
* Scan QR/bar codes using device camera
* @param options - Scan options
* @returns Promise resolving with scan results
*/
uni.scanCode(options?: ScanCodeOptions): Promise<ScanCodeResult>;
/**
* Start listening to accelerometer data
* @param options - Accelerometer options
* @returns Promise resolving when accelerometer starts
*/
uni.startAccelerometer(options?: AccelerometerOptions): Promise<any>;
/**
* Stop listening to accelerometer data
* @returns Promise resolving when accelerometer stops
*/
uni.stopAccelerometer(): Promise<any>;
/**
* Listen for accelerometer data changes
* @param callback - Callback function for accelerometer data
*/
uni.onAccelerometerChange(callback: (res: AccelerometerData) => void): void;
/**
* Start listening to compass data
* @returns Promise resolving when compass starts
*/
uni.startCompass(): Promise<any>;
/**
* Listen for compass data changes
* @param callback - Callback function for compass data
*/
uni.onCompassChange(callback: (res: CompassData) => void): void;
/**
* Set screen brightness
* @param options - Brightness options
* @returns Promise resolving when brightness is set
*/
uni.setScreenBrightness(options: SetScreenBrightnessOptions): Promise<any>;
/**
* Get current screen brightness
* @returns Promise resolving with brightness value
*/
uni.getScreenBrightness(): Promise<GetScreenBrightnessResult>;
/**
* Set whether to keep screen on
* @param options - Keep screen on options
* @returns Promise resolving when setting is applied
*/
uni.setKeepScreenOn(options: SetKeepScreenOnOptions): Promise<any>;
/**
* Listen for user screen capture events
* @param callback - Callback function for capture events
*/
uni.onUserCaptureScreen(callback: () => void): void;
/**
* Trigger long vibration (400ms)
* @returns Promise resolving when vibration completes
*/
uni.vibrateLong(): Promise<any>;
/**
* Trigger short vibration (15ms)
* @returns Promise resolving when vibration completes
*/
uni.vibrateShort(): Promise<any>;
interface ScanCodeOptions {
onlyFromCamera?: boolean;
scanType?: string[];
success?: (res: ScanCodeResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface ScanCodeResult {
result: string;
scanType: string;
charSet: string;
path: string;
}
interface AccelerometerData {
x: number;
y: number;
z: number;
}
interface CompassData {
direction: number;
accuracy: number;
}
interface SetScreenBrightnessOptions {
value: number;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface GetScreenBrightnessResult {
value: number;
}
interface SetKeepScreenOnOptions {
keepScreenOn: boolean;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}Advanced APIs for web workers and WebSocket communication.
/**
* Create a web worker for background processing
* @param scriptPath - Path to worker script
* @returns Worker instance
*/
uni.createWorker(scriptPath: string): Worker;
/**
* Connect to WebSocket server
* @param options - WebSocket connection options
* @returns Promise resolving when connection is established
*/
uni.connectSocket(options: ConnectSocketOptions): Promise<any>;
/**
* Listen for WebSocket connection open events
* @param callback - Callback function for open events
*/
uni.onSocketOpen(callback: (res: SocketOpenResult) => void): void;
/**
* Listen for WebSocket error events
* @param callback - Callback function for error events
*/
uni.onSocketError(callback: (res: SocketErrorResult) => void): void;
/**
* Send message through WebSocket
* @param options - Message options
* @returns Promise resolving when message is sent
*/
uni.sendSocketMessage(options: SendSocketMessageOptions): Promise<any>;
/**
* Listen for WebSocket message events
* @param callback - Callback function for message events
*/
uni.onSocketMessage(callback: (res: SocketMessageResult) => void): void;
/**
* Close WebSocket connection
* @param options - Close options
* @returns Promise resolving when connection is closed
*/
uni.closeSocket(options?: CloseSocketOptions): Promise<any>;
/**
* Listen for WebSocket close events
* @param callback - Callback function for close events
*/
uni.onSocketClose(callback: (res: SocketCloseResult) => void): void;
interface ConnectSocketOptions {
url: string;
header?: Record<string, string>;
protocols?: string[];
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface SendSocketMessageOptions {
data: string | ArrayBuffer;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface SocketMessageResult {
data: string | ArrayBuffer;
}APIs for media playback, document handling, and sharing.
/**
* Open and view documents
* @param options - Document options
* @returns Promise resolving when document opens
*/
uni.openDocument(options: OpenDocumentOptions): Promise<any>;
/**
* Update share menu configuration
* @param options - Share menu options
* @returns Promise resolving when menu is updated
*/
uni.updateShareMenu(options?: UpdateShareMenuOptions): Promise<any>;
/**
* Get share information
* @param options - Share info options
* @returns Promise resolving with share information
*/
uni.getShareInfo(options: GetShareInfoOptions): Promise<GetShareInfoResult>;
/**
* Create live player context for video streaming
* @param id - Live player component ID
* @returns Live player context instance
*/
uni.createLivePlayerContext(id: string): LivePlayerContext;
/**
* Create live pusher context for video broadcasting
* @param id - Live pusher component ID
* @returns Live pusher context instance
*/
uni.createLivePusherContext(id: string): LivePusherContext;
/**
* Set navigation bar color
* @param options - Navigation bar color options
* @returns Promise resolving when color is set
*/
uni.setNavigationBarColor(options: SetNavigationBarColorOptions): Promise<any>;
interface OpenDocumentOptions {
filePath: string;
fileType?: string;
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface UpdateShareMenuOptions {
withShareTicket?: boolean;
isUpdatableMessage?: boolean;
activityId?: string;
templateInfo?: {
parameterList: Array<{
name: string;
value: string;
}>;
};
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface GetShareInfoOptions {
shareTicket: string;
timeout?: number;
success?: (res: GetShareInfoResult) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}
interface GetShareInfoResult {
errMsg: string;
encryptedData: string;
iv: string;
cloudID?: string;
}
interface LivePlayerContext {
play(): void;
stop(): void;
mute(): void;
pause(): void;
resume(): void;
requestFullscreen(options?: { direction?: number }): void;
exitFullscreen(): void;
}
interface LivePusherContext {
start(): void;
stop(): void;
pause(): void;
resume(): void;
switchCamera(): void;
snapshot(): void;
}
interface SetNavigationBarColorOptions {
frontColor: string;
backgroundColor: string;
animation?: {
duration?: number;
timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
};
success?: (res: any) => void;
fail?: (res: any) => void;
complete?: (res: any) => void;
}APIs for system monitoring, memory management, and analytics.
/**
* Listen for memory warning events
* @param callback - Callback function for memory warning events
*/
uni.onMemoryWarning(callback: (res: MemoryWarningResult) => void): void;
/**
* Listen for network status changes
* @param callback - Callback function for network status changes
*/
uni.onNetworkStatusChange(callback: (res: NetworkStatusResult) => void): void;
/**
* Report performance monitoring data
* @param name - Monitor name
* @param value - Monitor value
*/
uni.reportMonitor(name: string, value: number): void;
/**
* Get log manager for debugging
* @returns Log manager instance
*/
uni.getLogManager(): LogManager;
/**
* Report analytics data
* @param eventName - Event name
* @param data - Event data
*/
uni.reportAnalytics(eventName: string, data: Record<string, any>): void;
interface MemoryWarningResult {
level: number;
}
interface NetworkStatusResult {
isConnected: boolean;
networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none';
}
interface LogManager {
debug(...args: any[]): void;
info(...args: any[]): void;
log(...args: any[]): void;
warn(...args: any[]): void;
}Access QQ mini-program specific APIs through the uni object:
// QQ-specific APIs are proxied through uni
const qqSpecificResult = await uni.qqSpecificAPI({
// QQ-specific parameters
});
// All wx APIs are available as uni APIs
const systemInfo = await uni.getSystemInfo();
// Check API availability before use
if (uni.canIUse('scanCode')) {
const scanResult = await uni.scanCode();
}