UNPKG

@zilero/gulp-font-switcher

Version:

A powerful Gulp plugin for font optimization and compression

61 lines (56 loc) 1.79 kB
import * as stream from 'stream'; import { Transform } from 'stream'; import { z } from 'zod'; type PluginDesc = (...args: any[]) => Transform; interface GlyphPluginOptions { /** * use this text to generate compressed font */ text: string; /** * add basic chars to glyph, default false * @example "!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}" */ basicText?: boolean; /** * keep gylph hinting, defaul true */ hinting?: boolean; /** * use other plugin */ use?: PluginDesc; } declare const gulpFontSwitcherSchema: z.ZodObject<{ fontOptions: z.ZodOptional<z.ZodObject<{ glyph: z.ZodOptional<z.ZodType<GlyphPluginOptions, z.ZodTypeDef, GlyphPluginOptions>>; }, "strip", z.ZodTypeAny, { glyph?: GlyphPluginOptions | undefined; }, { glyph?: GlyphPluginOptions | undefined; }>>; pluginOptions: z.ZodObject<{ format: z.ZodEnum<["ttf", "woff", "woff2", "eot", "svg"]>; }, "strip", z.ZodTypeAny, { format: "ttf" | "woff" | "woff2" | "eot" | "svg"; }, { format: "ttf" | "woff" | "woff2" | "eot" | "svg"; }>; }, "strip", z.ZodTypeAny, { pluginOptions: { format: "ttf" | "woff" | "woff2" | "eot" | "svg"; }; fontOptions?: { glyph?: GlyphPluginOptions | undefined; } | undefined; }, { pluginOptions: { format: "ttf" | "woff" | "woff2" | "eot" | "svg"; }; fontOptions?: { glyph?: GlyphPluginOptions | undefined; } | undefined; }>; type GulpFontSwitcherOptions = z.infer<typeof gulpFontSwitcherSchema>; declare const GulpFontSwitcher: (options: GulpFontSwitcherOptions) => stream.Transform; export { GulpFontSwitcher as default };