/** * file() resource — manage files on target hosts. * * Supports content (inline string), source (local file transfer), and * template (TypeScript function) modes. Compares SHA-256 checksums to * detect drift. */ import type { ExecutionContext, ResourceCallMeta, ResourceDefinition, ResourceSchema, TemplateContext } from "../core/types.ts"; /** Input options for the file resource. */ export type FileInput = { /** Absolute path on the remote host. */ path: string; /** Inline content to write. */ content?: string | undefined; /** Local file path to transfer via scp. */ source?: string | undefined; /** Template function that returns content string. */ template?: ((vars: TemplateContext) => string) | undefined; /** File mode (e.g. "0644"). */ mode?: string | undefined; /** Owner user. */ owner?: string | undefined; /** Owner group. */ group?: string | undefined; /** Whether the file should exist. Default: 'present'. */ state?: "present" | "absent" | undefined; }; /** Output of a successful file resource. */ export type FileOutput = { path: string; checksum: string; changed: boolean; }; /** Schema for the file resource. */ export declare const fileSchema: ResourceSchema; /** ResourceDefinition for file. */ export declare const fileDefinition: ResourceDefinition; /** * Create a bound `file()` function for a given execution context. * * Usage in recipes: * ```ts * const file = createFile(ctx) * await file({ path: '/etc/nginx/nginx.conf', content: configStr, mode: '0644' }) * ``` */ export declare function createFile(ctx: ExecutionContext): (input: FileInput, meta?: ResourceCallMeta) => Promise>; //# sourceMappingURL=file.d.ts.map