How can I list all custom post types in a block

wp.data.select('core').getPostTypes() will show return an array of objects that represent each registered post type that is available via the REST API.

wp.apiFetch({path:'wp/v2/posts'}).then( res => console.log( res ) ); will retrieve the latest posts. You may want/need to update the parameters to suit your needs. See the docs for more details