import type { Manifest, Solution } from './manifest.js' export type SolutionContext = { solutionUsage: Solution solutionDefinition: SolutionDefinition glob: (pattern: string) => string[] readStringFile: (relativePath: string) => Promise writeStringFile: (relativePath: string, content: string) => Promise readYamlFile: >(relativePath: string) => Promise writeYamlFile: >( relativePath: string, data: T, ) => Promise copyDir: (from: string, to: string) => Promise runCommand: (command: string, argv: string[]) => Promise addEntrypoint: (entrypoint: string) => string importModule: (modulePath: string) => Promise } export type SolutionScriptFunction = { run: >(params: TParams) => Promise description?: string parameters?: { [key: string]: { type: 'string' | 'number' | 'boolean' | 'json' | 'enum' examples?: string[] acceptedValues?: any[] description?: string required?: boolean } } } export type Hook = { for: 'pre-deploy' | 'post-deploy' | 'pre-backfill' | 'post-backfill' id: string title: string run: < TParams = { autoApprove?: boolean }, >( parameters?: TParams, ) => Promise } export type SolutionDefinition> = { prepareManifest?: ( context: SolutionContext, config: TSolutionConfig, manifest: Manifest, ) => Promise registerScripts?: ( context: SolutionContext, config: TSolutionConfig, manifest: Manifest, ) => Record registerHooks?: ( context: SolutionContext, config: TSolutionConfig, manifest: Manifest, ) => Promise }