/**
 * This file was generated by @pikku/cli@0.12.23
 */
/**
 * Scheduler-specific type definitions for tree-shaking optimization
 */

import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
import type { PikkuFunctionConfig, PikkuMiddleware } from '../function/pikku-function-types.gen.js'

/**
 * Type definition for scheduled tasks that run at specified intervals.
 * These are sessionless functions that execute based on cron expressions.
 */
type SchedulerWiring = CoreScheduledTask<PikkuFunctionConfig<void, void, 'session' | 'rpc'>, PikkuMiddleware>

/**
 * Registers a scheduled task with the Pikku framework.
 * Tasks run based on cron expressions and are sessionless.
 *
 * @param task - Scheduled task definition with cron expression and handler
 */
export const wireScheduler = (task: SchedulerWiring) => {
  wireSchedulerCore(task as any)
}
