Libraries
    Preparing search index...
    • Returns a new contract with the specified groups removed.

      The TypeScript return type is Omit<T, K> — the listed groups are absent at both runtime and compile time. Useful for stripping debug, internal, or admin groups before sharing a contract with less-privileged consumers.

      Type Parameters

      • T extends ApiContract

        The shape of the source contract.

      • K extends string | number | symbol

        The union of group keys to remove.

      Parameters

      • contract: T

        The contract to omit from.

      • ...groups: K[]

        The group keys to exclude.

      Returns Readonly<Omit<T, K>>

      A new frozen contract without the listed groups.

      const fullApi = defineApi({ todos: {...}, auth: {...}, admin: {...}, debug: {...} });

      // Strip internal groups before exporting to clients
      const publicApi = omitGroups(fullApi, 'admin', 'debug');
      // TypeScript: { todos: ..., auth: ... }