import type { NativeStackScreenProps } from '@react-navigation/native-stack';

// Pure stack model from PRD §5. Drawer affordance lives inside the
// NetworkList screen itself, not the navigator — see Drawer.tsx.
export type RootStackParamList = {
  SignIn: undefined;
  NetworkList: undefined;
  StreamList: { networkId: string };
  StreamView: { networkId: string; streamId: string };
  Huddle: {
    networkId: string;
    streamId: string;
    streamName: string;
    token: string;
    serverUrl: string;
  };
  NewStream: { networkId: string };
  Settings: undefined;
  Account: undefined;
};

export type RootStackScreenProps<T extends keyof RootStackParamList> =
  NativeStackScreenProps<RootStackParamList, T>;

declare global {
  namespace ReactNavigation {
    // React Navigation wires up typed navigation by merging into this global
    // interface. It must stay an `interface` (type aliases can't be augmented)
    // and is intentionally empty — it only re-exports our param list.
    // eslint-disable-next-line @typescript-eslint/no-empty-object-type
    interface RootParamList extends RootStackParamList {}
  }
}
