@@ -21,16 +21,52 @@ declare module 'aurelia-metadata' {
21
21
* The metadata key representing property information.
22
22
*/
23
23
properties : string ;
24
+
25
+ /**
26
+ * Gets metadata specified by a key on a target, searching up the inheritance hierarchy.
27
+ * @param metadataKey The key for the metadata to lookup.
28
+ * @param target The target to lookup the metadata on.
29
+ * @param targetKey The member on the target to lookup the metadata on.
30
+ */
24
31
get ( metadataKey : string , target : Function , targetKey : string ) : Object ;
32
+
33
+ /**
34
+ * Gets metadata specified by a key on a target, only searching the own instance.
35
+ * @param metadataKey The key for the metadata to lookup.
36
+ * @param target The target to lookup the metadata on.
37
+ * @param targetKey The member on the target to lookup the metadata on.
38
+ */
25
39
getOwn ( metadataKey : string , target : Function , targetKey : string ) : Object ;
40
+
41
+ /**
42
+ * Defines metadata specified by a key on a target.
43
+ * @param metadataKey The key for the metadata to define.
44
+ * @param target The target to set the metadata on.
45
+ * @param targetKey The member on the target to set the metadata on.
46
+ */
26
47
define ( metadataKey : string , metadataValue : Object , target : Function , targetKey : string ) : void ;
48
+
49
+ /**
50
+ * Gets metadata specified by a key on a target, or creates an instance of the specified metadata if not found.
51
+ * @param metadataKey The key for the metadata to lookup or create.
52
+ * @param Type The type of metadata to create if existing metadata is not found.
53
+ * @param target The target to lookup or create the metadata on.
54
+ * @param targetKey The member on the target to lookup or create the metadata on.
55
+ */
27
56
getOrCreateOwn ( metadataKey : string , Type : Function , target : Function , targetKey : string ) : Object ;
28
57
}
29
58
30
59
/**
31
60
* An object capable of applying it's captured decorators to a target.
32
61
*/
33
62
export interface DecoratorApplicator {
63
+
64
+ /**
65
+ * Applies the decorators to the target.
66
+ * @param target The target.
67
+ * @param key If applying to a method, the member name.
68
+ * @param key If applying to a method, you may supply an initial descriptor to pass to the decorators.
69
+ */
34
70
on ( target : any , key ?: string , descriptor ?: Object ) : any ;
35
71
}
36
72
@@ -54,8 +90,17 @@ declare module 'aurelia-metadata' {
54
90
* Options used during protocol creation.
55
91
*/
56
92
export interface ProtocolOptions {
57
- validate ( target : any ) : string | boolean ;
58
- compose ( target : any ) : void ;
93
+
94
+ /**
95
+ * A function that will be run to validate the decorated class when the protocol is applied. It is also used to validate adhoc instances.
96
+ * If the validation fails, a message should be returned which directs the developer in how to address the issue.
97
+ */
98
+ validate ?: ( target : any ) => string | boolean ;
99
+
100
+ /**
101
+ * A function which has the opportunity to compose additional behavior into the decorated class when the protocol is applied.
102
+ */
103
+ compose ?: ( target : any ) => void ;
59
104
}
60
105
61
106
/**
0 commit comments