@junkawasaki/kawadb-orm
Version:
TypeScript ORM for KawaDB with KSQL support - works in Web and Electron environments
65 lines (64 loc) • 1.61 kB
TypeScript
/**
* 環境検出ユーティリティ
*/
export interface EnvironmentFeatures {
localStorage: boolean;
indexedDB: boolean;
webWorker: boolean;
serviceWorker: boolean;
webAssembly: boolean;
nodeFs: boolean;
electronRenderer: boolean;
electronMain: boolean;
}
export declare class Environment {
private static _features;
/**
* Webブラウザ環境かどうか
*/
static isWeb(): boolean;
/**
* Node.js環境かどうか
*/
static isNode(): boolean;
/**
* Electron環境かどうか
*/
static isElectron(): boolean;
/**
* Electronのメインプロセスかどうか
*/
static isElectronMain(): boolean;
/**
* Electronのレンダラープロセスかどうか
*/
static isElectronRenderer(): boolean;
/**
* サポートされている機能を取得
*/
static getSupportedFeatures(): EnvironmentFeatures;
/**
* 機能を検出
*/
private static detectFeatures;
/**
* 最適なストレージタイプを取得
*/
static getOptimalStorageType(): 'localStorage' | 'indexedDB' | 'memory';
/**
* WebAssemblyが利用可能かどうか
*/
static isWebAssemblySupported(): boolean;
/**
* 永続化ストレージが利用可能かどうか
*/
static isPersistentStorageSupported(): boolean;
/**
* 非同期ストレージが利用可能かどうか
*/
static isAsyncStorageSupported(): boolean;
/**
* 環境情報を取得
*/
static getEnvironmentInfo(): any;
}