Initial commit

This commit is contained in:
Michael Pivato
2024-06-05 21:38:06 +09:30
commit 922d74e007
44 changed files with 4433 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { CommonModule } from "@angular/common";
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { readTextFile } from "@tauri-apps/api/fs";
import { load, parse } from "protobufjs";
@Component({
selector: "app-editor",
standalone: true,
imports: [CommonModule, FormsModule],
templateUrl: "./editor.component.html",
styleUrl: "./editor.component.css",
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class EditorComponent {
fileContents = input<string>();
selectedProtoPath = input<string>();
async loadProtoDefinition() {
try {
const protoPath = this.selectedProtoPath();
if (protoPath) {
const protoContents = await readTextFile(protoPath);
const definition = await parse(protoContents);
console.log(definition);
}
} catch (err) {
console.error(err);
}
}
}