import { LetterboxdPoster } from "./list" ; import { getKanpai , LETTERBOXD_ORIGIN } from "./util" ; export const getCollection = async ( collectionSlug ) : Promise < LetterboxdPoster [ ] > => { const ajaxUrl = await getKanpai < string > ( `${ LETTERBOXD_ORIGIN }${ collectionSlug }` , [ '#films-browser-list-container' , '[data-url]' ] ) ; const posters = await getKanpai < LetterboxdPoster [ ] > ( `${ LETTERBOXD_ORIGIN }${ ajaxUrl }` , [ '.poster-list .film-poster' , { slug : [ '$' , '[data-target-link]' ] , title : [ '.image' , '[alt]' ] } ] ) ; return posters ; } ;