node-maw
Version:
TypeScript Axios client for fetching app versions from App Store and Play Store
75 lines • 2.84 kB
TypeScript
import { AppVersion, NodeMawConfig, UpdateCheckResult } from './types.js';
/**
* Configuration specific to Play Store client
*/
export interface PlayStoreConfig extends NodeMawConfig {
/** Play Store language (default: 'en') */
language?: string;
/** Play Store country (default: 'us') */
country?: string;
/** Include additional app metadata in responses */
includeMetadata?: boolean;
}
/**
* Client for fetching app information from Google Play Store
*/
export declare class PlayStoreClient {
private config;
constructor(config?: PlayStoreConfig);
/**
* Fetch app version from Google Play Store
* @param packageName - Android app package name (e.g., 'com.example.app')
* @returns Promise<AppVersion> - App version information
* @throws {PlayStoreError} When app is not found or API request fails
* @throws {NetworkError} When network request fails
*/
getVersion(packageName: string): Promise<AppVersion>;
/**
* Search for apps in the Play Store
* @param term - Search term
* @param options - Search options
* @returns Promise<AppVersion[]> - Array of app version information
*/
search(term: string, options?: {
num?: number;
fullDetail?: boolean;
}): Promise<AppVersion[]>;
/**
* Get app details with full information
* @param packageName - Android app package name
* @returns Promise<any> - Full app details from Play Store
*/
getFullDetails(packageName: string): Promise<any>;
/**
* Get the current configuration
*/
getConfig(): Readonly<Required<PlayStoreConfig>>;
/**
* Update the client configuration
* @param newConfig - Partial configuration to merge with existing config
*/
updateConfig(newConfig: Partial<PlayStoreConfig>): void;
/**
* Check if a package name exists in the Play Store
* @param packageName - Android app package name
* @returns Promise<boolean> - true if app exists, false otherwise
*/
exists(packageName: string): Promise<boolean>;
/**
* Check for updates by comparing current version with latest available version
* @param packageName - Android app package name
* @param currentVersion - Current version of the app to compare against
* @returns Promise<UpdateCheckResult> - Update check result with details
* @throws {PlayStoreError} When app is not found or API request fails
* @throws {NetworkError} When network request fails
*/
checkForUpdates(packageName: string, currentVersion: string): Promise<UpdateCheckResult>;
/**
* Format Play Store date to ISO string
* @private
*/
private formatPlayStoreDate;
}
declare const _default: PlayStoreClient;
export default _default;
//# sourceMappingURL=play-store-client.d.ts.map