@1hive/connect-core
Version:
Access and interact with Aragon Organizations and their apps.
23 lines • 1.14 kB
TypeScript
import type { Network, SubscriptionResult, SubscriptionStart } from '@1hive/connect-types';
import { ConnectionContext } from '../types';
import App from '../entities/App';
declare type AppConnectContext = {
app: App;
config: object;
connector: string;
ipfs: ConnectionContext['ipfs'];
network: Network;
orgConnector: ConnectionContext['orgConnector'];
verbose: boolean;
};
declare type AugmentedApp<T> = App & T & {
_app: App;
_connectedApp: T;
};
declare type ConnectorDeclaration<Config> = string | [string, Config | undefined] | undefined;
declare type CreateAppConnectorCallback<ConnectedApp, Config> = (context: {
config: Config;
} & AppConnectContext) => ConnectedApp | Promise<ConnectedApp>;
export declare function createAppConnector<ConnectedApp extends object, Config extends object>(callback: CreateAppConnectorCallback<ConnectedApp, Config>): (appOrSubscribe: App | Promise<App> | SubscriptionResult<App>, connector?: ConnectorDeclaration<Config>) => Promise<AugmentedApp<ConnectedApp>> | SubscriptionStart<AugmentedApp<ConnectedApp>>;
export {};
//# sourceMappingURL=app-connectors.d.ts.map