// This file is auto-generated by Laravel Wayfinder.
// Do not edit this file directly, any changes will be overwritten.

import { applyUrlDefaults, formSafeOptions, queryParams, type RouteDefinition, type RouteFormDefinition, type RouteQueryOptions } from "./../../index";
import localA914886 from "./local";

/**
 * @see /[serialized-closure]:2
 * @route "/storage/{path}"
 */
export const local = (args: { path: string | number } | [ path: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<"get"> => ({
    url: local.url(args, options),
    method: "get",
})

local.definition = {
    methods: ["get","head"],
    url: "/storage/{path}",
} satisfies RouteDefinition<["get","head"]>

/**
 * @see /[serialized-closure]:2
 * @route "/storage/{path}"
 */
local.url = (args: { path: string | number } | [ path: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === "string" || typeof args === "number") {
        args = { path: args }
    }
    
    if (Array.isArray(args)) {
        args = {
        path: args[0],
    }
    }
    
    args = applyUrlDefaults(args)
    
    const parsedArgs = {
        path: args.path,
    }
    
    return local.definition.url
        .replace("{path}", parsedArgs.path.toString())
        .replace(/\/+$/, "") + queryParams(options)
}

/**
 * @see /[serialized-closure]:2
 * @route "/storage/{path}"
 */
local.get = (args: { path: string | number } | [ path: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<"get"> => ({
    url: local.url(args, options),
    method: "get",
})

/**
 * @see /[serialized-closure]:2
 * @route "/storage/{path}"
 */
local.head = (args: { path: string | number } | [ path: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<"head"> => ({
    url: local.url(args, options),
    method: "head",
})



/**
 * @see /[serialized-closure]:2
 * @route "/storage/{path}"
 */
const localForm = (args: { path: string | number } | [ path: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<"get"> => ({
    action: local.url(args, options),
    method: "get",
})

/**
 * @see /[serialized-closure]:2
 * @route "/storage/{path}"
 */
localForm.get = (args: { path: string | number } | [ path: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<"get"> => ({
    action: local.url(args, options),
    method: "get",
})

/**
 * @see /[serialized-closure]:2
 * @route "/storage/{path}"
 */
localForm.head = (args: { path: string | number } | [ path: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<"get"> => ({
    action: local.url(args, formSafeOptions("head", options)),
    method: "get",
})



local.form = localForm

const storage = {
    local: Object.assign(local, localA914886),
}

export default storage