import { NgZone } from '@angular/core';
import { Observable } from 'rxjs';
import { Channel, ChannelResponse, ConnectAPIResponse, OwnUserResponse, StreamChatOptions, UserResponse } from 'stream-chat';
import { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';
import { NotificationService } from './notification.service';
import { DefaultStreamChatGenerics } from './types';
import * as i0 from "@angular/core";
export declare type ClientEvent<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
    eventType: string;
    event: Event<T>;
};
/**
 * The `ChatClient` service connects the user to the Stream chat.
 */
export declare class ChatClientService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
    private ngZone;
    private notificationService;
    /**
     * The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it.
     */
    chatClient: StreamChat<T>;
    /**
     * Emits [`ClientEvent`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client, user presence and notification events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript).
     * :::important
     * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.
     * :::
     */
    events$: Observable<ClientEvent<T>>;
    /**
     * Emits the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them.
     */
    appSettings$: Observable<AppSettings | undefined>;
    /**
     * Emits the current connection state of the user (`online` or `offline`)
     */
    connectionState$: Observable<'offline' | 'online'>;
    /**
     * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](../code-examples/channel-invites.mdx) guide.
     */
    pendingInvites$: Observable<(ChannelResponse<T> | Channel<T>)[]>;
    /**
     * Emits the current chat user
     */
    user$: Observable<OwnUserResponse<T> | UserResponse<T> | undefined>;
    private notificationSubject;
    private connectionStateSubject;
    private appSettingsSubject;
    private pendingInvitesSubject;
    private userSubject;
    private subscriptions;
    private trackPendingChannelInvites;
    constructor(ngZone: NgZone, notificationService: NotificationService);
    /**
     * Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.
     * @param apiKey
     * @param userOrId you can emit this for anonymous logins
     * @param userTokenOrProvider You can provide:<ul>
     *  <li> a token, </li>
     *  <li> a token provider, a method that returns `Promise<string>`, which can be called when the previous token expires (recommended setup for production applications)</li>
     *  <li> the keyword 'guest' to connect as [guest user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#guest-users) </li>
     *  <li> the keyword 'anonymous' to connect as [anonymous user](https://getstream.io/chat/docs/javascript/authless_users/?language=javascript#anonymous-users) </li>
     *  </ul>
     * @param clientOptions Setting to provide to the Stream client instance
     */
    init(apiKey: string, userOrId: string | OwnUserResponse<T> | UserResponse<T> | undefined, userTokenOrProvider: TokenOrProvider | 'anonymous' | 'guest', clientOptions?: StreamChatOptions & {
        trackPendingChannelInvites?: boolean;
    }): ConnectAPIResponse<T>;
    /**
     * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](./ChannelService.mdx/#reset).
     */
    disconnectUser(): Promise<void>;
    /**
     * Loads the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript), if the application settings have already been loaded, it does nothing.
     */
    getAppSettings(): Promise<void>;
    /**
     * Flag the message with the given ID. If you want to know [more about flags](https://getstream.io/chat/docs/javascript/moderation/?language=javascript) check out the platform documentation.
     * @param messageId
     */
    flagMessage(messageId: string): Promise<void>;
    /**
     * Searches for users in the application that have ID or name matching the provided search term
     * @param searchTerm
     * @returns The users matching the search
     */
    autocompleteUsers(searchTerm: string): Promise<UserResponse<T>[]>;
    private updatePendingInvites;
    private updateUser;
    static ɵfac: i0.ɵɵFactoryDeclaration<ChatClientService<any>, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ChatClientService<any>>;
}
