figma-api
figma-api copied to clipboard
return type of getFileNodes is more dynamic
Hi, and thanks for this library. I however realized that we can pass some id's to getFileNodes
method such that we can get results of type GetFileNodesResult
which has a property called nodes
with this interface:
{
[nodeId: string]: {
document: Node<'DOCUMENT'>,
components: { [nodeId: string]: Component },
schemaVersion: number,
styles: { [styleName: string]: Style },
}|null
}
Unfortunately, this is not always correct. It is possible to pass id's of other nodes and get results with a document
property with a different type (not always DOCUMENT
).
I hope it makes sense. I am working on a PR that should not break the current types. Please let me know what you think.