use super::*;

pub(super) const MEDIA_ROWS: &[NativeModSig] = &[
    // ========== sharp ==========
    // Factory: sharp(path) → js_sharp_from_file. Instance methods take
    // Handle (i64), compatible with the has_receiver:true dispatch path.
    NativeModSig {
        module: "sharp",
        has_receiver: false,
        method: "default",
        class_filter: None,
        runtime: "js_sharp_from_file",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: false,
        method: "sharp",
        class_filter: None,
        runtime: "js_sharp_from_file",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "resize",
        class_filter: None,
        runtime: "js_sharp_resize",
        args: &[NA_F64, NA_F64],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "rotate",
        class_filter: None,
        runtime: "js_sharp_rotate",
        args: &[NA_F64],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "flip",
        class_filter: None,
        runtime: "js_sharp_flip",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "flop",
        class_filter: None,
        runtime: "js_sharp_flop",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "grayscale",
        class_filter: None,
        runtime: "js_sharp_grayscale",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "blur",
        class_filter: None,
        runtime: "js_sharp_blur",
        args: &[NA_F64],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "jpeg",
        class_filter: None,
        runtime: "js_sharp_jpeg",
        args: &[NA_F64],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "png",
        class_filter: None,
        runtime: "js_sharp_png",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "webp",
        class_filter: None,
        runtime: "js_sharp_webp",
        args: &[NA_F64],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "toFile",
        class_filter: None,
        runtime: "js_sharp_to_file",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "toBuffer",
        class_filter: None,
        runtime: "js_sharp_to_buffer",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "metadata",
        class_filter: None,
        runtime: "js_sharp_metadata",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "width",
        class_filter: None,
        runtime: "js_sharp_width",
        args: &[],
        ret: NR_F64,
    },
    NativeModSig {
        module: "sharp",
        has_receiver: true,
        method: "height",
        class_filter: None,
        runtime: "js_sharp_height",
        args: &[],
        ret: NR_F64,
    },
    // ========== cheerio ==========
    // cheerio.load(html) → doc handle (NR_PTR). Instance methods take Handle (i64).
    NativeModSig {
        module: "cheerio",
        has_receiver: false,
        method: "load",
        class_filter: None,
        runtime: "js_cheerio_load",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "select",
        class_filter: None,
        runtime: "js_cheerio_select",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "text",
        class_filter: None,
        runtime: "js_cheerio_selection_text",
        args: &[],
        ret: NR_STR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "html",
        class_filter: None,
        runtime: "js_cheerio_selection_html",
        args: &[],
        ret: NR_STR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "attr",
        class_filter: None,
        runtime: "js_cheerio_selection_attr",
        args: &[NA_STR],
        ret: NR_STR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "length",
        class_filter: None,
        runtime: "js_cheerio_selection_length",
        args: &[],
        ret: NR_F64,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "first",
        class_filter: None,
        runtime: "js_cheerio_selection_first",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "last",
        class_filter: None,
        runtime: "js_cheerio_selection_last",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "eq",
        class_filter: None,
        runtime: "js_cheerio_selection_eq",
        args: &[NA_F64],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "find",
        class_filter: None,
        runtime: "js_cheerio_selection_find",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "children",
        class_filter: None,
        runtime: "js_cheerio_selection_children",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "parent",
        class_filter: None,
        runtime: "js_cheerio_selection_parent",
        args: &[],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cheerio",
        has_receiver: true,
        method: "hasClass",
        class_filter: None,
        runtime: "js_cheerio_selection_has_class",
        args: &[NA_STR],
        ret: NR_F64,
    },
    // ========== zlib ==========
    NativeModSig {
        module: "zlib",
        has_receiver: false,
        method: "gzipSync",
        class_filter: None,
        runtime: "js_zlib_gzip_sync",
        args: &[NA_STR],
        ret: NR_STR,
    },
    NativeModSig {
        module: "zlib",
        has_receiver: false,
        method: "gunzipSync",
        class_filter: None,
        runtime: "js_zlib_gunzip_sync",
        args: &[NA_STR],
        ret: NR_STR,
    },
    NativeModSig {
        module: "zlib",
        has_receiver: false,
        method: "deflateSync",
        class_filter: None,
        runtime: "js_zlib_deflate_sync",
        args: &[NA_STR],
        ret: NR_STR,
    },
    NativeModSig {
        module: "zlib",
        has_receiver: false,
        method: "inflateSync",
        class_filter: None,
        runtime: "js_zlib_inflate_sync",
        args: &[NA_STR],
        ret: NR_STR,
    },
    NativeModSig {
        module: "zlib",
        has_receiver: false,
        method: "gzip",
        class_filter: None,
        runtime: "js_zlib_gzip",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "zlib",
        has_receiver: false,
        method: "gunzip",
        class_filter: None,
        runtime: "js_zlib_gunzip",
        args: &[NA_STR],
        ret: NR_PTR,
    },
    // `zlib.createBrotliDecompress(options?)` — axios feature-checks
    // this at module init. The runtime stub returns a registered
    // Buffer-shaped handle (NaN-boxed as a pointer) so callers see
    // a truthy non-null object; the real Brotli decode path is a
    // follow-up. `options` is NaN-boxed as f64.
    NativeModSig {
        module: "zlib",
        has_receiver: false,
        method: "createBrotliDecompress",
        class_filter: None,
        runtime: "js_zlib_create_brotli_decompress",
        args: &[NA_F64],
        ret: NR_PTR,
    },
    // ========== cron ==========
    // schedule() returns a Handle (i64) → NR_PTR. Instance methods take Handle (i64).
    // Callback arg uses NA_JSV (bitcast) to pass the full NaN-boxed closure i64.
    NativeModSig {
        module: "cron",
        has_receiver: false,
        method: "validate",
        class_filter: None,
        runtime: "js_cron_validate",
        args: &[NA_STR],
        ret: NR_F64,
    },
    NativeModSig {
        module: "cron",
        has_receiver: false,
        method: "schedule",
        class_filter: None,
        runtime: "js_cron_schedule",
        args: &[NA_STR, NA_JSV],
        ret: NR_PTR,
    },
    NativeModSig {
        module: "cron",
        has_receiver: false,
        method: "describe",
        class_filter: None,
        runtime: "js_cron_describe",
        args: &[NA_STR],
        ret: NR_STR,
    },
    NativeModSig {
        module: "cron",
        has_receiver: true,
        method: "start",
        class_filter: None,
        runtime: "js_cron_job_start",
        args: &[],
        ret: NR_VOID,
    },
    NativeModSig {
        module: "cron",
        has_receiver: true,
        method: "stop",
        class_filter: None,
        runtime: "js_cron_job_stop",
        args: &[],
        ret: NR_VOID,
    },
    NativeModSig {
        module: "cron",
        has_receiver: true,
        method: "isRunning",
        class_filter: None,
        runtime: "js_cron_job_is_running",
        args: &[],
        ret: NR_F64,
    },
    NativeModSig {
        module: "cron",
        has_receiver: true,
        method: "nextDate",
        class_filter: None,
        runtime: "js_cron_next_date",
        args: &[],
        ret: NR_STR,
    },
];
