import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
import * as better_call from 'better-call';
import { z } from 'zod';
import { B as Board, C as Column, T as Task, d as ColumnWithTasks } from '../../../shared/stack.DKDMI-QO.js';

declare const createBoardSchema: z.ZodObject<{
    description: z.ZodOptional<z.ZodString>;
    name: z.ZodString;
    slug: z.ZodOptional<z.ZodString>;
    ownerId: z.ZodOptional<z.ZodString>;
    organizationId: z.ZodOptional<z.ZodString>;
    createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
}, z.core.$strip>;
declare const updateBoardSchema: z.ZodObject<{
    createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
    updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
    name: z.ZodOptional<z.ZodString>;
    slug: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
    ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
    organizationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
    id: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
}, z.core.$strip>;
declare const createColumnSchema: z.ZodObject<{
    title: z.ZodString;
    boardId: z.ZodString;
    createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
}, z.core.$strip>;
declare const updateColumnSchema: z.ZodObject<{
    createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
    updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
    title: z.ZodOptional<z.ZodString>;
    order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
    boardId: z.ZodOptional<z.ZodString>;
    id: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
}, z.core.$strip>;
declare const createTaskSchema: z.ZodObject<{
    title: z.ZodString;
    description: z.ZodOptional<z.ZodString>;
    createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
    completedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
        LOW: "LOW";
        MEDIUM: "MEDIUM";
        HIGH: "HIGH";
        URGENT: "URGENT";
    }>>>;
    columnId: z.ZodString;
    assigneeId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
    isArchived: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strip>;
declare const updateTaskSchema: z.ZodObject<{
    completedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
    createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
    updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
    title: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
    priority: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
        LOW: "LOW";
        MEDIUM: "MEDIUM";
        HIGH: "HIGH";
        URGENT: "URGENT";
    }>>>>;
    order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
    columnId: z.ZodOptional<z.ZodString>;
    assigneeId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
    isArchived: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
    id: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
}, z.core.$strip>;
declare const BoardListQuerySchema: z.ZodObject<{
    slug: z.ZodOptional<z.ZodString>;
    ownerId: z.ZodOptional<z.ZodString>;
    organizationId: z.ZodOptional<z.ZodString>;
    offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
    limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
}, z.core.$strip>;

/**
 * Context passed to kanban API hooks
 */
interface KanbanApiContext<TBody = unknown, TParams = unknown, TQuery = unknown> {
    body?: TBody;
    params?: TParams;
    query?: TQuery;
    request?: Request;
    headers?: Headers;
    [key: string]: unknown;
}
/**
 * Configuration hooks for kanban backend plugin
 * All hooks are optional and allow consumers to customize behavior
 */
