Skip to main content
Alex_FG
New Participant
Feb 10, 2023 10:56 AM UTC
Question

Unable to use figma.ui.reposition()

My typings file is updated to 1.58.0 but I’m still getting

error TS2339: Property ‘reposition’ does not exist on type ‘UIAPI’.

during compilation, but at run time everything seems to work. 🤷

Is there something else I need to update?

This topic has been closed for replies.

10 replies

tank666
Feb 10, 2023 12:30 PM UTC

Perhaps your compiler is referring to some other (old) typing file.

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Alex_FG
Alex_FGAuthor
New Participant
Feb 10, 2023 1:23 PM UTC

Is there something else I can update that would could fix this?

tank666
Feb 10, 2023 1:49 PM UTC

I don’t know what you are using, so my answer will be general: change or provide a new path to the typing files in your IDE.

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Alex_FG
Alex_FGAuthor
New Participant
Feb 10, 2023 2:01 PM UTC

Oh I’m sorry, I’m using VS Code with a standard installation as per the intro tutorial (might be an older tutorial because now there’s something about an installer and I think I remember having to type a bit more).

Alex_FG
Alex_FGAuthor
New Participant
Feb 10, 2023 3:46 PM UTC

Is figma.ui.reposition() new? I know I’ve been waiting for it for a long time, but I don’t remember seeing it in the docs until I saw it last night by accident. Maybe it’s not properly exposed or something? I’ve updated the typings and did everything I could google to solve this. It still says that it doesn’t find .reposition()

JosephxBrick
Active Member
Feb 10, 2023 10:46 PM UTC

It’s odd because when you go to the github repository, the file does contain the reposition function:

image

…but the file in v1.58.0 (under “tags” in the repository) doesn’t have it.

I modified the file locally, and the IDE stopped complaining about it and there were no console errors when run, but it didn’t work reliably - e.g., it only repositioned the window occasionally, whereas the “resize” function used in the same spot worked every time.

Gleb
Power Member
Feb 11, 2023 4:16 AM UTC

Yes, it is very new, it is not officially released yet.

Alex_FG
Alex_FGAuthor
New Participant
Feb 11, 2023 7:23 AM UTC

Is there an ETA by any chance, since the API has already been published?

Gleb
Power Member
Feb 11, 2023 10:14 AM UTC

Figma doesn’t disclose their plans usually. But in my experience it should be released this month since it was already added to typings.

Alex_FG
Alex_FGAuthor
New Participant
Feb 11, 2023 11:27 AM UTC

So excited for this function! 🤩