UNPKG

1.27 kBTypeScriptView Raw
1import type { PluginImplementations } from './definitions';
2import type { PluginHeader } from './definitions-internal';
3export interface CapacitorPlatform {
4 name: string;
5 getPlatform?(): string;
6 isPluginAvailable?(pluginName: string): boolean;
7 getPluginHeader?(pluginName: string): PluginHeader | undefined;
8 registerPlugin?(pluginName: string, jsImplementations: PluginImplementations): any;
9 isNativePlatform?(): boolean;
10}
11export interface CapacitorPlatformsInstance {
12 currentPlatform: CapacitorPlatform;
13 platforms: Map<string, CapacitorPlatform>;
14 addPlatform(name: string, platform: CapacitorPlatform): void;
15 setPlatform(name: string): void;
16}
17/**
18 * @deprecated Set `CapacitorCustomPlatform` on the window object prior to runtime executing in the web app instead
19 */
20export declare const CapacitorPlatforms: CapacitorPlatformsInstance;
21/**
22 * @deprecated Set `CapacitorCustomPlatform` on the window object prior to runtime executing in the web app instead
23 */
24export declare const addPlatform: (name: string, platform: CapacitorPlatform) => void;
25/**
26 * @deprecated Set `CapacitorCustomPlatform` on the window object prior to runtime executing in the web app instead
27 */
28export declare const setPlatform: (name: string) => void;