import { type Entity, type RouteContext } from '../../core/index.js'; /** * The scope the org-scope `` widget requires: `WidgetSessionTokenScopes.WidgetsApiKeysManage` * in the Node SDK, and the `permissions` entry the widget itself checks before it renders. */ export declare const WIDGET_SCOPE_API_KEYS_MANAGE = "widgets:api-keys:manage"; /** * The scopes only an AuthKit user can hold — `AuthkitWidgetScopes` in production * (packages/api-entities-zod/src/entities/widget-session.ts). Requesting one without a * `user_id` is refused, since the session would have no user to grant it to. */ export declare const AUTHKIT_WIDGET_SCOPES: ReadonlySet; /** * The scopes a widget session can be minted with: production's `WidgetSessionScope` enum — * the AuthKit scopes above plus the standalone ones, which need an organization but no user. */ export declare const WIDGET_SESSION_SCOPES: readonly string[]; interface WidgetListParams { limit: number; before?: string; after?: string; search?: string; } interface WidgetList { data: T[]; list_metadata: { before: string | null; after: string | null; }; } /** * Cursor pagination in the convention the widgets' private API uses, which is the mirror image * of the public API's (`cursorPaginate`): records are newest-first, `before` is the cursor for * the *next* page — the records created before it — and `after` for the *previous* page. The * shipped `@workos-inc/widgets` tables wire their Next button to `list_metadata.before` and * Previous to `list_metadata.after`, so serving the public convention would page backwards. * * A `before` cursor yields the `limit` records that follow it; an `after` cursor yields the * `limit` records immediately preceding it, so stepping back from page three lands on page two. */ export declare function paginateForWidget(items: T[], params: Omit): WidgetList; export declare function widgetRoutes(ctx: RouteContext): void; export {};