import { type Dependencies, type ServiceInitializer, type ProviderInitializer } from 'knifecycle'; import { type JsonValue } from 'type-fest'; import { type BaseJSONSchema, type ArrayJSONSchema, type BooleanJSONSchema, type NullJSONSchema, type NumericJSONSchema, type TextJSONSchema, type ValueOnlyJSONSchema } from 'ya-json-schema-types'; import { type OpenAPIReference } from 'ya-open-api-types'; import { type WhookEnvironmentsConfig } from '../libs/environments.js'; import { type WhookSchemasDeclarationModule } from './base.js'; export declare const DEFAULT_COMMAND_CONFIG: WhookCommandConfig; export interface WhookBaseCommandConfig { environments?: WhookEnvironmentsConfig; promptArgs?: boolean; targetHandler?: string; wrappers?: string[]; } export type WhookCommandSchema = NullJSONSchema | (BaseJSONSchema & (ValueOnlyJSONSchema<'null' | 'boolean' | 'number' | 'integer' | 'string'> | TextJSONSchema | NumericJSONSchema | BooleanJSONSchema | ArrayJSONSchema<'null' | 'boolean' | 'number' | 'integer' | 'string'>)); export interface WhookCommandArgumentDefinition { name: string; description: string; required?: boolean; schema: WhookCommandSchema | OpenAPIReference; example?: T; } export interface WhookCommandConfig extends WhookBaseCommandConfig { } export interface WhookCommandDefinition { name: string; description: string; example: string; arguments: WhookCommandArgumentDefinition[]; config?: WhookCommandConfig; } export type WhookArgsTypes = string | boolean | number | string[] | boolean[] | number[]; export interface WhookCommandArgs = Record> { namedArguments: T; rest: string[]; command: string; } export type WhookCommandHandler = Record, D extends WhookCommandDefinition = WhookCommandDefinition> = (args: WhookCommandArgs, definition?: D) => Promise; export type WhookCommandInitializer, D extends Dependencies = Record> = ServiceInitializer> | ProviderInitializer>; export interface WhookCommandModule = Record> extends WhookSchemasDeclarationModule { default: WhookCommandInitializer; definition: WhookCommandDefinition; } export type WhookCommandHandlerWrapper> = (handler: WhookCommandHandler) => Promise>;