import type { AuthorizationResultBasedCreateMutator } from './AuthorizationResultBasedEntityMutator.ts'; import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts'; import type { ReadonlyEntity } from './ReadonlyEntity.ts'; import type { ViewerContext } from './ViewerContext.ts'; /** * Enforcing entity creator. All creates * through this creator will throw if authorization is not successful. */ export declare class EnforcingEntityCreator, TIDField extends keyof NonNullable>, TViewerContext extends ViewerContext, TEntity extends ReadonlyEntity, TPrivacyPolicy extends EntityPrivacyPolicy, TSelectedFields extends keyof TFields> { private readonly entityCreator; constructor(entityCreator: AuthorizationResultBasedCreateMutator); /** * Set the value for entity field. * @param fieldName - entity field being updated * @param value - value for entity field */ setField>(fieldName: K, value: TFields[K]): this; /** * Commit the new entity after authorizing against creation privacy rules. Invalidates all caches for * queries that would return new entity. * @returns authorized, cached, newly-created entity, throwing if unsuccessful */ createAsync(): Promise; }