Can somebody tell me how to make ownerOf function for ERC1155 token?

How to get ownerOf a specific token in the ERC1155 token?

lets say i have minted single erc721 as well as batch nfts in the erc1155 token contract. How can i get owner of a specific for specific token id?

Like we do have ownerOf function in ERC721 contract. How can i make one for that?

Waiting for your kind answers.

mapping (uint256 => mapping(uint256 =>address)) private _owners;

function ownerOf(uint256 id, uint256 tokenId) public view virtual returns (address) {
    address owner = _owners[id][tokenId];
    require(owner != address(0), "owner query for nonexistent token");
    return owner;