getNextStructTarget = () => {
    if (clientsStructRefsIds.length === 0) {
      return null;
    }

    let nextStructsTarget =
    /** @type {{i:number,refs:Array<GC|Item>}} */
    clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]);

    while (nextStructsTarget.refs.length === nextStructsTarget.i) {
      clientsStructRefsIds.pop();

      if (clientsStructRefsIds.length > 0) {
        nextStructsTarget =
        /** @type {{i:number,refs:Array<GC|Item>}} */
        clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]);
      } else {
        return null;
      }
    }

    return nextStructsTarget;
  }
@type {{i:number,refs:Array<GC|Item>}}