GitRoot

Craft your forge, Build your project, Grow your community freely
 1// SPDX-FileCopyrightText: 2025 Romain Maneschi <romain@gitroot.dev>
 2//
 3// SPDX-License-Identifier: MIT
 4
 5import { FS } from "../fs";
 6import { Commit } from "./commit";
 7import { Exec, ExecStatus } from "./exec";
 8import { ForgeConf } from "./forgeconf";
 9
10export type exportFuncCallback = (
11  args: Map<string, string>,
12) => Map<string, string>;
13
14export interface Server {
15  forgeConf(): ForgeConf;
16  worktree(): FS;
17  webcontent(): FS;
18  cache(): FS;
19  commitAllIfNeeded(message: string): void;
20  diffWithParent(
21    hash: string,
22    oldFilepath: string,
23    newFilepath: string,
24  ): string;
25  log(message: string): void;
26  logError(message: string, err: string): void;
27  merge(from: string, to: string): void;
28  commits(from: string, to: string): Array<Commit>;
29  exec(exec: Exec): ExecStatus;
30  report(level: string, content: Array<string>): void;
31  canCallFunc(plugin: string, name: string, args: Map<string, string>): bool;
32  exportFunc(name: string, callback: exportFuncCallback): void;
33  callFunc(plugin: string, name: string, args: Map<string, string>): ExecStatus;
34}