import { Bento } from '../Bento'; import { Component } from '../components'; import { Plugin } from '../plugins'; import { ComponentReference, PluginReference } from '../references'; import { VariableDefinition } from '../variables'; /** * Shared functions for ComponentAPI and PluginAPI */ export declare class SharedAPI { protected readonly bento: Bento; constructor(bento: Bento); /** * Get the semantic version string of the bento instance attached to this component api * @returns Semantic version string (https://semver.org) */ getBentoVersion(): string; /** * Check if bento has a given property * @param name name of property * * @returns boolean */ hasProperty(name: string): boolean; /** * Fetch the value of given application property * @param name name of application property * * @returns Property value */ getProperty(name: string): any; /** * Check if bento has a given variable * @param name name of variable * * @returns boolean */ hasVariable(name: string): boolean; /** * Gets the value of a variable * @param definition Variable name or definition * * @returns Variable value */ getVariable(definition: VariableDefinition | string): T; /** * Check if Bento has a given plugin * * @param reference Plugin instance, name or reference * * @returns boolean */ hasPlugin(reference: PluginReference): boolean; /** * Fetch the provided plugin instance * * @param reference Plugin name or reference * * @returns Plugin instance */ getPlugin(reference: PluginReference): T; /** * Checks if Bento has a given component * * @param reference Component instance, name or reference * * @returns boolean */ hasComponent(reference: ComponentReference): boolean; /** * Fetch the provided component instance * * @param reference Component name or reference * * @returns Component instance */ getComponent(reference: ComponentReference): T; }