@jbrowse/core
Version:
JBrowse 2 core libraries used by plugins
126 lines (125 loc) • 7.2 kB
TypeScript
import PhasedScheduler from './PhasedScheduler.ts';
import ReExports from './ReExports/index.ts';
import AdapterType from './pluggableElementTypes/AdapterType.ts';
import AddTrackWorkflowType from './pluggableElementTypes/AddTrackWorkflowType.ts';
import ConnectionType from './pluggableElementTypes/ConnectionType.ts';
import DisplayType from './pluggableElementTypes/DisplayType.ts';
import GlyphType from './pluggableElementTypes/GlyphType.ts';
import InternetAccountType from './pluggableElementTypes/InternetAccountType.ts';
import RpcMethodType from './pluggableElementTypes/RpcMethodType.ts';
import TextSearchAdapterType from './pluggableElementTypes/TextSearchAdapterType.ts';
import TrackType from './pluggableElementTypes/TrackType.ts';
import ViewType from './pluggableElementTypes/ViewType.ts';
import WidgetType from './pluggableElementTypes/WidgetType.ts';
import RendererType from './pluggableElementTypes/renderers/RendererType.tsx';
import type Plugin from './Plugin.ts';
import type { PluginDefinition } from './PluginLoader.ts';
import type PluggableElementBase from './pluggableElementTypes/PluggableElementBase.ts';
import type { PluggableElementType } from './pluggableElementTypes/index.ts';
import type { AbstractRootModel } from './util/index.ts';
import type { IAnyModelType, IAnyType } from '@jbrowse/mobx-state-tree';
type PluggableElementTypeGroup = 'renderer' | 'adapter' | 'display' | 'track' | 'connection' | 'view' | 'widget' | 'rpc method' | 'internet account' | 'text search adapter' | 'add track workflow' | 'glyph';
declare class TypeRecord<ElementClass extends PluggableElementBase> {
typeName: string;
baseClass: (new (...args: unknown[]) => ElementClass) | (Function & {
prototype: ElementClass;
});
registeredTypes: Record<string, ElementClass>;
constructor(typeName: string, baseClass: (new (...args: unknown[]) => ElementClass) | (Function & {
prototype: ElementClass;
}));
add(name: string, t: ElementClass): void;
has(name: string): boolean;
get(name: string): ElementClass | undefined;
all(): ElementClass[];
}
type AnyFunction = (...args: any) => any;
export type PluginMetadata = Record<string, unknown>;
export interface PluginLoadRecord {
metadata?: PluginMetadata;
plugin: Plugin;
}
export interface RuntimePluginLoadRecord extends PluginLoadRecord {
definition: PluginDefinition;
}
export default class PluginManager {
plugins: Plugin[];
jexl: import("@jbrowse/jexl").Jexl;
pluginMetadata: Record<string, PluginMetadata>;
runtimePluginDefinitions: PluginDefinition[];
elementCreationSchedule: PhasedScheduler<PluggableElementTypeGroup> | undefined;
glyphTypes: TypeRecord<GlyphType>;
rendererTypes: TypeRecord<RendererType>;
adapterTypes: TypeRecord<AdapterType>;
textSearchAdapterTypes: TypeRecord<TextSearchAdapterType>;
trackTypes: TypeRecord<TrackType>;
displayTypes: TypeRecord<DisplayType>;
connectionTypes: TypeRecord<ConnectionType>;
viewTypes: TypeRecord<ViewType>;
widgetTypes: TypeRecord<WidgetType>;
rpcMethods: TypeRecord<RpcMethodType>;
addTrackWidgets: TypeRecord<AddTrackWorkflowType>;
internetAccountTypes: TypeRecord<InternetAccountType>;
configured: boolean;
rootModel?: AbstractRootModel;
extensionPoints: Map<string, Function[]>;
constructor(initialPlugins?: (Plugin | PluginLoadRecord)[]);
pluginConfigurationNamespacedSchemas(): Record<string, unknown>;
pluginConfigurationUnnamespacedSchemas(): Record<string, unknown>;
pluginConfigurationRootSchemas(): Record<string, unknown>;
addPlugin(load: Plugin | PluginLoadRecord | RuntimePluginLoadRecord): this;
getPlugin(name: string): Plugin | undefined;
hasPlugin(name: string): boolean;
createPluggableElements(): this;
setRootModel(rootModel: AbstractRootModel): this;
configure(): this;
getElementTypeRecord(groupName: PluggableElementTypeGroup): TypeRecord<PluggableElementBase>;
addElementType(groupName: PluggableElementTypeGroup, creationCallback: (pluginManager: PluginManager) => PluggableElementType): this;
getElementType(groupName: PluggableElementTypeGroup, typeName: string): PluggableElementBase | undefined;
getElementTypesInGroup(groupName: PluggableElementTypeGroup): PluggableElementBase[];
getViewElements(): ViewType[];
getTrackElements(): TrackType[];
getConnectionElements(): ConnectionType[];
getAddTrackWorkflowElements(): AddTrackWorkflowType[];
getRpcElements(): RpcMethodType[];
getDisplayElements(): DisplayType[];
getAdapterElements(): AdapterType[];
pluggableMstType(groupName: PluggableElementTypeGroup, fieldName: string, fallback?: IAnyType): IAnyType;
pluggableConfigSchemaType(typeGroup: PluggableElementTypeGroup, fieldName?: string): IAnyModelType;
jbrequireCache: Map<any, any>;
lib: any;
load: <FTYPE extends AnyFunction>(lib: FTYPE) => ReturnType<FTYPE>;
jbrequire: (lib: keyof typeof ReExports | AnyFunction | {
default: AnyFunction;
}) => any;
getRendererType(typeName: string): RendererType | undefined;
getRendererTypes(): RendererType[];
getAdapterType(typeName: string): AdapterType | undefined;
getTextSearchAdapterType(typeName: string): TextSearchAdapterType | undefined;
getTrackType(typeName: string): TrackType | undefined;
getDisplayType(typeName: string): DisplayType | undefined;
getViewType(typeName: string): ViewType | undefined;
getAddTrackWorkflow(typeName: string): AddTrackWorkflowType | undefined;
getWidgetType(typeName: string): WidgetType | undefined;
getConnectionType(typeName: string): ConnectionType | undefined;
getRpcMethodType(methodName: string): RpcMethodType | undefined;
getInternetAccountType(name: string): InternetAccountType | undefined;
addRendererType(cb: (pm: PluginManager) => RendererType): this;
addAdapterType(cb: (pm: PluginManager) => AdapterType): this;
addTextSearchAdapterType(cb: (pm: PluginManager) => TextSearchAdapterType): this;
addTrackType(cb: (pm: PluginManager) => TrackType): this;
addDisplayType(cb: (pluginManager: PluginManager) => DisplayType): this;
addViewType(cb: (pluginManager: PluginManager) => ViewType): this;
addWidgetType(cb: (pm: PluginManager) => WidgetType): this;
addConnectionType(cb: (pm: PluginManager) => ConnectionType): this;
addRpcMethod(cb: (pm: PluginManager) => RpcMethodType): this;
addInternetAccountType(cb: (pm: PluginManager) => InternetAccountType): this;
addAddTrackWorkflowType(cb: (pm: PluginManager) => AddTrackWorkflowType): this;
addGlyphType(cb: (pm: PluginManager) => GlyphType): this;
getGlyphType(typeName: string): GlyphType | undefined;
getGlyphTypes(): GlyphType[];
addToExtensionPoint<T>(extensionPointName: string, callback: (extendee: T, props: Record<string, unknown>) => T): void;
evaluateExtensionPoint(extensionPointName: string, extendee: unknown, props?: Record<string, unknown>): unknown;
evaluateAsyncExtensionPoint(extensionPointName: string, extendee: unknown, props?: Record<string, unknown>): Promise<unknown>;
}
export {};