export type Status = 'completed'
| 'expired'
| 'excluded'
| 'failed'
| 'invalid'
| 'paused'
| 'unavailable'
| 'unprocessed'
| 'unreachable'
| 'pending'
| 'error'

export interface CriticalCSSResponse {
  status: Status
  generated_time?: string
  critical_css?: boolean
}

export type SettingsSchemaObject = {
  type: 'select' | 'text' | 'textarea' | 'checkbox'
  label: string | Record<string, string>
  options?: Record<string, string>
  default: string | boolean
  desc?: string | Record<string, string>
  visible?: Record<string, string | boolean>
}

export type SettingsSchema = Record<string, SettingsSchemaObject>

export type SettingsObject = Record<string, string | boolean>

declare global {
  const eccSettings: {
    settingsSchema: SettingsSchema
    settings: SettingsObject
    mode: string
    secondaryBehavior: string
    pluginVersion: string
    postUrl: string
    userEmail: string
  }
}
