type FontOptions = {
  weight?: number,
  style?: "normal" | "italic"
}

/** Register a font face from a URL at runtime under `fontFamily`; resolves once it's ready to
 *  use in styles. For registry/project fonts prefer the compile-time `font()` macro — this is the
 *  dynamic escape hatch. */
export async function registerFont (fontFamily: string, url: string, options: FontOptions = {}): Promise<void> {
  return new Promise<void>((res, rej) => {
    _creatorUI.registerFont(fontFamily, url, options, res, rej)
  })
}