import { BreezeEvent } from './event'; /** @hidden */ export interface AdapterCtor { new (...args: any[]): T; } /** @hidden */ export interface IDef { ctor: AdapterCtor; defaultInstance?: T; } export type AdapterType = 'dataService' | 'modelLibrary' | 'ajax' | 'uriBuilder'; export declare class InterfaceDef { name: string; defaultInstance?: T; /** @hidden @internal */ _implMap: { [name: string]: IDef; }; constructor(name: string); /** Define an implementation of the given adaptername */ registerCtor(adapterName: string, ctor: AdapterCtor): void; /** Return the definition for the given adapterName */ getImpl(adapterName: string): IDef; /** Return the first implementation for this InterfaceDef */ getFirstImpl(): IDef; getDefaultInstance(): T; } export interface BaseAdapter { /** @hidden @internal */ _$impl?: any; name: string; initialize(): void; checkForRecomposition?: (context: any) => void; } export declare class BreezeConfig { functionRegistry: {}; typeRegistry: {}; objectRegistry: {}; interfaceInitialized: BreezeEvent<{ interfaceName: string; instance: BaseAdapter; isDefault: boolean; }>; stringifyPad: string; /** whether to prohibit eval() and Function() in breeze code */ noEval: boolean; /** @hidden @internal */ _interfaceRegistry: any; constructor(); /** Method use to register implementations of standard breeze interfaces. Calls to this method are usually made as the last step within an adapter implementation. @method registerAdapter @param interfaceName {String} - one of the following interface names: "ajax", "dataService", "modelLibrary", "uriBuilder" @param adapterCtor {Function} - an ctor function that returns an instance of the specified interface. **/ registerAdapter(interfaceName: AdapterType, adapterCtor: AdapterCtor): void; /** Returns the ctor function used to implement a specific interface with a specific adapter name. @method getAdapter @param interfaceName {String} One of the following interface names: "ajax", "dataService", "modelLibrary", "uriBuilder" @param [adapterName] {String} The name of any previously registered adapter. If this parameter is omitted then this method returns the "default" adapter for this interface. If there is no default adapter, then a null is returned. @return {Function|null} Returns either a ctor function or null. **/ getAdapter(interfaceName: AdapterType, adapterName: string): any; /** Initializes a single adapter implementation. Initialization means either newing a instance of the specified interface and then calling "initialize" on it or simply calling "initialize" on the instance if it already exists. @method initializeAdapterInstance @param interfaceName {String} The name of the interface to which the adapter to initialize belongs. @param adapterName {String} - The name of a previously registered adapter to initialize. @param [isDefault=true] {Boolean} - Whether to make this the default "adapter" for this interface. @return {an instance of the specified adapter} **/ initializeAdapterInstance(interfaceName: AdapterType, adapterName: string, isDefault?: boolean): BaseAdapter; /** Returns the adapter instance corresponding to the specified interface and adapter names. @method getAdapterInstance @param interfaceName {String} The name of the interface. @param [adapterName] {String} - The name of a previously registered adapter. If this parameter is omitted then the default implementation of the specified interface is returned. If there is no defaultInstance of this interface, then the first registered instance of this interface is returned. @return {an instance of the specified adapter} @internal **/ getAdapterInstance(interfaceName: AdapterType, adapterName?: string): T; /** this is needed for reflection purposes when deserializing an object that needs a fn or ctor. Used to register validators. */ registerFunction(fn: Function, fnName: string): void; registerType(ctor: Function, typeName: string): void; getRegisteredFunction(fnName: string): any; getInterfaceDef(interfaceName: string): InterfaceDef; /** @deprecated @internal no-op kept for backward compatibility */ setQ(q: any): void; /** @hidden @internal */ _storeObject(obj: Object, type: string | Function, name: string): void; /** @hidden @internal */ _fetchObject(type: string | Function, name: string): any; /** @hidden @internal */ _initializeAdapterInstanceCore(interfaceDef: InterfaceDef, impl: IDef, isDefault: boolean): T; } export declare const config: BreezeConfig;