Skip to content

Javascript API types incorrect when reading physical size #2599

@TomzBench

Description

@TomzBench

When using the Tauri API in typescript, the intellisense is not correct, (and therefore the typescript declarations are wrong?) Specifically the API I notice this issue is when reading the physical size.

const size = await api.window.appWindow.innerSize(); // { height: yyy, width: xxx}
size.toLogical(...); // <--- [Error] toLogical does not exist on size

My guess is that when sending the rust props over to javascript, the prototypes or methods are lost and only the values are passed. However the typescript typings are assuming you have a constructed object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: 1 highHigh priority bugs/missing features or non-crashing regressionsscope: api.jsThe @tauri-apps/api npm packagetype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions