/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

declare const __brand: unique symbol;
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };

function unrecognized<T>(value: T): Unrecognized<T> {
  globalCount++;
  return value as Unrecognized<T>;
}

let globalCount = 0;
let refCount = 0;
export function startCountingUnrecognized() {
  refCount++;
  const start = globalCount;
  return {
    end: () => {
      const count = globalCount - start;
      if (--refCount === 0) globalCount = 0;
      return count;
    },
  };
}

export { unrecognized };
