diff --git a/docs/properties.md b/docs/properties.md index 0f5b3f0fd..61d3bdf3c 100644 --- a/docs/properties.md +++ b/docs/properties.md @@ -116,7 +116,7 @@ Style Dictionary adds some metadata on each property that helps with transforms | Attribute | Type | Description | | :--- | :--- | :--- | | name | String | A default name of the property that is set to the key of the property. -| path | Array[String] | The object path of the property. `color: { background: primary: {value: "#fff"}}` will have a path of `['color','background', 'primary']`. +| path | Array[String] | The object path of the property. `color: { background: { primary: { value: "#fff" } } }` will have a path of `['color','background', 'primary']`. | original | Object | A pristine copy of the original property object. This is to make sure transforms and formats always have the unmodified version of the original property. | filePath | String | The file path of the file the token is defined in. This file path is derived from the `source` or `include` file path arrays defined in the [configuration](config.md). | isSource | Boolean | If the token is from a file defined in the `source` array as opposed to `include` in the [configuration](config.md). diff --git a/types/index.d.ts b/types/index.d.ts index 66c68519f..baa3b4cd2 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -66,11 +66,31 @@ declare namespace StyleDictionary { } interface Prop { - original: Property; + /** A default name of the property that is set to the key of the property. */ name: string; - attributes: Attributes; - path: string[]; value: string; + /** The object path of the property. + * + * `color: { background: { primary: { value: "#fff" } } }` will have a path of `['color', 'background', 'primary']`. + */ + path: string[]; + /** + * A pristine copy of the original property object. + * + * This is to make sure transforms and formats always have the unmodified version of the original property. + */ + original: Property; + /** + * The file path of the file the token is defined in. + * + * This file path is derived from the source or include file path arrays defined in the configuration. + */ + filePath: string; + /** + * If the token is from a file defined in the source array as opposed to include in the [configuration](https://amzn.github.io/style-dictionary/#/config). + */ + isSource: boolean; + attributes: Attributes; [key: string]: any; }