Have you considered exploring declaration merging? It appears to align more closely with what you're seeking compared to your current accepted solution:
// importing from a module
import { LibraryItem } from 'librarymodule';
// locally extending the module's interface declaration
declare module './playground' {
export interface LibraryItem {
isPhotoSelected: boolean
}
}
// utilizing it
const libtaryItem: LibraryItem = {
id: 'id',
photoURL: 'https://example.com/photo.jpg',
fileName: 'fileName.ext',
thumbnailURL: 'https://example.com/thumbnail.jpg',
isPhotoSelected: true
}
I hope this information proves helpful; best of luck!