export class StubProjectConfigGateway {
    store = new Map();
    malformedPaths = new Set();
    ioErrorEnabled = false;
    ioErrorReason = 'simulated write failure';
    set(path, config) {
        this.store.set(path, { ...config });
    }
    get(path) {
        const stored = this.store.get(path);
        return stored ? { ...stored } : undefined;
    }
    forceMalformed(path) {
        this.malformedPaths.add(path);
    }
    forceIoError(reason) {
        this.ioErrorEnabled = true;
        if (reason !== undefined) {
            this.ioErrorReason = reason;
        }
    }
    read(path) {
        if (this.malformedPaths.has(path)) {
            return { status: 'malformed' };
        }
        const stored = this.store.get(path);
        if (!stored) {
            return { status: 'not-found' };
        }
        return { status: 'ok', config: { ...stored } };
    }
    write(path, config) {
        if (this.ioErrorEnabled) {
            return { ok: false, reason: this.ioErrorReason };
        }
        this.store.set(path, { ...config });
        return { ok: true };
    }
}
//# sourceMappingURL=projectConfigGateway.stub.js.map