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

Added DeviceRendererFactory typing #88

Merged
merged 10 commits into from
Aug 2, 2024
Merged

Added DeviceRendererFactory typing #88

merged 10 commits into from
Aug 2, 2024

Conversation

OoDeLally
Copy link
Collaborator

@OoDeLally OoDeLally commented Aug 2, 2024

Description

Adds some typings for the device renderer.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I've read & comply with the contributing guidelines
  • I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • I have made corresponding changes to the documentation (README.md).
  • I've checked my modifications for any breaking changes.

@OoDeLally OoDeLally requested review from pgivel and jparez August 2, 2024 11:28
index.d.ts Outdated
activeKeyMappingDebug(isTraceActivate?: boolean, isGridActivate?: boolean): void;
};

type VmEvent = 'beforeunload' | 'fingerprint' | 'gps' | 'BATTERY_LEVEL' | string // TODO Provide an exhaustive list
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

Copy link
Contributor

@pgivel pgivel Aug 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've found, there are a few other events that are listed in the tests, but I don't know yet if the tests are exhaustive. Here are all values found in the tests:

ANDROID_ID
baseband
battery
BATTERY_STATUS
BLK
CLIPBOARD
diskio
fingerprint
framework
gps
IMEI
NETWORK
network_profile
settings
SYSTEM_PATCHER_LAST_RESULT
SYSTEM_PATCHER_STATUS
systempatcher

I'm trying to find a source of truth for these, either in the cloud player, maybe libcom repo, or something else.

[edit] by looking for occurences of registerEventCallback I've also found these:

BATTERY_LEVEL
vinput

index.d.ts Outdated

type VmCommunication = {
disconnect(): void;
addEventListener(event: VmEvent, callback: (msg: string) => void): void; // TODO Verify if msg is always string
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've found in the code for now, all values for msg where strings

index.d.ts Outdated
type VmCommunication = {
disconnect(): void;
addEventListener(event: VmEvent, callback: (msg: string) => void): void; // TODO Verify if msg is always string
sendData(data: { channel: string; messages: string[] }): void; // TODO Verify typing
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

package.json Show resolved Hide resolved
@OoDeLally OoDeLally mentioned this pull request Aug 2, 2024
7 tasks
index.d.ts Outdated
| 'CLIPBOARD'
| 'diskio'
| 'fingerprint'
| 'fingerprint'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

twice fingerprint

index.d.ts Outdated
| 'fingerprint'
| 'framework'
| 'gps'
| 'gps'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

twice gps

@jparez jparez merged commit 834a163 into main Aug 2, 2024
1 check passed
@jparez jparez deleted the types/typing branch August 2, 2024 16:20
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

Successfully merging this pull request may close these issues.

3 participants