@flashpuller/unreal-commands-api-parser
v1.0.21
Published
This is a parser for 3DSource METABOX commands API. It generates TypeScript interfaces from the API documentation.
Downloads
3
Readme
This project is intended to use with 3DSource Metabox system
Installation
npm i @flashpuller/unreal-commands-api-parser --save-dev
Add the following script to your package.json scripts
"getStruct": "node ./node_modules/@flashpuller/unreal-commands-api-parser/dist/index.js \"https://preview.3dsource.com/vps-commands-api/documentation/latest\" \"src/struct.ts\"",
Usage:
npm run getStruct
Then import the generated file in your project
EXAMPLE:
@Injectable({
providedIn: 'root',
})
export class TestService {
constructor() {
// Example of sending a command to Unreal
const command: UnrealCommands = {
command: MetaBoxCommand.F360EnableCommand,
payload: {
value: true,
armLength: 0,
},
};
this.sendCommandToUnreal(command);
}
sendCommandToUnreal(data: MetaBoxCommandPacket): void {
console.log(data);
}
}
To Create a Documentation from the output file use the following command:
npm i typedoc@latest --save-dev
Then add the following script to your package.json scripts
"doc": "typedoc --out dist/docs src/struct.ts"
Deploy the documentation to your server or use it locally using current pipeline