@types/gulp-ttf2woff2
TypeScript icon, indicating that this package has built-in type declarations

4.0.4 • Public • Published

Installation

npm install --save @types/gulp-ttf2woff2

Summary

This package contains type definitions for gulp-ttf2woff2 (https://github.com/nfroidure/gulp-ttf2woff2).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gulp-ttf2woff2.

index.d.ts

/// <reference types="node"/>

import PluginError = require("plugin-error");

declare namespace ttf2woff2 {
    interface Options {
        /**
         * Also convert files that doesn't have the .ttf extension.
         */
        ignoreExt?: boolean;

        /**
         * Clone the file before converting him so that it will output the original file too.
         */
        clone?: boolean;
    }

    /**
     * Callback function handling the buffered content
     */
    type FileTransformCallback = <TResult, TError>(
        err: TError | null,
        buf: Buffer | undefined,
        cb: (err: PluginError<TError> | PluginError<Error> | null, buf: Buffer | undefined) => TResult,
    ) => TResult;

    /**
     * File level transform function (for use by other plugins)
     */
    function fileTransform(): FileTransformCallback;
}

/**
 * Create a WOFF2 font from a TTF font with Gulp
 *
 * @example
 * const ttf2woff2 = require('gulp-ttf2woff2');
 *
 * gulp.task('ttf2woff2', function(){
 *   gulp.src(['fonts/*.ttf'])
 *     .pipe(ttf2woff2())
 *     .pipe(gulp.dest('fonts/'));
 * });
 */
declare function ttf2woff2(options?: ttf2woff2.Options): NodeJS.ReadWriteStream;

export = ttf2woff2;

Additional Details

Credits

These definitions were written by Anatoly Pitikin.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/gulp-ttf2woff2

Weekly Downloads

298

Version

4.0.4

License

MIT

Unpacked Size

5.17 kB

Total Files

5

Last publish

Collaborators

  • types