inversify-datastore
Version:
Some utilities for the development of Google Cloud Datastore applications using Inversify
37 lines (36 loc) • 1.48 kB
TypeScript
import { interfaces } from "./interfaces";
import { ValidationOptions } from "class-validator";
import EntityOptions = interfaces.EntityOptions;
/**
* Decorates a Google Datastore Repository
* @param entityIdentifier the entity assinged for that repository
*/
export declare function repository(entityIdentifier: any): (target: any) => any;
/**
* Decorates an entity.
* @param kind the kind name of an entity.
* @param entityOptions the options for serialization
*/
export declare function entity(kind: string, entityOptions?: EntityOptions): {
(target: Function): void;
(target: Object, propertyKey: string | symbol): void;
};
/**
* Identify the path to compose an entity key.
* @param validationOptions optional for customize the field validation
*/
export declare function id(validationOptions?: ValidationOptions): (target: object, propertyKey: string) => void;
/**
* The field decorated will be excluded from entity indexes.
*/
export declare function excludeFromIndex(): (target: object, propertyKey: string) => void;
/**
* The field decorated will be assigned with a new date when created.
* The property decorated with this field must be a Data.
*/
export declare function createdAt(): (target: object, propertyKey: string) => void;
/**
* The field decorated will be assigned with a new date when updated.
* The property decorated with this field must be a Data.
*/
export declare function updatedAt(): (target: object, propertyKey: string) => void;