Bringing over stuff from the test files.

This commit is contained in:
iamBadgers
2025-08-03 15:26:37 -07:00
parent d66c671a91
commit b3548db874
9 changed files with 4234 additions and 3 deletions

45
src/ts/module.ts Normal file
View File

@@ -0,0 +1,45 @@
import { CharacterManagerClient } from "../proto/character.client";
import { GetCharacterRequest } from '../proto/character'
import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'
import { ModuleData } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/common/packages.mjs";
import { id as moduleId } from "../module.json";
import DogBrowser from "./apps/NewCharacter";
interface MyModule extends Game.ModuleData<ModuleData> {
dogBrowser: DogBrowser;
}
let module: MyModule;
Hooks.once("init", async () => {
console.log("hello world!");
const client = new CharacterManagerClient(
new GrpcWebFetchTransport({
baseUrl: 'http://localhost/api',
format: 'binary',
}),
);
console.log("Potato");
let request = GetCharacterRequest.fromJson({
})
console.log("Potato");
let a = await client.getCharacter(request).then((res) => {
console.log(res)
return res
})
console.log(a.response)
console.log("Potato");
console.log(`Initializing ${moduleId}`);
module = (game as Game).modules.get(moduleId) as MyModule;
module.dogBrowser = new DogBrowser();
module.dogBrowser.render(true);
});