def METHOD_NAME(self) -> Iterable[Tuple[int, "SubmenuItemDict"]]:
    for item in self._items.values():
        yield item["id"] << 8, item
        if "submenu" in item:
            yield from enumerate(item["submenu"], (item["id"] << 8) + 1)