smartdata/dist/smartdata.classes.dbdoc.d.ts

35 lines
937 B
TypeScript
Raw Normal View History

2016-09-13 20:53:21 +00:00
import { DbCollection } from './smartdata.classes.dbcollection';
2016-11-17 23:59:57 +00:00
export declare type TDocCreation = 'db' | 'new' | 'mixed';
2016-11-17 23:42:25 +00:00
/**
2016-11-18 12:20:43 +00:00
* saveable - saveable decorator to be used on class properties
2016-11-17 23:42:25 +00:00
*/
2016-11-18 12:56:15 +00:00
export declare function svDb(): (target: DbDoc<any>, key: string) => void;
2016-09-13 20:53:21 +00:00
export declare class DbDoc<T> {
2016-11-17 23:42:25 +00:00
/**
* the collection object an Doc belongs to
*/
2016-09-13 20:53:21 +00:00
collection: DbCollection<T>;
2016-11-17 23:42:25 +00:00
/**
* how the Doc in memory was created, may prove useful later.
*/
2016-09-13 20:53:21 +00:00
creationType: TDocCreation;
2016-11-17 23:42:25 +00:00
/**
* an array of saveable properties of a doc
*/
saveableProperties: string[];
/**
* class constructor
*/
constructor();
2016-11-17 23:42:25 +00:00
/**
* saves this instance but not any connected items
* may lead to data inconsistencies, but is faster
*/
2016-09-13 20:53:21 +00:00
save(): void;
2016-11-17 23:42:25 +00:00
/**
* also store any referenced objects to DB
* better for data consistency
*/
2016-09-13 20:53:21 +00:00
saveDeep(): void;
}