interface KanbanBackendHooks {
    /**
     * Called before listing boards. Return false to deny access.
     */
    onBeforeListBoards?: (filter: z.infer<typeof BoardListQuerySchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before creating a board. Return false to deny access.
     */
    onBeforeCreateBoard?: (data: z.infer<typeof createBoardSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before reading a single board. Return false to deny access.
     */
    onBeforeReadBoard?: (boardId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before updating a board. Return false to deny access.
     */
    onBeforeUpdateBoard?: (boardId: string, data: z.infer<typeof updateBoardSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before deleting a board. Return false to deny access.
     */
    onBeforeDeleteBoard?: (boardId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called after boards are listed successfully
     */
    onBoardsRead?: (boards: Board[], filter: z.infer<typeof BoardListQuerySchema>, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a single board is read successfully
     */
    onBoardRead?: (board: Board, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a board is created successfully
     */
    onBoardCreated?: (board: Board, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a board is updated successfully
     */
    onBoardUpdated?: (board: Board, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a board is deleted successfully
     */
    onBoardDeleted?: (boardId: string, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called when listing boards fails
     */
    onListBoardsError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called when reading a single board fails
     */
    onReadBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called when creating a board fails
     */
    onCreateBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called when updating a board fails
     */
    onUpdateBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called when deleting a board fails
     */
    onDeleteBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called before creating a column. Return false to deny access.
     */
    onBeforeCreateColumn?: (data: z.infer<typeof createColumnSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before updating a column. Return false to deny access.
     */
    onBeforeUpdateColumn?: (columnId: string, data: z.infer<typeof updateColumnSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before deleting a column. Return false to deny access.
     */
    onBeforeDeleteColumn?: (columnId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called after a column is created successfully
     */
    onColumnCreated?: (column: Column, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a column is updated successfully
     */
    onColumnUpdated?: (column: Column, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a column is deleted successfully
     */
    onColumnDeleted?: (columnId: string, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called before creating a task. Return false to deny access.
     */
    onBeforeCreateTask?: (data: z.infer<typeof createTaskSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before updating a task. Return false to deny access.
     */
    onBeforeUpdateTask?: (taskId: string, data: z.infer<typeof updateTaskSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called before deleting a task. Return false to deny access.
     */
    onBeforeDeleteTask?: (taskId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
    /**
     * Called after a task is created successfully
     */
    onTaskCreated?: (task: Task, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a task is updated successfully
     */
    onTaskUpdated?: (task: Task, context: KanbanApiContext) => Promise<void> | void;
    /**
     * Called after a task is deleted successfully
     */
    onTaskDeleted?: (taskId: string, context: KanbanApiContext) => Promise<void> | void;
}
/**
 * Kanban backend plugin
 * Provides API endpoints for managing kanban boards, columns, and tasks
 *
 * @param hooks - Optional configuration hooks for customizing plugin behavior
 */
declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_plugins_api.BackendPlugin<{
    readonly listBoards: better_call.StrictEndpoint<"/boards", {
        method: "GET";
        query: z.ZodObject<{
            slug: z.ZodOptional<z.ZodString>;
            ownerId: z.ZodOptional<z.ZodString>;
            organizationId: z.ZodOptional<z.ZodString>;
            offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
            limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
        }, z.core.$strip>;
    }, {
        columns: {
            tasks: Task[];
            id: string;
            title: string;
            order: number;
            boardId: string;
            createdAt: Date;
            updatedAt: Date;
        }[];
        id: string;
        name: string;
        slug: string;
        description?: string;
        ownerId?: string;
        organizationId?: string;
        createdAt: Date;
        updatedAt: Date;
    }[]>;
    readonly getBoard: better_call.StrictEndpoint<"/boards/:id", {
        method: "GET";
    }, {
        columns: {
            tasks: Task[];
            id: string;
            title: string;
            order: number;
            boardId: string;
            createdAt: Date;
            updatedAt: Date;
        }[];
        id: string;
        name: string;
        slug: string;
        description?: string;
        ownerId?: string;
        organizationId?: string;
        createdAt: Date;
        updatedAt: Date;
    }>;
    readonly createBoard: better_call.StrictEndpoint<"/boards", {
        method: "POST";
        body: z.ZodObject<{
            description: z.ZodOptional<z.ZodString>;
            name: z.ZodString;
            slug: z.ZodOptional<z.ZodString>;
            ownerId: z.ZodOptional<z.ZodString>;
            organizationId: z.ZodOptional<z.ZodString>;
            createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
            updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
        }, z.core.$strip>;
    }, {
        columns: ColumnWithTasks[];
        id: string;
        name: string;
        slug: string;
        description?: string;
        ownerId?: string;
        organizationId?: string;
        createdAt: Date;
        updatedAt: Date;
    }>;
    readonly updateBoard: better_call.StrictEndpoint<"/boards/:id", {
        method: "PUT";
        body: z.ZodObject<{
            description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
            name: z.ZodOptional<z.ZodString>;
            slug: z.ZodOptional<z.ZodString>;
            ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
            organizationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
            createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
            updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
        }, z.core.$strip>;
    }, Board>;
    readonly deleteBoard: better_call.StrictEndpoint<"/boards/:id", {
        method: "DELETE";
    }, {
        success: boolean;
    }>;
    readonly createColumn: better_call.StrictEndpoint<"/columns", {
        method: "POST";
        body: z.ZodObject<{
            title: z.ZodString;
            boardId: z.ZodString;
            createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
            updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
            order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
        }, z.core.$strip>;
    }, Column>;
    readonly updateColumn: better_call.StrictEndpoint<"/columns/:id", {
        method: "PUT";
        body: z.ZodObject<{
            title: z.ZodOptional<z.ZodString>;
            boardId: z.ZodOptional<z.ZodString>;
            createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
            updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
            order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
        }, z.core.$strip>;
    }, Column>;
    readonly deleteColumn: better_call.StrictEndpoint<"/columns/:id", {
        method: "DELETE";
    }, {
        success: boolean;
    }>;
    readonly reorderColumns: better_call.StrictEndpoint<"/columns/reorder", {
        method: "POST";
        body: z.ZodObject<{
            boardId: z.ZodString;
            columnIds: z.ZodArray<z.ZodString>;
        }, z.core.$strip>;
    }, {
        success: boolean;
    }>;
    readonly createTask: better_call.StrictEndpoint<"/tasks", {
        method: "POST";
        body: z.ZodObject<{
            title: z.ZodString;
            description: z.ZodOptional<z.ZodString>;
            createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
            updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
            order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
            completedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
            priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
                LOW: "LOW";
                MEDIUM: "MEDIUM";
                HIGH: "HIGH";
                URGENT: "URGENT";
            }>>>;
            columnId: z.ZodString;
            assigneeId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
            isArchived: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
        }, z.core.$strip>;
    }, Task>;
    readonly updateTask: better_call.StrictEndpoint<"/tasks/:id", {
        method: "PUT";
        body: z.ZodObject<{
            title: z.ZodOptional<z.ZodString>;
            description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
            createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
            updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
            order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
            completedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
            priority: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
                LOW: "LOW";
                MEDIUM: "MEDIUM";
                HIGH: "HIGH";
                URGENT: "URGENT";
            }>>>>;
            columnId: z.ZodOptional<z.ZodString>;
            assigneeId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
            isArchived: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
        }, z.core.$strip>;
    }, Task>;
    readonly deleteTask: better_call.StrictEndpoint<"/tasks/:id", {
        method: "DELETE";
    }, {
        success: boolean;
    }>;
    readonly moveTask: better_call.StrictEndpoint<"/tasks/move", {
        method: "POST";
        body: z.ZodObject<{
            taskId: z.ZodString;
            targetColumnId: z.ZodString;
            targetOrder: z.ZodNumber;
        }, z.core.$strip>;
    }, Task>;
    readonly reorderTasks: better_call.StrictEndpoint<"/tasks/reorder", {
        method: "POST";
        body: z.ZodObject<{
            columnId: z.ZodString;
            taskIds: z.ZodArray<z.ZodString>;
        }, z.core.$strip>;
    }, {
        success: boolean;
    }>;
}>;
type KanbanApiRouter = ReturnType<ReturnType<typeof kanbanBackendPlugin>["routes"]>;

export { kanbanBackendPlugin };
export type { KanbanApiContext, KanbanApiRouter, KanbanBackendHooks };
