data-cap
    Preparing search index...

    Interface GetterDefinition<TFields, TParams, TRaw, TWrites>

    A getter operation: acquires data. writes is required and explicit (ADR 0011) -- a getter's ownership is typically narrow and specific, so an explicit declaration keeps that scope visible and enforced. TParams is inferred purely from params's own literal value (or an explicit {} as TParams type-only anchor when there's no sensible runtime default) -- never derived from this capability's fields nullability, so a fields.nullable(...) declaration elsewhere never leaks an | null/ | undefined into an operation's parameter type.

    interface GetterDefinition<
        TFields,
        TParams,
        TRaw,
        TWrites extends FieldOwnership<TFields>,
    > {
        execute: (params: TParams, signal: AbortSignal) => Promise<TRaw>;
        params?: TParams;
        processor?: (raw: TRaw, params: TParams) => OwnedPatch<TFields, TWrites>;
        writes: TWrites;
    }

    Type Parameters

    Index
    execute: (params: TParams, signal: AbortSignal) => Promise<TRaw>

    Performs the actual acquisition (fetch, query, etc.), aborted via signal.

    params?: TParams

    Default/example params, deep-merged with a caller's partial at call time. Omit and annotate via {} as TParams to require every param explicitly on every call.

    processor?: (raw: TRaw, params: TParams) => OwnedPatch<TFields, TWrites>

    Defaults to identity when omitted -- execute's raw result is then used directly as the patch, and must already be shaped like one.

    writes: TWrites

    Declares which fields this getter is permitted to write -- see FieldOwnership.