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

Incorrect type for InventoryPages.GetCurrentPage #1168

Closed
Jacossaurus opened this issue Apr 8, 2023 · 0 comments · Fixed by #967
Closed

Incorrect type for InventoryPages.GetCurrentPage #1168

Jacossaurus opened this issue Apr 8, 2023 · 0 comments · Fixed by #967

Comments

@Jacossaurus
Copy link

The InventoryPages.GetCurrentPage incorrectly returns number[] instead of the appropriate inventory asset type.

const pages = AvatarEditorService.GetInventory([assetType]);
const page = pages.GetCurrentPage();

The correct inventory asset type should be

interface InventoryAsset {
	AssetId: number;
	AssetType: string;
	Created: string;
	Name: string;
}
@osyrisrblx osyrisrblx transferred this issue from roblox-ts/roblox-ts Feb 10, 2024
osyrisrblx added a commit that referenced this issue Feb 11, 2024
This PR adjusts the API to account for `InventoryPages` containing
different data types depending on where it is created.

Closes #1168

- converts `InventoryPages` to a generic type of `InventoryPages<T =
unknown>`
- changes the return type of `KeyframeSequenceProvider.GetAnimations()`
to `InventoryPages<number>`
- changes the return type of `AvatarEditorService.GetInventory()` to:
```ts
InventoryPages<{
		AssetId: number;
		AssetType: string;
		Created: string;
		Name: string;
}>

---------

Co-authored-by: Osyris <[email protected]>
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 a pull request may close this issue.

1 participant