export function serializeEntityPromise( entityPromise: Promise>, ): Promise; export function serializeEntityPromise( entityPromise: Promise> | null, ): Promise; export async function serializeEntityPromise( entityPromise: Promise> | null, ): Promise { return entityPromise ? (await entityPromise).id : null; } export async function serializeEntitiesPromise( entitiesPromise: Promise>>, ): Promise { return (await entitiesPromise).map((entity) => entity.id); }