Ostensibly it would be identical to /icon/New [ref], which we're already familiar with. The only difference is that instead of returning data that the webclient can't really work with, it would return an URL pointing to that sprite that can then be rendered within the DOM. An example usage would be such:
var url = byond.iconUrl("ball.dmi", "bounce", 4 /* ie EAST */, 1 /* first frame of animation */);
// Assuming no jQuery:
document.getElementById("ball-viewport").style.backgroundImage = "url('" + url + "')";
// Assuming jQuery:
$("#ball-viewport").css("background", "url('" + url + "')");
Only downside is I don't think full animations could be rendered, so you'll be forced to choose a specific frame of animation for animated icon_states.