import { Editor, EditorServices } from './editor'; /** * Creates a editor that proxies to a member of a collection of editors based on the state of a service. * * @param sourceServiceKey * The service used to determine the current editor. * @param shouldChangeToEditorWithService * The service predicate used to determine the current editor, analogous to the predicate for Array#find(). * @param shouldFallbackToDefault * Determines what happens when shouldChangeToEditorWithService returns falsy for all editors. If falsy, * keeps the current editor unchanged i.e. remembers the last current editor. If truthy, switches to the * default editor. * @param defaultEditor * The editor to use when shouldChangeToEditorWithService returns falsy for all editors, initially and on * subsequent service changes if shouldFallbackToDefault is truthy. * @param additionalEditors * The editors in the collection in addition to the default. The order is significant, because when * shouldChangeToEditorWithService return truthy for multiple editors, the first one will be used. */ export declare function createChangingEditor, K extends keyof S, S extends EditorServices = T extends Editor ? TS : never>(sourceServiceKey: K, shouldChangeToEditorWithService: (service: S[K]) => boolean, shouldFallbackToDefault: boolean, defaultEditor: T, ...additionalEditors: T[]): T;