findAll error

I am trying to explore

In code.ts,

let allNodes = figma.currentPage.selection[0].findAll();

I am getting error for findAll()

Error is
Property ‘findAll’ does not exist on type ‘SceneNode’.
Property ‘findAll’ does not exist on type ‘SliceNode’.