@kirz/react-native-toolkit
Version:
Toolkit to speed up React Native development
29 lines • 1.08 kB
TypeScript
/// <reference types="react" />
export type PluginFeature = 'ErrorTracking' | 'RemoteConfig' | 'Analytics' | 'InAppPurchase' | 'IAPReceiptValidator' | 'Network' | 'IDFA' | 'PushNotification';
export type FallbackScreenProps = {
error: string;
isRetrying: boolean;
retry: () => Promise<void>;
};
export type PluginFactoryOptions = {
name?: string;
optional?: boolean;
group?: string;
dependsOn?: string[];
fallbackScreen?: React.FC<FallbackScreenProps>;
timeout?: number | null;
};
export declare abstract class Plugin {
abstract get name(): string;
abstract get features(): PluginFeature[];
abstract get initializationTimeout(): number | null;
payload?: any;
abstract initialize(plugins: PluginsBundle): Promise<void> | void;
}
export declare class PluginsBundle {
readonly plugins: Plugin[];
constructor(plugins: Plugin[]);
get<T extends Plugin>(constructorOrName: (new (...args: any) => T) | string): T | undefined;
getByFeature<T>(feature: PluginFeature): T | undefined;
}
//# sourceMappingURL=Plugin.d.ts.map