import { c as RecordsDataSource } from './ports-BSd-1p1l.cjs';
/** What kind of object the id is, as `custom.where_id_opens` names it — carried as the door's own word. */
type ObjectKind = string;
type ObjectOrganizationAnswer =
/** The store named the object's organization, and the person may open the object. */
{
state: "found";
organizationId: string;
kind: ObjectKind;
/** The screen the store says opens it (`/data/
?record=…`), or null for a part with none. */
path: string | null;
/** False when it is in the trash — the person may still open it, to bring it back. */
live: boolean;
/** The id it answers as — a merged record's survivor. */
resolvedId: string;
/** A table only: how many rows THIS person sees, capped at `rows_visible_cap` (200) — a loading frame's height. Absent when not asked/known. */
rowsVisible?: number;
/**
* A table only: the layout it opens in and, when that view groups by a Field (a board), the cards each group
* holds (largest first; counted over at most `cap` rows, a several-choice card in each of its groups).
*/
opening?: OpeningViewShape;
}
/** Not given to this person — or not there at all. The store does not say which, on purpose. */
| {
state: "not-given";
}
/** We could not ask. NOT an answer about the person's access. */
| {
state: "unavailable";
why: string;
};
/** Which organization owns an object — the port `createRecords({ organizationOf })` accepts. */
interface RecordOrganizationPort {
organizationOf(id: string): Promise;
}
/** What the store says of the layout a table opens in — enough to size a board's or a gallery's loading frame. */
interface OpeningViewShape {
layout?: string;
groupField?: string;
/** Cards per group, largest first. */
groups?: number[];
cap: number;
}
/** Reads `opening_view` of the door's answer; anything malformed is no shape at all. */
declare function readOpeningViewShape(raw: unknown): OpeningViewShape | undefined;
declare const WHERE_ID_OPENS_DOOR = "where_id_opens";
/** Ask the store which organization `id` lives in — the one call an object page makes before any other door. */
declare function resolveObjectOrganization(dataSource: Pick, id: string): Promise;
/** Read one `custom.where_id_opens` answer — asked here, or asked by a server render as the same person. */
declare function readObjectOrganizationAnswer(answered: {
data: unknown;
error: {
code?: string | null;
message?: string | null;
} | null;
}, id: string): ObjectOrganizationAnswer;
/** The default port: one `custom.where_id_opens` call per ask, nothing kept. */
declare function whereIdOpensPort(dataSource: Pick): RecordOrganizationPort;
export { WHERE_ID_OPENS_DOOR as W, resolveObjectOrganization as b, readOpeningViewShape as d, readObjectOrganizationAnswer as r, whereIdOpensPort as w };
export type { ObjectKind as O, RecordOrganizationPort as R, ObjectOrganizationAnswer as a, OpeningViewShape as c };