Prometheus Entity Management API
    Preparing search index...

    Interface CreateEntityListOptions<TRaw, TEntity>

    Options for createEntityList. The queryKey accessor is called reactively; changing the key triggers a new list fetch.

    interface CreateEntityListOptions<TRaw, TEntity extends object> {
        enabled?: () => boolean;
        fetch?: (
            params: {
                cursor?: string;
                page?: number;
                pageSize?: number;
                params?: Record<string, unknown>;
            },
        ) => Promise<
            {
                hasNextPage?: boolean;
                hasPrevPage?: boolean;
                items: TRaw[];
                nextCursor?: string
                | null;
                page?: number;
                pageSize?: number;
                prevCursor?: string;
                total?: number | null;
            },
        >;
        mode?: "replace"
        | "append";
        normalize?: (raw: TRaw) => { data: TEntity; id: string };
        onError?: (error: Error) => void;
        onSuccess?: (result: { items: TRaw[]; total?: number | null }) => void;
        queryKey: () => unknown[];
        staleTime?: number;
        type: string;
    }

    Type Parameters

    • TRaw

      Shape of each raw row from the transport.

    • TEntity extends object

      Normalized entity shape written to the graph.

    Index
    enabled?: () => boolean

    Reactive accessor; set to false to pause fetching (default true).

    fetch?: (
        params: {
            cursor?: string;
            page?: number;
            pageSize?: number;
            params?: Record<string, unknown>;
        },
    ) => Promise<
        {
            hasNextPage?: boolean;
            hasPrevPage?: boolean;
            items: TRaw[];
            nextCursor?: string
            | null;
            page?: number;
            pageSize?: number;
            prevCursor?: string;
            total?: number | null;
        },
    >

    Transport fetcher for the full list. Optional for graph-only (e.g. local-first PGlite) scenarios where the graph is hydrated out-of-band.

    mode?: "replace" | "append"

    Replace or append ids on re-fetch (default "replace").

    normalize?: (raw: TRaw) => { data: TEntity; id: string }

    Row normalizer: maps a raw row to { id, data } for graph upsert.

    onError?: (error: Error) => void

    Called after all retries are exhausted.

    onSuccess?: (result: { items: TRaw[]; total?: number | null }) => void

    Called after a successful list fetch.

    queryKey: () => unknown[]

    Reactive accessor returning the list query key array. Changing any element triggers a re-fetch. Use stable primitive values.

    staleTime?: number

    Milliseconds before the list is re-fetched in the background.

    type: string

    Entity kind for all items in this list.