import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'; /** * A global cookie collection paired with where it lives, so a selection can be written back to the * correct source: the workspace or the active document `x-scalar-cookies` list. */ type GlobalCookieSource = { location: 'document' | 'workspace'; cookies: XScalarCookie[]; }; /** * A single cookie within a preset group, carrying just enough to mutate its source: which * collection it belongs to and its index within that collection's `x-scalar-cookies` array. */ type GlobalCookieSibling = { location: 'document' | 'workspace'; index: number; value: string; }; /** * Global cookies that share a name, grouped into a single logical cookie. When more than one value * exists for the same name the group becomes a preset the user can switch between (for example a * `Culture` cookie with `PL` and `EN` values). */ type GlobalCookieGroup = { /** The shared cookie name. */ name: string; /** The value of the currently active (enabled) sibling — the one that is sent. */ selectedValue: string; /** Distinct selectable values, in first-seen order. Only populated for presets. */ options: string[]; /** Whether this group offers more than one value to switch between. */ isPreset: boolean; /** Location of the first sibling, used to navigate to the global cookie settings. */ location: 'document' | 'workspace'; /** Every sibling sharing this name, so a selection can enable one and disable the rest. */ siblings: GlobalCookieSibling[]; }; /** * Groups global cookies by name so duplicate names collapse into a single row. Same-named cookies * used to render as independent rows that all shared one disabled state, so toggling one toggled * them all. Grouping them lets a name expose its values as a preset switcher instead. * * The `shouldInclude` predicate applies the caller's domain and path filtering while the original * index is still known, so a selection can be written back to the right entry. That predicate * deliberately ignores the disabled flag for preset values: a disabled value is only hidden from * the request, not from the switcher, so the user can select it again. */ export declare const groupGlobalCookies: ({ sources, shouldInclude, }: { sources: GlobalCookieSource[]; /** Whether a cookie is applicable to the current request (domain/path), ignoring its disabled state. */ shouldInclude: (cookie: XScalarCookie) => boolean; }) => GlobalCookieGroup[]; export {}; //# sourceMappingURL=group-global-cookies.d.ts.map