(origin_path: string): string Creates a file banner comment.
origin_path
stringreturns
string 5 declarations
(origin_path: string): string Creates a file banner comment.
origin_pathstringstring (spec: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }, executor: "frontend" | "backend", imports: ImportBuilder): string Generates the phase handlers for an action spec using the unified ActionEvent type with the new phase/step type parameters.
spec{ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }executor"frontend" | "backend"importsstring (spec: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }, executor: "frontend" | "backend"): ("send_request" | ... 7 more ... | "execute")[] Determines which phases an executor can handle based on the action spec.
spec{ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }executor"frontend" | "backend"("send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute")[] (spec: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }, phase: "send_request" | ... 7 more ... | "execute", imports: ImportBuilder, path_prefix: string): string Gets the handler return type for a specific phase and spec. Also adds necessary imports to the ImportBuilder.
spec{ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }phase"send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"importspath_prefixstringstring Manages imports for generated code, building them on demand.
Automatically optimizes type-only imports to use import type syntax.
Why this matters:
- import type statements are completely removed during compilation
- Mixed imports like import { type A, B } cannot be safely removed
- This ensures optimal tree-shaking and smaller bundle sizes
importstype Map<string, Map<string, ImportItem>>
addAdd a value import to be included in the generated code.
type (from: string, what: string): this
fromThe module to import from
stringwhatWhat to import (value)
stringthisadd_typeAdd a type import to be included in the generated code.
type (from: string, what: string): this
fromThe module to import from
stringwhatWhat to import (type)
stringthisadd_manyAdd multiple value imports from the same module.
type (from: string, ...items: string[]): this
fromstringitemsstring[]thisadd_typesAdd multiple type imports from the same module.
type (from: string, ...items: string[]): this
fromstringitemsstring[]thisbuildGenerate the import statements.
If all imports from a module are types, uses import type syntax.
type (): string
stringhas_importsCheck if the builder has any imports.
type (): boolean
booleanpreviewPreview what imports will be generated (useful for debugging).
type (): string[]
string[]Array of import statement strings
clearClear all imports.
type (): this
this