import { initOrUpdateProperty } from '../property/init-or-update-property.function';
/**
 * Only the L(ist) dynamo datatype preservers the order of inserted items, so we have to make sure the L(ist) type is used
 * when persisting. The modelClass is required if the collection items
 * have some property decorators, so we can retrieve this information using the model class.
 */
export function SortedSet(modelClass) {
    return function (target, propertyKey) {
        if (typeof propertyKey === 'string') {
            var typeInfo = {
                type: Set,
                isCustom: true,
            };
            if (modelClass) {
                typeInfo.genericType = modelClass;
            }
            initOrUpdateProperty({ isSortedCollection: true, typeInfo: typeInfo }, target, propertyKey);
        }
    };
}
//# sourceMappingURL=sorted-set.decorator.js.map