|
1 |
| -declare module DDD { |
2 |
| - class Identity<T> { |
3 |
| - private value; |
4 |
| - constructor(value: T); |
5 |
| - public getValue(): T; |
6 |
| - public equals(that: Identity<T>): boolean; |
7 |
| - } |
8 |
| - class NumberIdentity extends Identity<number> { |
9 |
| - constructor(value: number); |
10 |
| - } |
11 |
| -} |
12 |
| -declare module DDD { |
13 |
| - class Entity<ID extends DDD.Identity<any>> { |
14 |
| - private identity; |
15 |
| - constructor(identity: ID); |
16 |
| - public getIdentity(): ID; |
17 |
| - public equals(that: Entity<ID>): boolean; |
18 |
| - } |
19 |
| -} |
20 |
| -declare module DDD { |
21 |
| - interface IRepository<ID extends DDD.Identity<any>, E extends DDD.Entity<any>> { |
22 |
| - resolveOption(identity: ID): monapt.Option<E>; |
23 |
| - resolve(identity: ID): E; |
24 |
| - store(entity: E): E; |
25 |
| - storeList(entityList: E[]): E[]; |
26 |
| - deleteByEntity(entity: E): IRepository<ID, E>; |
27 |
| - deleteByIdentity(identity: ID): IRepository<ID, E>; |
28 |
| - } |
29 |
| -} |
30 |
| -declare module DDD { |
31 |
| - class AsyncRepository<ID extends DDD.Identity<any>, E extends DDD.Entity<any>> { |
32 |
| - private core; |
33 |
| - constructor(core: DDD.IRepository<ID, E>); |
34 |
| - public resolve(identity: ID): monapt.Future<E>; |
35 |
| - public store(entity: E): monapt.Future<E>; |
36 |
| - public storeList(entityList: E[]): monapt.Future<E[]>; |
37 |
| - public deleteByEntity(entity: E): monapt.Future<AsyncRepository<ID, E>>; |
38 |
| - public deleteByIdentity(identity: ID): monapt.Future<AsyncRepository<ID, E>>; |
39 |
| - } |
40 |
| -} |
41 |
| -declare module DDD { |
42 |
| - class OnMemoryRepository<ID extends DDD.Identity<any>, E extends DDD.Entity<any>> implements DDD.IRepository<ID, E> { |
43 |
| - private entities; |
44 |
| - public resolveOption(identity: ID): monapt.Option<E>; |
45 |
| - public resolve(identity: ID): E; |
46 |
| - public store(entity: E): E; |
47 |
| - public storeList(entityList: E[]): E[]; |
48 |
| - public deleteByEntity(entity: E): OnMemoryRepository<ID, E>; |
49 |
| - public deleteByIdentity(identity: ID): OnMemoryRepository<ID, E>; |
50 |
| - } |
51 |
| -} |
52 |
| -declare module DDD { |
53 |
| - class AsyncOnMemoryRepository<ID extends DDD.Identity<any>, E extends DDD.Entity<any>> extends DDD.AsyncRepository<ID, E> { |
54 |
| - constructor(); |
55 |
| - } |
56 |
| -} |
57 |
| -declare module DDD { |
58 |
| - interface ISessionStorageMapper<E extends DDD.Entity<any>> { |
59 |
| - parse(json: Object): E; |
60 |
| - stringify(entity: E): string; |
61 |
| - } |
62 |
| - class OnSessionStorageRepository<ID extends DDD.Identity<any>, E extends DDD.Entity<any>> implements DDD.IRepository<ID, E> { |
63 |
| - constructor(mapper: ISessionStorageMapper<E>); |
64 |
| - public parse: (json: Object) => E; |
65 |
| - public stringify: (entity: E) => string; |
66 |
| - public resolveOption(identity: ID): monapt.Option<E>; |
67 |
| - public resolve(identity: ID): E; |
68 |
| - public store(entity: E): E; |
69 |
| - public storeList(entityList: E[]): E[]; |
70 |
| - public deleteByEntity(entity: E): OnSessionStorageRepository<ID, E>; |
71 |
| - public deleteByIdentity(identity: ID): OnSessionStorageRepository<ID, E>; |
72 |
| - } |
73 |
| -} |
74 |
| -declare module DDD { |
75 |
| - class AsyncOnSessionStorageRepository<ID extends DDD.Identity<any>, E extends DDD.Entity<any>> extends DDD.AsyncRepository<ID, E> { |
76 |
| - constructor(mapper: DDD.ISessionStorageMapper<E>); |
77 |
| - } |
78 |
| -} |
| 1 | +/// <reference path="definitions/monapt/monapt.d.ts" /> |
| 2 | +declare module DDD { |
| 3 | + class Identity<T> { |
| 4 | + private value; |
| 5 | + constructor(value: T); |
| 6 | + public getValue(): T; |
| 7 | + public equals(that: Identity<T>): boolean; |
| 8 | + } |
| 9 | + class NumberIdentity extends Identity<number> { |
| 10 | + constructor(value: number); |
| 11 | + } |
| 12 | +} |
| 13 | +declare module DDD { |
| 14 | + class Entity<ID extends Identity<any>> { |
| 15 | + private identity; |
| 16 | + constructor(identity: ID); |
| 17 | + public getIdentity(): ID; |
| 18 | + public equals(that: Entity<ID>): boolean; |
| 19 | + } |
| 20 | +} |
| 21 | +declare module DDD { |
| 22 | + interface IRepository<ID extends Identity<any>, E extends Entity<any>> { |
| 23 | + resolveOption(identity: ID): monapt.Option<E>; |
| 24 | + resolve(identity: ID): E; |
| 25 | + store(entity: E): E; |
| 26 | + storeList(entityList: E[]): E[]; |
| 27 | + deleteByEntity(entity: E): IRepository<ID, E>; |
| 28 | + deleteByIdentity(identity: ID): IRepository<ID, E>; |
| 29 | + } |
| 30 | +} |
| 31 | +declare module DDD { |
| 32 | + class AsyncRepository<ID extends Identity<any>, E extends Entity<any>> { |
| 33 | + private core; |
| 34 | + constructor(core: IRepository<ID, E>); |
| 35 | + public resolve(identity: ID): monapt.Future<E>; |
| 36 | + public store(entity: E): monapt.Future<E>; |
| 37 | + public storeList(entityList: E[]): monapt.Future<E[]>; |
| 38 | + public deleteByEntity(entity: E): monapt.Future<AsyncRepository<ID, E>>; |
| 39 | + public deleteByIdentity(identity: ID): monapt.Future<AsyncRepository<ID, E>>; |
| 40 | + } |
| 41 | +} |
| 42 | +declare module DDD { |
| 43 | + interface ILocalStorageMapper<E extends Entity<any>> { |
| 44 | + parse(json: Object): E; |
| 45 | + stringify(entity: E): string; |
| 46 | + } |
| 47 | + class OnLocalStorageRepository<ID extends Identity<any>, E extends Entity<any>> implements IRepository<ID, E> { |
| 48 | + constructor(mapper: ILocalStorageMapper<E>); |
| 49 | + public parse: (json: Object) => E; |
| 50 | + public stringify: (entity: E) => string; |
| 51 | + public resolveOption(identity: ID): monapt.Option<E>; |
| 52 | + public resolve(identity: ID): E; |
| 53 | + public store(entity: E): E; |
| 54 | + public storeList(entityList: E[]): E[]; |
| 55 | + public deleteByEntity(entity: E): OnLocalStorageRepository<ID, E>; |
| 56 | + public deleteByIdentity(identity: ID): OnLocalStorageRepository<ID, E>; |
| 57 | + } |
| 58 | +} |
| 59 | +declare module DDD { |
| 60 | + class AsyncOnLocalStorageRepository<ID extends Identity<any>, E extends Entity<any>> extends AsyncRepository<ID, E> { |
| 61 | + constructor(mapper: ILocalStorageMapper<E>); |
| 62 | + } |
| 63 | +} |
| 64 | +declare module DDD { |
| 65 | + class OnMemoryRepository<ID extends Identity<any>, E extends Entity<any>> implements IRepository<ID, E> { |
| 66 | + private entities; |
| 67 | + public resolveOption(identity: ID): monapt.Option<E>; |
| 68 | + public resolve(identity: ID): E; |
| 69 | + public store(entity: E): E; |
| 70 | + public storeList(entityList: E[]): E[]; |
| 71 | + public deleteByEntity(entity: E): OnMemoryRepository<ID, E>; |
| 72 | + public deleteByIdentity(identity: ID): OnMemoryRepository<ID, E>; |
| 73 | + } |
| 74 | +} |
| 75 | +declare module DDD { |
| 76 | + class AsyncOnMemoryRepository<ID extends Identity<any>, E extends Entity<any>> extends AsyncRepository<ID, E> { |
| 77 | + constructor(); |
| 78 | + } |
| 79 | +} |
| 80 | +declare module DDD { |
| 81 | + interface ISessionStorageMapper<E extends Entity<any>> { |
| 82 | + parse(json: Object): E; |
| 83 | + stringify(entity: E): string; |
| 84 | + } |
| 85 | + class OnSessionStorageRepository<ID extends Identity<any>, E extends Entity<any>> implements IRepository<ID, E> { |
| 86 | + constructor(mapper: ISessionStorageMapper<E>); |
| 87 | + public parse: (json: Object) => E; |
| 88 | + public stringify: (entity: E) => string; |
| 89 | + public resolveOption(identity: ID): monapt.Option<E>; |
| 90 | + public resolve(identity: ID): E; |
| 91 | + public store(entity: E): E; |
| 92 | + public storeList(entityList: E[]): E[]; |
| 93 | + public deleteByEntity(entity: E): OnSessionStorageRepository<ID, E>; |
| 94 | + public deleteByIdentity(identity: ID): OnSessionStorageRepository<ID, E>; |
| 95 | + } |
| 96 | +} |
| 97 | +declare module DDD { |
| 98 | + class AsyncOnSessionStorageRepository<ID extends Identity<any>, E extends Entity<any>> extends AsyncRepository<ID, E> { |
| 99 | + constructor(mapper: ISessionStorageMapper<E>); |
| 100 | + } |
| 101 | +} |
0 commit comments