interface Ssr {
    id?: string
    path: string
    content: string
}

interface ApiOptions {
    method?: string
    filter?: any
    sort?: string
    lookup?: string
    limit?: number
    offset?: number
    projection?: string
    noError?: boolean
    headers?: {
        [key: string]: string
    }
    params?: {
        [key: string]: string
    }
    useJwt?: boolean
    jwtToUse?: string
    onDownloadProgress?: Function
    onUploadProgress?: Function
}

type SidebarOverlay = {
    type: "cart"
    show: boolean
    properties: {
        blackArea: {
            type: "recommendedProducts"
        }
    }
}

interface NotificationEntry {
    html: string
    class: "info" | "success" | "warning" | "error"
    timeout?: number
    removeOnNewLocation?: boolean
    blockUI?: boolean
}

interface LocationStore {
    path: string
    search: string
    hash: string
    push: boolean
    pop: boolean
    url: string
    previousLocation?: LocationStore
}

interface ApiResult<T> {
    data: T
    count: number
}

interface MedialibEntry {
    id?: string
    title: string
    file: FileField
    alt?: string
    tags?: string[]
    type?: "websiteContent"
}

interface FileField {
    path: string
    src: string
    type: string
    size: number
}

interface DummyCartEndpoint {
    operation: "add" | "update" | "delete"
    cartId: string
    entityId?: string
    lineItem?: {
        product_id: string
        variant_id: string
        quantity: number
    }
    lineItems?: {
        product_id: string
        variant_id: string
        quantity: number
    }[]
}

type CollectionName =
    | "medialib"
    | "content"
    | "navigation"
    | "tag"
    | "dummyCartEndpoint"
    | "bannerSlide"
    | "productBenefit"
    | "qrCode"
    | "selfImprovementChapter"
    | "rating"
    | "bigCommerceProduct"
    | "selfImprovementChallenge"

interface ProductBenefit {
    title: string
    description: string
    id: string
}

interface MediaQueryInputObject {
    [mediaQuery: string]: [SvelteComponent, Object]
}
interface SocialMediaLinks {
    instagramLink?: string
    facebookLink?: string
    twitterLink?: string
    tiktokLink?: string
    youtubeLink?: string
}

interface Customer {
    socialMediaAccounts: SocialMediaLinks
}

interface SocialMediaLink {
    name: string
    link: keyof SocialMediaLinks
    icon: string
}

interface StateHistory {
    state: string
    date: Date
    active: boolean
    icon: any
    note?: string
    links?: {
        link: string
        text: string
    }[]
}

interface Module {
    type: "sizeLabel"
    label: string
    germanLabelTranslation: string
}

interface StoreStatus {
    status: "open" | "login"
    password: string
    loggedIn?: boolean
}

interface SelfImprovementChapter {
    type: number
    title: string
    alias: string
    color: string
    shortDescription: string
    description: string
    previewVideo: string
    previewImage: string
    locked: boolean
    challengePosts: string[]
}
interface ActionApproval {
    modalTitle: string
    modalText: string
    callback: () => void
}
interface ResponseAudioDelta {
    response_id: string
    item_id: string
    delta: string
    pcmInt16: Int16Array
}
