1 | import type { EventEmitter } from 'events';
|
2 | import type { Api, Profile, LibraryProfile, LocationProfile } from '@remixproject/plugin-utils';
|
3 | import { Plugin } from './abstract';
|
4 | export declare type LibraryApi<T extends Api, P extends Profile> = {
|
5 | [method in P['methods'][number]]: T['methods'][method];
|
6 | } & {
|
7 | events?: EventEmitter;
|
8 | } & {
|
9 | render?(): Element;
|
10 | };
|
11 | declare type LibraryViewProfile = LocationProfile & LibraryProfile;
|
12 | export declare function isViewLibrary(profile: any): profile is LibraryViewProfile;
|
13 | export declare class LibraryPlugin<T extends Api = any, P extends LibraryProfile | LibraryViewProfile = any> extends Plugin {
|
14 | protected library: LibraryApi<T, P>;
|
15 | profile: P;
|
16 | private isView;
|
17 | constructor(library: LibraryApi<T, P>, profile: P);
|
18 | activate(): Promise<void>;
|
19 | deactivate(): void;
|
20 | /** Call a method from this plugin */
|
21 | protected callPluginMethod(key: string, payload: any[]): any;
|
22 | }
|
23 | export {};
|