@quartal/bridge-client
Version:
Universal client library for embedding applications with URL-configurable transport support (iframe, postMessage) and framework adapters for Angular and Vue
59 lines • 2.28 kB
TypeScript
import { ParentClient, ParentCallbacks } from '../parent/parent-client';
import { ChildClient, ChildCallbacks } from '../child/child-client';
import { ParentClientConfig, ChildClientConfig, RouterAdapter, UserServiceAdapter, QuartalUser } from '../types';
export declare class AngularRouterAdapter implements RouterAdapter {
private router;
constructor(router: any);
navigate(route: string[] | string): Promise<boolean> | void;
getCurrentUrl(): string;
onUrlChange(callback: (url: string) => void): () => void;
}
export declare class AngularUserServiceAdapter implements UserServiceAdapter {
private userService;
constructor(userService: any);
getCurrentUser(): QuartalUser | null;
onUserChange(callback: (user: QuartalUser | null) => void): () => void;
}
export declare class QuartalAngularAdapter {
private parentClient?;
private childClient?;
private router?;
private userService?;
private routerAdapter?;
private userServiceAdapter?;
private logger;
constructor(router?: any, userService?: any, _storageService?: any);
/**
* Create parent client for Angular
*/
createParentClient(config: ParentClientConfig, callbacks?: ParentCallbacks): ParentClient;
/**
* Create child client for Angular with URL-based transport configuration
*/
createChildClient(config: ChildClientConfig, callbacks?: ChildCallbacks): ChildClient;
/**
* Create child client with explicit transport configuration (bypasses URL parsing)
*/
createChildClientWithTransport(config: ChildClientConfig, callbacks?: ChildCallbacks, transportType?: 'iframe' | 'postmessage', transportConfig?: any): ChildClient;
/**
* Internal method to create child client with transport (shared logic)
*/
private createChildClientInternal;
/**
* Get existing parent client
*/
getParentClient(): ParentClient | undefined;
/**
* Get existing child client
*/
getChildClient(): ChildClient | undefined;
/**
* Destroy clients and clean up
*/
destroy(): Promise<void>;
/**
* Reset for testing - destroy all clients and clear references
*/
resetForTesting(): Promise<void>;
}
//# sourceMappingURL=angular-adapter.d.ts.map