/* eslint-disable */
// @generated by protobuf-ts 2.11.1 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
// @generated from protobuf file "runme/project/v1/project.proto" (package "runme.project.v1", syntax proto3)
// tslint:disable
// @ts-nocheck
/* eslint-disable */
// @generated by protobuf-ts 2.11.1 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
// @generated from protobuf file "runme/project/v1/project.proto" (package "runme.project.v1", syntax proto3)
// tslint:disable
// @ts-nocheck
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { RunmeIdentity } from "../../parser/v1/parser_pb";
/**
 * @generated from protobuf enum runme.project.v1.LoadEventType
 */
export var LoadEventType;
(function (LoadEventType) {
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_UNSPECIFIED = 0;
     */
    LoadEventType[LoadEventType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_STARTED_WALK = 1;
     */
    LoadEventType[LoadEventType["STARTED_WALK"] = 1] = "STARTED_WALK";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_FOUND_DIR = 2;
     */
    LoadEventType[LoadEventType["FOUND_DIR"] = 2] = "FOUND_DIR";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_FOUND_FILE = 3;
     */
    LoadEventType[LoadEventType["FOUND_FILE"] = 3] = "FOUND_FILE";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_FINISHED_WALK = 4;
     */
    LoadEventType[LoadEventType["FINISHED_WALK"] = 4] = "FINISHED_WALK";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_STARTED_PARSING_DOC = 5;
     */
    LoadEventType[LoadEventType["STARTED_PARSING_DOC"] = 5] = "STARTED_PARSING_DOC";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_FINISHED_PARSING_DOC = 6;
     */
    LoadEventType[LoadEventType["FINISHED_PARSING_DOC"] = 6] = "FINISHED_PARSING_DOC";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_FOUND_TASK = 7;
     */
    LoadEventType[LoadEventType["FOUND_TASK"] = 7] = "FOUND_TASK";
    /**
     * @generated from protobuf enum value: LOAD_EVENT_TYPE_ERROR = 8;
     */
    LoadEventType[LoadEventType["ERROR"] = 8] = "ERROR";
})(LoadEventType || (LoadEventType = {}));
// @generated message type with reflection information, may provide speed optimized methods
class DirectoryProjectOptions$Type extends MessageType {
    constructor() {
        super("runme.project.v1.DirectoryProjectOptions", [
            { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "skip_gitignore", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 3, name: "ignore_file_patterns", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "skip_repo_lookup_upward", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.path = "";
        message.skipGitignore = false;
        message.ignoreFilePatterns = [];
        message.skipRepoLookupUpward = false;
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string path */ 1:
                    message.path = reader.string();
                    break;
                case /* bool skip_gitignore */ 2:
                    message.skipGitignore = reader.bool();
                    break;
                case /* repeated string ignore_file_patterns */ 3:
                    message.ignoreFilePatterns.push(reader.string());
                    break;
                case /* bool skip_repo_lookup_upward */ 4:
                    message.skipRepoLookupUpward = reader.bool();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string path = 1; */
        if (message.path !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.path);
        /* bool skip_gitignore = 2; */
        if (message.skipGitignore !== false)
            writer.tag(2, WireType.Varint).bool(message.skipGitignore);
        /* repeated string ignore_file_patterns = 3; */
        for (let i = 0; i < message.ignoreFilePatterns.length; i++)
            writer.tag(3, WireType.LengthDelimited).string(message.ignoreFilePatterns[i]);
        /* bool skip_repo_lookup_upward = 4; */
        if (message.skipRepoLookupUpward !== false)
            writer.tag(4, WireType.Varint).bool(message.skipRepoLookupUpward);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.DirectoryProjectOptions
 */
export const DirectoryProjectOptions = new DirectoryProjectOptions$Type();
// @generated message type with reflection information, may provide speed optimized methods
class FileProjectOptions$Type extends MessageType {
    constructor() {
        super("runme.project.v1.FileProjectOptions", [
            { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.path = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string path */ 1:
                    message.path = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string path = 1; */
        if (message.path !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.path);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.FileProjectOptions
 */
export const FileProjectOptions = new FileProjectOptions$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadRequest$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadRequest", [
            { no: 1, name: "directory", kind: "message", oneof: "kind", T: () => DirectoryProjectOptions },
            { no: 2, name: "file", kind: "message", oneof: "kind", T: () => FileProjectOptions },
            { no: 3, name: "identity", kind: "enum", T: () => ["runme.parser.v1.RunmeIdentity", RunmeIdentity, "RUNME_IDENTITY_"] }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.kind = { oneofKind: undefined };
        message.identity = 0;
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.project.v1.DirectoryProjectOptions directory */ 1:
                    message.kind = {
                        oneofKind: "directory",
                        directory: DirectoryProjectOptions.internalBinaryRead(reader, reader.uint32(), options, message.kind.directory)
                    };
                    break;
                case /* runme.project.v1.FileProjectOptions file */ 2:
                    message.kind = {
                        oneofKind: "file",
                        file: FileProjectOptions.internalBinaryRead(reader, reader.uint32(), options, message.kind.file)
                    };
                    break;
                case /* runme.parser.v1.RunmeIdentity identity */ 3:
                    message.identity = reader.int32();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.project.v1.DirectoryProjectOptions directory = 1; */
        if (message.kind.oneofKind === "directory")
            DirectoryProjectOptions.internalBinaryWrite(message.kind.directory, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.FileProjectOptions file = 2; */
        if (message.kind.oneofKind === "file")
            FileProjectOptions.internalBinaryWrite(message.kind.file, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* runme.parser.v1.RunmeIdentity identity = 3; */
        if (message.identity !== 0)
            writer.tag(3, WireType.Varint).int32(message.identity);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadRequest
 */
export const LoadRequest = new LoadRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventStartedWalk$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventStartedWalk", []);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventStartedWalk
 */
export const LoadEventStartedWalk = new LoadEventStartedWalk$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventFoundDir$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventFoundDir", [
            { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.path = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string path */ 1:
                    message.path = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string path = 1; */
        if (message.path !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.path);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventFoundDir
 */
export const LoadEventFoundDir = new LoadEventFoundDir$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventFoundFile$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventFoundFile", [
            { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.path = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string path */ 1:
                    message.path = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string path = 1; */
        if (message.path !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.path);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventFoundFile
 */
export const LoadEventFoundFile = new LoadEventFoundFile$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventFinishedWalk$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventFinishedWalk", []);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventFinishedWalk
 */
export const LoadEventFinishedWalk = new LoadEventFinishedWalk$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventStartedParsingDoc$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventStartedParsingDoc", [
            { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.path = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string path */ 1:
                    message.path = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string path = 1; */
        if (message.path !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.path);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventStartedParsingDoc
 */
export const LoadEventStartedParsingDoc = new LoadEventStartedParsingDoc$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventFinishedParsingDoc$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventFinishedParsingDoc", [
            { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.path = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string path */ 1:
                    message.path = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string path = 1; */
        if (message.path !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.path);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventFinishedParsingDoc
 */
export const LoadEventFinishedParsingDoc = new LoadEventFinishedParsingDoc$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventFoundTask$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventFoundTask", [
            { no: 1, name: "document_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "is_name_generated", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.documentPath = "";
        message.id = "";
        message.name = "";
        message.isNameGenerated = false;
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string document_path */ 1:
                    message.documentPath = reader.string();
                    break;
                case /* string id */ 2:
                    message.id = reader.string();
                    break;
                case /* string name */ 3:
                    message.name = reader.string();
                    break;
                case /* bool is_name_generated */ 4:
                    message.isNameGenerated = reader.bool();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string document_path = 1; */
        if (message.documentPath !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.documentPath);
        /* string id = 2; */
        if (message.id !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.id);
        /* string name = 3; */
        if (message.name !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.name);
        /* bool is_name_generated = 4; */
        if (message.isNameGenerated !== false)
            writer.tag(4, WireType.Varint).bool(message.isNameGenerated);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventFoundTask
 */
export const LoadEventFoundTask = new LoadEventFoundTask$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadEventError$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadEventError", [
            { no: 1, name: "error_message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.errorMessage = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string error_message */ 1:
                    message.errorMessage = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string error_message = 1; */
        if (message.errorMessage !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.errorMessage);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadEventError
 */
export const LoadEventError = new LoadEventError$Type();
// @generated message type with reflection information, may provide speed optimized methods
class LoadResponse$Type extends MessageType {
    constructor() {
        super("runme.project.v1.LoadResponse", [
            { no: 1, name: "type", kind: "enum", T: () => ["runme.project.v1.LoadEventType", LoadEventType, "LOAD_EVENT_TYPE_"] },
            { no: 2, name: "started_walk", kind: "message", oneof: "data", T: () => LoadEventStartedWalk },
            { no: 3, name: "found_dir", kind: "message", oneof: "data", T: () => LoadEventFoundDir },
            { no: 4, name: "found_file", kind: "message", oneof: "data", T: () => LoadEventFoundFile },
            { no: 5, name: "finished_walk", kind: "message", oneof: "data", T: () => LoadEventFinishedWalk },
            { no: 6, name: "started_parsing_doc", kind: "message", oneof: "data", T: () => LoadEventStartedParsingDoc },
            { no: 7, name: "finished_parsing_doc", kind: "message", oneof: "data", T: () => LoadEventFinishedParsingDoc },
            { no: 8, name: "found_task", kind: "message", oneof: "data", T: () => LoadEventFoundTask },
            { no: 9, name: "error", kind: "message", oneof: "data", T: () => LoadEventError }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.type = 0;
        message.data = { oneofKind: undefined };
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.project.v1.LoadEventType type */ 1:
                    message.type = reader.int32();
                    break;
                case /* runme.project.v1.LoadEventStartedWalk started_walk */ 2:
                    message.data = {
                        oneofKind: "startedWalk",
                        startedWalk: LoadEventStartedWalk.internalBinaryRead(reader, reader.uint32(), options, message.data.startedWalk)
                    };
                    break;
                case /* runme.project.v1.LoadEventFoundDir found_dir */ 3:
                    message.data = {
                        oneofKind: "foundDir",
                        foundDir: LoadEventFoundDir.internalBinaryRead(reader, reader.uint32(), options, message.data.foundDir)
                    };
                    break;
                case /* runme.project.v1.LoadEventFoundFile found_file */ 4:
                    message.data = {
                        oneofKind: "foundFile",
                        foundFile: LoadEventFoundFile.internalBinaryRead(reader, reader.uint32(), options, message.data.foundFile)
                    };
                    break;
                case /* runme.project.v1.LoadEventFinishedWalk finished_walk */ 5:
                    message.data = {
                        oneofKind: "finishedWalk",
                        finishedWalk: LoadEventFinishedWalk.internalBinaryRead(reader, reader.uint32(), options, message.data.finishedWalk)
                    };
                    break;
                case /* runme.project.v1.LoadEventStartedParsingDoc started_parsing_doc */ 6:
                    message.data = {
                        oneofKind: "startedParsingDoc",
                        startedParsingDoc: LoadEventStartedParsingDoc.internalBinaryRead(reader, reader.uint32(), options, message.data.startedParsingDoc)
                    };
                    break;
                case /* runme.project.v1.LoadEventFinishedParsingDoc finished_parsing_doc */ 7:
                    message.data = {
                        oneofKind: "finishedParsingDoc",
                        finishedParsingDoc: LoadEventFinishedParsingDoc.internalBinaryRead(reader, reader.uint32(), options, message.data.finishedParsingDoc)
                    };
                    break;
                case /* runme.project.v1.LoadEventFoundTask found_task */ 8:
                    message.data = {
                        oneofKind: "foundTask",
                        foundTask: LoadEventFoundTask.internalBinaryRead(reader, reader.uint32(), options, message.data.foundTask)
                    };
                    break;
                case /* runme.project.v1.LoadEventError error */ 9:
                    message.data = {
                        oneofKind: "error",
                        error: LoadEventError.internalBinaryRead(reader, reader.uint32(), options, message.data.error)
                    };
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.project.v1.LoadEventType type = 1; */
        if (message.type !== 0)
            writer.tag(1, WireType.Varint).int32(message.type);
        /* runme.project.v1.LoadEventStartedWalk started_walk = 2; */
        if (message.data.oneofKind === "startedWalk")
            LoadEventStartedWalk.internalBinaryWrite(message.data.startedWalk, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.LoadEventFoundDir found_dir = 3; */
        if (message.data.oneofKind === "foundDir")
            LoadEventFoundDir.internalBinaryWrite(message.data.foundDir, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.LoadEventFoundFile found_file = 4; */
        if (message.data.oneofKind === "foundFile")
            LoadEventFoundFile.internalBinaryWrite(message.data.foundFile, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.LoadEventFinishedWalk finished_walk = 5; */
        if (message.data.oneofKind === "finishedWalk")
            LoadEventFinishedWalk.internalBinaryWrite(message.data.finishedWalk, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.LoadEventStartedParsingDoc started_parsing_doc = 6; */
        if (message.data.oneofKind === "startedParsingDoc")
            LoadEventStartedParsingDoc.internalBinaryWrite(message.data.startedParsingDoc, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.LoadEventFinishedParsingDoc finished_parsing_doc = 7; */
        if (message.data.oneofKind === "finishedParsingDoc")
            LoadEventFinishedParsingDoc.internalBinaryWrite(message.data.finishedParsingDoc, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.LoadEventFoundTask found_task = 8; */
        if (message.data.oneofKind === "foundTask")
            LoadEventFoundTask.internalBinaryWrite(message.data.foundTask, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* runme.project.v1.LoadEventError error = 9; */
        if (message.data.oneofKind === "error")
            LoadEventError.internalBinaryWrite(message.data.error, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.project.v1.LoadResponse
 */
export const LoadResponse = new LoadResponse$Type();
/**
 * @generated ServiceType for protobuf service runme.project.v1.ProjectService
 */
export const ProjectService = new ServiceType("runme.project.v1.ProjectService", [
    { name: "Load", serverStreaming: true, options: {}, I: LoadRequest, O: LoadResponse }
]);
