Skip to content

Commit

Permalink
Documentation cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Dec 21, 2016
1 parent 9daccd5 commit ffc554c
Show file tree
Hide file tree
Showing 10 changed files with 226 additions and 769 deletions.
267 changes: 144 additions & 123 deletions Reflect.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "reflect-metadata",
"version": "0.1.9",
"description": "Polyfill for Metadata Reflection API",
"homepage": "https://github.com/rbuckton/ReflectDecorators",
"homepage": "https://github.com/rbuckton/reflect-metadata",
"authors": [
"Ron Buckton <ron.buckton@microsoft.com>"
],
Expand Down Expand Up @@ -31,6 +31,6 @@
},
"repository": {
"type": "git",
"url": "https://github.com/rbuckton/ReflectDecorators.git"
"url": "https://github.com/rbuckton/reflect-metadata.git"
}
}
28 changes: 14 additions & 14 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/spec.biblio.json

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ declare global {
* Applies a set of decorators to a property of a target object.
* @param decorators An array of decorators.
* @param target The target object.
* @param targetKey The property key to decorate.
* @param descriptor A property descriptor
* @param propertyKey The property key to decorate.
* @param attributes A property descriptor.
* @remarks Decorators are applied in reverse order.
* @example
*
Expand Down Expand Up @@ -68,7 +68,7 @@ declare global {
* Object.getOwnPropertyDescriptor(Example.prototype, "method")));
*
*/
function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, targetKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor;
function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, propertyKey: string | symbol, attributes?: PropertyDescriptor): PropertyDescriptor;
/**
* A default metadata decorator factory that can be used on a class, class member, or parameter.
* @param metadataKey The key for the metadata entry.
Expand Down Expand Up @@ -111,7 +111,7 @@ declare global {
*/
function metadata(metadataKey: any, metadataValue: any): {
(target: Function): void;
(target: Object, targetKey: string | symbol): void;
(target: Object, propertyKey: string | symbol): void;
};
/**
* Define a unique metadata entry on the target.
Expand All @@ -138,7 +138,7 @@ declare global {
* @param metadataKey A key used to store and retrieve metadata.
* @param metadataValue A value that contains attached metadata.
* @param target The target object on which to define metadata.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @example
*
* class Example {
Expand Down Expand Up @@ -168,7 +168,7 @@ declare global {
* }
*
*/
function defineMetadata(metadataKey: any, metadataValue: any, target: Object, targetKey: string | symbol): void;
function defineMetadata(metadataKey: any, metadataValue: any, target: Object, propertyKey: string | symbol): void;
/**
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
Expand All @@ -188,7 +188,7 @@ declare global {
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
* @example
*
Expand All @@ -214,7 +214,7 @@ declare global {
* result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
*
*/
function hasMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
function hasMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
/**
* Gets a value indicating whether the target object has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
Expand All @@ -234,7 +234,7 @@ declare global {
* Gets a value indicating whether the target object has the provided metadata key defined.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
* @example
*
Expand All @@ -260,7 +260,7 @@ declare global {
* result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
*
*/
function hasOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
function hasOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
/**
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
* @param metadataKey A key used to store and retrieve metadata.
Expand All @@ -280,7 +280,7 @@ declare global {
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
Expand All @@ -306,7 +306,7 @@ declare global {
* result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
*
*/
function getMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
function getMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
/**
* Gets the metadata value for the provided metadata key on the target object.
* @param metadataKey A key used to store and retrieve metadata.
Expand All @@ -326,7 +326,7 @@ declare global {
* Gets the metadata value for the provided metadata key on the target object.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
* @example
*
Expand All @@ -352,7 +352,7 @@ declare global {
* result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
*
*/
function getOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
function getOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
/**
* Gets the metadata keys defined on the target object or its prototype chain.
* @param target The target object on which the metadata is defined.
Expand All @@ -370,7 +370,7 @@ declare global {
/**
* Gets the metadata keys defined on the target object or its prototype chain.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @returns An array of unique metadata keys.
* @example
*
Expand All @@ -396,7 +396,7 @@ declare global {
* result = Reflect.getMetadataKeys(Example.prototype, "method");
*
*/
function getMetadataKeys(target: Object, targetKey: string | symbol): any[];
function getMetadataKeys(target: Object, propertyKey: string | symbol): any[];
/**
* Gets the unique metadata keys defined on the target object.
* @param target The target object on which the metadata is defined.
Expand All @@ -414,7 +414,7 @@ declare global {
/**
* Gets the unique metadata keys defined on the target object.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @returns An array of unique metadata keys.
* @example
*
Expand All @@ -440,7 +440,7 @@ declare global {
* result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
*
*/
function getOwnMetadataKeys(target: Object, targetKey: string | symbol): any[];
function getOwnMetadataKeys(target: Object, propertyKey: string | symbol): any[];
/**
* Deletes the metadata entry from the target object with the provided key.
* @param metadataKey A key used to store and retrieve metadata.
Expand All @@ -460,7 +460,7 @@ declare global {
* Deletes the metadata entry from the target object with the provided key.
* @param metadataKey A key used to store and retrieve metadata.
* @param target The target object on which the metadata is defined.
* @param targetKey The property key for the target.
* @param propertyKey The property key for the target.
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
* @example
*
Expand All @@ -486,6 +486,6 @@ declare global {
* result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
*
*/
function deleteMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
function deleteMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/rbuckton/ReflectDecorators.git"
"url": "https://github.com/rbuckton/reflect-metadata.git"
},
"keywords": [
"decorator",
Expand All @@ -31,14 +31,14 @@
"licenses": [
{
"license": "Apache-2.0",
"url": "http://github.com/rbuckton/ReflectDecorators/raw/master/LICENSE"
"url": "http://github.com/rbuckton/reflect-metadata/raw/master/LICENSE"
}
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/rbuckton/ReflectDecorators/issues"
"url": "https://github.com/rbuckton/reflect-metadata/issues"
},
"homepage": "http://rbuckton.github.io/ReflectDecorators",
"homepage": "http://rbuckton.github.io/reflect-metadata",
"dependencies": {},
"devDependencies": {
"@types/chai": "^3.4.34",
Expand Down
31 changes: 14 additions & 17 deletions spec.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<meta charset="utf8">
<title>Metadata</title>
<title>Metadata Proposal - ECMAScript</title>
<link rel="stylesheet" href="ecmarkup.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="ecmarkup.js"></script>
Expand All @@ -12,7 +12,7 @@
<pre class=metadata>
title: Metadata Proposal - ECMAScript
status: proposal
location: https://rbuckton.github.io/ReflectDecorators
location: https://rbuckton.github.io/reflect-metadata
copyright: false
contributors: Ron Buckton
</pre>
Expand Down Expand Up @@ -140,8 +140,7 @@ <h1>OrdinaryHasMetadata ( MetadataKey, O, P )</h1>
2. Let _hasOwn_ be ? OrdinaryHasOwnMetadata(_MetadataKey_, _O_, _P_).
3. If _hasOwn_ is *true*, return *true*.
4. Let _parent_ be ? _O_.[[GetPrototypeOf]]().
5. If _parent_ is not *null*, then
1. Return ? _parent_.[[HasMetadata]](_MetadataKey_, _P_).
5. If _parent_ is not *null*, Return ? _parent_.[[HasMetadata]](_MetadataKey_, _P_).
6. Return *false*.
</emu-alg>
</emu-clause>
Expand All @@ -160,7 +159,7 @@ <h1>OrdinaryHasOwnMetadata ( MetadataKey, O, P )</h1>
1. Assert: _P_ is *undefined* or IsPropertyKey(_P_) is *true*.
2. Let _metadataMap_ be ? GetOrCreateMetadataMap(_O_, _P_, *false*).
3. If _metadataMap_ is *undefined*, return *false*.
4. Return ? Invoke(_metadataMap_, `"has"`, _MetadataKey_).
4. Return ? ToBoolean(? Invoke(_metadataMap_, `"has"`, _MetadataKey_)).
</emu-alg>
</emu-clause>
</emu-clause>
Expand All @@ -177,11 +176,9 @@ <h1>OrdinaryGetMetadata ( MetadataKey, O, P )</h1>
<emu-alg>
1. Assert: _P_ is *undefined* or IsPropertyKey(_P_) is *true*.
2. Let _hasOwn_ be ? OrdinaryHasOwnMetadata(_MetadataKey_, _O_, _P_).
3. If _hasOwn_ is *true*, then
1. Return ? OrdinaryGetOwnMetadata(_MetadataKey_, _O_, _P_).
3. If _hasOwn_ is *true*, return ? OrdinaryGetOwnMetadata(_MetadataKey_, _O_, _P_).
4. Let _parent_ be ? _O_.[[GetPrototypeOf]]().
5. If _parent_ is not *null*, then
1. return ? _parent_.[[GetMetadata]](_MetadataKey_, _P_).
5. If _parent_ is not *null*, return ? _parent_.[[GetMetadata]](_MetadataKey_, _P_).
6. Return *undefined*.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -345,7 +342,7 @@ <h1>Reflect.metadata ( metadataKey, metadataValue )</h1>
</emu-clause>

<emu-clause id="reflect.definemetadata">
<h1>Reflect.defineMetadata ( metadataKey, metadataValue, target, propertyKey )</h1>
<h1>Reflect.defineMetadata ( metadataKey, metadataValue, target [, propertyKey] )</h1>
<p>When the `defineMetadata` function is called with arguments _metadataKey_, _metadataValue_, _target_, and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand All @@ -354,7 +351,7 @@ <h1>Reflect.defineMetadata ( metadataKey, metadataValue, target, propertyKey )</
</emu-clause>

<emu-clause id="reflect.hasmetadata">
<h1>Reflect.hasMetadata ( metadataKey, target, propertyKey )</h1>
<h1>Reflect.hasMetadata ( metadataKey, target [, propertyKey] )</h1>
<p>When the `hasMetadata` function is called with arguments _metadataKey_, _target_, and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand All @@ -363,7 +360,7 @@ <h1>Reflect.hasMetadata ( metadataKey, target, propertyKey )</h1>
</emu-clause>

<emu-clause id="reflect-hasownmetadata">
<h1>Reflect.hasOwnMetadata ( metadataKey, target, propertyKey )</h1>
<h1>Reflect.hasOwnMetadata ( metadataKey, target [, propertyKey] )</h1>
<p>When the `hasOwnMetadata` function is called with arguments _metadataKey_, _target_, and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand All @@ -372,7 +369,7 @@ <h1>Reflect.hasOwnMetadata ( metadataKey, target, propertyKey )</h1>
</emu-clause>

<emu-clause id="reflect-getmetadata">
<h1>Reflect.getMetadata ( metadataKey, target, propertyKey )</h1>
<h1>Reflect.getMetadata ( metadataKey, target [, propertyKey] )</h1>
<p>When the `getMetadata` function is called with arguments _metadataKey_, _target_, and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand All @@ -381,7 +378,7 @@ <h1>Reflect.getMetadata ( metadataKey, target, propertyKey )</h1>
</emu-clause>

<emu-clause id="reflect-getownmetadata">
<h1>Reflect.getOwnMetadata ( metadataKey, target, propertyKey )</h1>
<h1>Reflect.getOwnMetadata ( metadataKey, target [, propertyKey] )</h1>
<p>When the `getOwnMetadata` function is called with arguments _metadataKey_, _target_, and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand All @@ -390,7 +387,7 @@ <h1>Reflect.getOwnMetadata ( metadataKey, target, propertyKey )</h1>
</emu-clause>

<emu-clause id="reflect-getmetadatakeys">
<h1>Reflect.getMetadataKeys ( target, propertyKey )</h1>
<h1>Reflect.getMetadataKeys ( target [, propertyKey] )</h1>
<p>When the `getMetadataKeys` function is called with arguments _target_ and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand All @@ -399,7 +396,7 @@ <h1>Reflect.getMetadataKeys ( target, propertyKey )</h1>
</emu-clause>

<emu-clause id="reflect-getownmetadata">
<h1>Reflect.getOwnMetadataKeys ( target, propertyKey )</h1>
<h1>Reflect.getOwnMetadataKeys ( target [, propertyKey] )</h1>
<p>When the `getOwnMetadataKeys` function is called with arguments _target_ and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand All @@ -408,7 +405,7 @@ <h1>Reflect.getOwnMetadataKeys ( target, propertyKey )</h1>
</emu-clause>

<emu-clause id="reflect-deletemetadata">
<h1>Reflect.deleteMetadata ( metadataKey, target, propertyKey )</h1>
<h1>Reflect.deleteMetadata ( metadataKey, target [, propertyKey] )</h1>
<p>When the `deleteMetadata` function is called with arguments _metadataKey_, _target_, and _propertyKey_, the following steps are taken:</p>
<emu-alg>
1. If Type(_target_) is not Object, throw a *TypeError* exception.
Expand Down
Loading

0 comments on commit ffc554c

Please sign in to comment.