native-update
Version:
Foundation package for building a comprehensive update system for Capacitor apps. Provides architecture and interfaces but requires backend implementation.
61 lines (60 loc) • 1.36 kB
TypeScript
import type { LiveUpdateConfig } from '../definitions';
/**
* Input validation utilities
*/
export declare class Validator {
/**
* Validate URL
*/
static validateUrl(url: string, enforceHttps?: boolean): {
valid: boolean;
error?: string;
};
/**
* Validate version string
*/
static validateVersion(version: string): {
valid: boolean;
error?: string;
};
/**
* Compare versions
*/
static compareVersions(version1: string, version2: string): number;
/**
* Validate bundle ID
*/
static validateBundleId(bundleId: string): {
valid: boolean;
error?: string;
};
/**
* Validate file size
*/
static validateFileSize(size: number, maxSize: number): {
valid: boolean;
error?: string;
};
/**
* Validate configuration
*/
static validateLiveUpdateConfig(config: LiveUpdateConfig): {
valid: boolean;
errors: string[];
};
/**
* Validate host
*/
static isValidHost(host: string): boolean;
/**
* Sanitize input string
*/
static sanitizeInput(input: string): string;
/**
* Validate path (prevent directory traversal)
*/
static validatePath(path: string): {
valid: boolean;
error?: string;
};
}