import type { ExternalProfile, Profile, Message } from '@remixproject/plugin-utils'; import { Plugin, PluginOptions } from './abstract'; /** List of available gateways for decentralised storage */ export declare const defaultGateways: { 'ipfs://': (url: any, name: any) => string; 'swarm://': (url: any, name: any) => string; }; /** Transform the URL to use a gateway if decentralised storage is specified */ export declare function transformUrl({ url, name }: Profile & ExternalProfile): any; export interface PluginConnectorOptions extends PluginOptions { /** Usally used to reload the plugin on changes */ devMode?: boolean; transformUrl?: (profile: Profile & ExternalProfile) => string; } export declare abstract class PluginConnector extends Plugin { protected loaded: boolean; protected id: number; protected pendingRequest: Record void>; protected options: PluginConnectorOptions; profile: Profile & ExternalProfile; constructor(profile: Profile & ExternalProfile); /** * Send a message to the external plugin * @param message the message passed to the plugin */ protected abstract send(message: Partial): void; /** * Open connection with the plugin * @param url The transformed url the plugin should connect to */ protected abstract connect(url: string): any | Promise; /** Close connection with the plugin */ protected abstract disconnect(): any | Promise; activate(): Promise; deactivate(): Promise; /** Set options for an external plugin */ setOptions(options?: Partial): void; /** Call a method from this plugin */ protected callPluginMethod(key: string, payload?: any[]): Promise; /** Perform handshake with the client if not loaded yet */ protected handshake(): Promise; /** * React when a message comes from client * @param message The message sent by the client */ protected getMessage(message: Message): Promise; }