import type { ManifestBase, ManifestKind, UmbConditionConfigBase } from '../types/index.js'; import type { SpecificManifestTypeOrManifestBase } from '../types/map.types.js'; import type { Observable } from '../../../external/rxjs/index.js'; export declare class UmbExtensionRegistry { #private; readonly MANIFEST_TYPES: ManifestTypes; private _extensions; readonly extensions: Observable; private _kinds; readonly kinds: Observable[]>; defineKind(kind: ManifestKind): void; /** * Exclude an extension from being available. * Notice if you are looking to replace, then you can achieve such via the `overwrites` property in the manifest. * @param {string} alias - The alias of the extension to exclude. */ exclude(alias: string): void; /** * Register an extension. * @param {(ManifestBase | ManifestKind)} manifest - The extension to register. * @memberof UmbExtensionRegistry */ register(manifest: ManifestTypes | ManifestKind): void; /** * Get all registered extensions. * @returns {Array} - All registered extensions. * @memberof UmbExtensionRegistry */ getAllExtensions(): Array; /** * Register many extensions. * @param {(Array>)} manifests - The extensions to register. * @memberof UmbExtensionRegistry */ registerMany(manifests: Array>): void; /** * Unregister many extensions with the given aliases. * Notice it is more secure to exclude it, only unregister extensions that you provided. * @param {Array} aliases - The aliases of the extensions to unregister. * @memberof UmbExtensionRegistry */ unregisterMany(aliases: Array): void; /** * Unregister an extension with the given alias. * Notice it is more secure to exclude it, only unregister extensions that you provided. * @param {string} alias - The alias of the extension to unregister. * @memberof UmbExtensionRegistry */ unregister(alias: string): void; /** * Check if an extension with the given alias is registered. * @param {string} alias - The alias of the extension to check. * @returns {boolean} - true if an extension with the given alias is registered. * @memberof UmbExtensionRegistry */ isRegistered(alias: string): boolean; /** * Clears all extensions and kinds from the registry. * @memberof UmbExtensionRegistry */ clear(): void; /** * Get an observable that provides an extension matching the given alias. * @param {string} alias - The alias of the extension to get. * @returns {Observable} - An observable of the extension that matches the alias. */ byAlias(alias: string): Observable; /** * Get an extension that matches the given alias, this will not return an observable, it is a one of retrieval if it exists at the given point in time. * @param {string} alias - The alias of the extension to get. * @returns {ManifestBase | undefined} - The extension manifest that matches the alias. */ getByAlias(alias: string): T | undefined; /** * Get an observable that provides extensions matching the given type and alias. * @param {string} type - The type of the extensions to get. * @param {string} alias - The alias of the extensions to get. * @returns {Observable} - An observable of the extensions that matches the type and alias. */ byTypeAndAlias>(type: Key, alias: string): Observable; /** * Get an observable that provides extensions matching the given type and alias. * @param {string} type - The type of the extensions to get. * @param {Array} aliases - The aliases of the extensions to get. * @returns {Observable} - An observable of the extensions that matches the type and one of the aliases. */ byTypeAndAliases>(type: Key, aliases: Array): Observable>; /** * Get an observable of extensions by type and a given filter method. * This will return the all extensions that matches the type and which filter method returns true. * The filter method will be called for each extension manifest of the given type, and the first argument to it is the extension manifest. * @param {string} type - The type of the extension to get. * @param {(ext: ManifestBase) => boolean} filter - The filter method to use to filter the extensions. * @returns {Observable>} - An observable of the extensions that matches the type and filter method. */ byTypeAndFilter>(type: Key, filter: (ext: T) => boolean): Observable>; /** * Get an extensions by type and a given filter method. * This will return the all extensions that matches the type and which filter method returns true. * The filter method will be called for each extension manifest of the given type, and the first argument to it is the extension manifest. * @param {string} type - The type of the extension to get. * @param {(ext: ManifestBase) => boolean} filter - The filter method to use to filter the extensions. * @returns {Observable>} - An observable of the extensions that matches the type and filter method. */ getByTypeAndFilter>(type: Key, filter: (ext: T) => boolean): Array; /** * Get an observable of extensions by types and a given filter method. * This will return the all extensions that matches the types and which filter method returns true. * The filter method will be called for each extension manifest of the given types, and the first argument to it is the extension manifest. * @param {Array} types - The types of the extensions to get. * @param {(ext: ManifestBase) => boolean} filter - The filter method to use to filter the extensions * @returns {Observable>} - An observable of the extensions that matches the type and filter method */ byTypesAndFilter(types: string[], filter: (ext: ExtensionTypes) => boolean): Observable>; /** * Get an observable that provides extensions matching the given type. * @param {string} type - The type of the extensions to get. * @returns {Observable} - An observable of the extensions that matches the type. */ byType>(type: Key): Observable>; /** * Get all extensions that matches the given extension type. * @param {string} type - The type of the extension to get. * @returns {ManifestBase | undefined} - The extension manifest that matches the alias. */ getByType>(type: Key): Array; /** * Get an observable that provides extensions matching given types. * @param {Array} types - The types of the extensions to get. * @returns {Observable} - An observable of the extensions that matches the types. */ byTypes(types: string[]): Observable>; /** * Append a new condition to an existing extension * Useful to add a condition for example the Save And Publish workspace action shipped by core. * @param {string} alias - The alias of the extension to append the condition to. * @param {UmbConditionConfigBase} newCondition - The condition to append to the extension. */ appendCondition(alias: string, newCondition: IncomingConditionConfigTypes): void; /** * Appends an array of conditions to an existing extension * @param {string} alias - The alias of the extension to append the condition to * @param {Array} newConditions - An array of conditions to be appended to an extension manifest. */ appendConditions(alias: string, newConditions: Array): void; }