import 'reflect-metadata'; import type { ComplianceMetadata } from './ComplianceMetadata.js'; import { ChronicleClassOrPropertyDecorator } from '../types/propertyDecoratorMetadata.js'; /** * Decorator that marks a property or type as containing Personal Identifiable Information (PII) * according to the GDPR definition. When applied to read model properties or ConceptAs types, * the Chronicle Kernel will encrypt the values using compliance-aware encryption. * * This decorator can be used in two ways: * - As a property decorator: `@pii('details') propertyName: type` * - As a class decorator: `@pii('details') class TypeName { }` * * @param details - Optional details explaining why or to what extent the property/type is classified as PII. * @returns A decorator function that can be applied to either properties or classes (but not both on the same target). * * @example * Property usage: * ```typescript * @fromEvent(EmployeeHired) * class Employee { * @pii('Employee social security number') * ssn: string = ''; * * @pii('Personal email address') * email: string = ''; * } * ``` * * @example * Type usage with ConceptAs: * ```typescript * @pii('Customer email address') * class CustomerEmailConcept extends ConceptAs {} * export type CustomerEmail = CustomerEmailConcept | string; * * @fromEvent(CustomerRegistered) * class Customer { * @field(CustomerEmailConcept) * email: CustomerEmail = ''; * } * ``` */ export declare function pii(details?: string): ChronicleClassOrPropertyDecorator; /** * Gets the PII compliance metadata for a property. * @param target - The class prototype. * @param propertyKey - The property name. * @returns The compliance metadata, or undefined if not decorated with @pii. */ export declare function getPIIMetadata(target: object, propertyKey: string): ComplianceMetadata | undefined; /** * Checks whether a property has been decorated with @pii. * @param target - The class prototype. * @param propertyKey - The property name. * @returns True if the property has @pii decorator; false otherwise. */ export declare function hasPIIMetadata(target: object, propertyKey: string): boolean; /** * Gets the PII compliance metadata for a type. * @param type - The type constructor. * @returns The compliance metadata, or undefined if not decorated with @pii. */ export declare function getTypePIIMetadata(type: Function): ComplianceMetadata | undefined; /** * Checks whether a type has been decorated with @pii. * @param type - The type constructor. * @returns True if the type has @pii decorator; false otherwise. */ export declare function isPII(type: Function): boolean; //# sourceMappingURL=pii.d.ts.map