diff --git a/types/Format.d.ts b/types/Format.d.ts index f2651a39c..1c07fe32f 100644 --- a/types/Format.d.ts +++ b/types/Format.d.ts @@ -44,4 +44,4 @@ export type Formatter = (arguments: FormatterArguments) => string; export interface Format { name: string; formatter: Formatter; -} \ No newline at end of file +} diff --git a/types/index.d.ts b/types/index.d.ts index e1f912906..f38ae1828 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -163,6 +163,26 @@ declare namespace StyleDictionary { */ registerFilter(filter: Named): this; + /** + * Add a custom file header to Style Dictionary. File headers are used to write a + * custom messasge on top of the generated files. + * @param {String} fileHeader.name The name of the file header to be added + * @param {Function} fileHeader.fileHeader The file header function + * @example + * ```js + * StyleDictionary.registerFileHeader({ + * name: 'custmoHeader', + * fileHeader: function(defaultMessage) { + * return return [ + * `hello`, + * ...defaultMessage + * ] + * } + * }) + * ``` + */ + registerFileHeader(fileHeader: Named<{ fileHeader: FileHeader }>): this; + /** * Adds a custom parser to parse style dictionary files. This allows you to modify * the design token data before it gets to Style Dictionary or write your @@ -306,4 +326,4 @@ declare namespace StyleDictionary { } declare var StyleDictionary: StyleDictionary.Core; -export = StyleDictionary; \ No newline at end of file +export = StyleDictionary;