API reference@effx/compilerlift
patch
API reference for @effx/compiler/lift/patch
patch.ts overview
Exports Grouped by Category
utils
AppliedSourceFile (interface)
A verified source file after applying every refactor assigned to it in memory.
Signature
export interface AppliedSourceFile {
readonly file: string
readonly contents: string
}PatchInput (interface)
Signature
export interface PatchInput {
readonly refactors: ReadonlyArray<Refactor>
/** Every analyzed file the refactors touch, as the model recorded it. */
readonly files: ReadonlyArray<SourceFileRecord>
/** The exact analyzed text of each file, by SourceFileRecord.file. */
readonly texts: ReadonlyMap<string, string>
/** Whether new relative imports end in .ts (otherwise .js), as in generated imports. */
readonly allowImportingTsExtensions: boolean
}applyRefactors
Verified refactor results for an isolated overlay; this function never writes files.
Signature
declare const applyRefactors: (
input: PatchInput
) => Effect.Effect<Array<{ file: string; contents: string }>, CompilerFault, Crypto.Crypto>renderPatch
The unified diff of every refactor, or a CompilerFault when a file is missing, stale or edits cannot be placed.
Signature
declare const renderPatch: (input: PatchInput) => Effect.Effect<string, CompilerFault, Crypto.Crypto>