/**
 * WordPress Media Types
 *
 * Shared types for WordPress media library integration.
 */

export interface MediaAttachment {
  id: number;
  url: string;
  alt: string;
  title: string;
  width?: number;
  height?: number;
  mime?: string;
}

// Extend window type for WordPress media
declare global {
  interface Window {
    wp?: {
      media: (options: {
        title: string;
        library: {type: string};
        multiple: boolean;
      }) => {
        open: () => void;
        on: (event: string, callback: () => void) => void;
        state: () => {
          get: (key: string) => {
            first: () => {
              toJSON: () => MediaAttachment;
            };
          };
        };
      };
    };
  }
}
