import { Tab } from '../../tab'; import { MetadataBearing } from '../../../models/entity'; import { ModeOrButton as SidecarMode } from '../../../models/mmr/types'; export type SidecarModeFilter = (resource: Resource) => boolean; export type ModeDeclaration = SidecarMode; /** * Interpretation: if the resource passes the given "when" filter, * then add the given sidecar mode * */ export interface ModeRegistration { when: SidecarModeFilter; mode: ModeDeclaration; } /** * Register a new mode * */ export declare function registerSidecarMode(registration: ModeRegistration): void; export default registerSidecarMode; export declare const registerModeWhen: >(when: SidecarModeFilter) => (mode: ModeDeclaration) => void; /** * Apply all registered modes that are relevant to the given resource * to the given modes model * */ export declare function apply(tab: Tab, modes: SidecarMode[], command: string, resource: { resource: Resource; }): void; /** * @return the relevant modes for the given command on the given resource * */