Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript typings problem #18

Open
fis-cz opened this issue Aug 17, 2022 · 6 comments
Open

TypeScript typings problem #18

fis-cz opened this issue Aug 17, 2022 · 6 comments

Comments

@fis-cz
Copy link

fis-cz commented Aug 17, 2022

Latest version of the TypeScript don't compile and types has to added / changed manually (especially ZB parsing is problematic).

The project should use more strict typing whenever possible (default any should be forbidden, indexing should be limited to known values and so on).

Also I checked the code and it would be great to use some strict linting settings (there are missing semicolons almost everywhere - I know its not mandatory, but...).

I would also refactor those ultra long promises and split them to separate async functions, its hard to read them.

There are also other things I would change, such as the parser is not related to ZB/ZLib so I would move it and rename it to JBSON and so on.

Would you mind if I try to refactor and cleanup the code and make the typings strict to be able to work with latest TypeScript?

@featherbear
Copy link
Owner

featherbear commented Aug 17, 2022

I envisioned that the project will eventually be linted against standardx, but the project is still in its early stages and the code structure will keep changing until I/we figure out what works best and is relatively stable; so I haven't yet tightened the typings

https://github.com/featherbear/presonus-studiolive-api/blob/master/package.json#L40-L56


https://github.com/featherbear/presonus-studiolive-api/blob/master/src/lib/types/ZlibPayload.ts

This file is auto generated, and can definitely be cleaned up / properly built


Anyhow, feel free to refactor things where you see fit. I agree with the parsing routine being renamed to disassociate itself with the zlib payload

@featherbear
Copy link
Owner

Perhaps the zlib-decoded payload (both ZB and CK) should be re-emitted as the JSON packet?

@fis-cz
Copy link
Author

fis-cz commented Aug 21, 2022

Perhaps the zlib-decoded payload (both ZB and CK) should be re-emitted as the JSON packet?

I’ll try to fugure out what will be the best way to “reemit”, but this seems to be the best way so all listeners can catch it.

@fis-cz
Copy link
Author

fis-cz commented Sep 10, 2022

I am back, but my box is in service, once it will be back I am gonna start to help you.

@featherbear
Copy link
Owner

Regarding typings, we should also seek to identify the "device options", "project options", and "scene options" - and then build type unions that fit the target.

I have plans to build an offline editor (likely just simple settings) that can open the exported project and scene files - https://github.com/featherbear/SL-Edit (stale). It would be cool to then be able to remotely sync the console

@featherbear
Copy link
Owner

Here are some exported files for reference (C:\Users\Andrew\Documents\PreSonus\StudioLive AI\Library\Presets\Project\20201219 Wedding.proj)

01.20201218 Update.scn.txt

20201219 Wedding.cnfg.txt

and the previously seen https://github.com/featherbear/presonus-studiolive-api/blob/documentation/dumps/zlib.parsed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants