import type { CreateHelperOptions, Helper } from "../../pipeline/dist/index.js"; import { Reporter } from '../../core/dist/reporter'; import { PhpAstContext, PhpAstContextEntry } from './context'; import { PhpAstBuilder, PhpFileMetadata } from './types'; export { createHelper } from "../../pipeline/dist/index.js"; export { CreateHelperOptions, Helper, HelperApplyFn, HelperApplyOptions, HelperDescriptor, HelperKind, HelperMode, } from "../../pipeline/dist/index.js"; export type PipelinePhase = 'init' | 'generate' | 'apply' | `custom:${string}`; export interface WorkspaceWriteOptions { readonly mode?: number; readonly ensureDir?: boolean; } export interface Workspace { readonly root: string; cwd: () => string; resolve: (...parts: string[]) => string; write: (file: string, contents: Buffer | string, options?: WorkspaceWriteOptions) => Promise; exists: (target: string) => Promise; } export interface PipelineContext { readonly workspace: Workspace; readonly phase: PipelinePhase; readonly reporter: Reporter; } export interface BuilderWriteAction { readonly file: string; readonly contents: Buffer | string; } export interface BuilderOutput { readonly actions: BuilderWriteAction[]; queueWrite: (action: BuilderWriteAction) => void; } export interface BuilderInput { readonly phase: PipelinePhase; readonly options: unknown; readonly ir: unknown | null; } export type BuilderHelper = Helper; export { getPhpBuilderChannel, resetPhpBuilderChannel } from './builderChannel'; export { PhpBuilderChannel, PhpProgramAction } from "./builderChannel"; export interface PhpAstBuilderAdapter extends PhpAstBuilder { readonly context: PhpAstContext; } export interface CreatePhpProgramBuilderOptions extends Pick, 'dependsOn' | 'mode' | 'priority' | 'origin'> { readonly key: string; readonly filePath: string; readonly namespace: string; readonly metadata: PhpFileMetadata; readonly build: (builder: PhpAstBuilderAdapter, entry: PhpAstContextEntry) => Promise | void; } export declare function createPhpProgramBuilder(options: CreatePhpProgramBuilderOptions): BuilderHelper; export interface CreatePhpFileBuilderOptions extends Omit, 'build'> { readonly build: (builder: PhpAstBuilderAdapter, entry: PhpAstContextEntry) => Promise | void; } export declare function createPhpFileBuilder(options: CreatePhpFileBuilderOptions): BuilderHelper; export type PhpFileAst = { namespace: string; docblock: string[]; uses: string[]; statements: string[]; }; export declare function resetPhpProgramBuilderContext(context: PipelineContext): void;