import { LoginResponse } from '@/entities/user/model/types';
import type { DefaultEvents, EventEmitter } from '@webview-bridge/web';

export {};

declare module '*.svg' {
  import React = require('react');

  export const ReactComponent: React.SFC<React.SVGProps<SVGSVGElement>>;
  const src: string;
  export default src;
}

declare module '*.png';

declare module '*.scss' {
  const content: Record<string, string>;
  export = content;
}

declare module '*.css' {
  const css: string;
  export default css;
}

declare module 'lodash-es';

declare module '*.lottie';

declare global {
  interface Window {
    store: StoreApi<RootStore>;
    webViewBridge: {
      send<T = any, R = Promise<T>>(url: string, data?: any): Promise<R>;
    };
    __bridgeMethods__?: string[];

    __bridgeInitialState__?: Record<string, any>;
    nativeEmitter?: EventEmitter<DefaultEvents>;
    nativeBatchedEvents?: [string, ...any][];
    webEmitter?: EventEmitter<DefaultEvents>;
    ReactNativeWebView: {
      postMessage: (data: string) => void;
    };
    saveToken: (token: LoginResponse) => void; 
  }
}