UNPKG

ts-browser-helpers

Version:

A collection of utility classes, functions and decorators for javascript/typescript projects, for use in the browser.

58 lines 1.54 kB
/** * A template literal tag that does nothing. Useful for syntax highlighting of GLSL code. * * @example * ```js * const vertexShader = glsl` * void main() {} * ` * ``` * @category Template Literals */ export declare const glsl: (strings: any, ...rest: any[]) => string; /** * A template literal tag that does nothing. Useful for syntax highlighting of CSS code. * * @example * ```js * const vertexShader = css` * .my-class { * color: red; * } * ` * ``` * @category Template Literals */ export declare const css: (strings: any, ...rest: any[]) => string; /** * A template literal tag that does nothing. Useful for syntax highlighting of HTML code. * * @example * ```js * const vertexShader = html` * <div class="my-class"> * <p>Some text</p> * </div> * ` * ``` * @category Template Literals */ export declare const html: (strings: any, ...rest: any[]) => string; /** * Converts an SVG string to data url. This is useful for creating images from SVGs, or using SVGs in CSS. * To use put in template string: ```url(${svgUrl`<svg>...</svg>`})``` * @param strings - template strings * @param rest - template values * * @example * ```typescript * const url = svgUrl` * <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> ... </svg> * ` * console.log(url) // data:image/svg+xml;charset=UTF-8,... * ``` * * @category Template Literals */ export declare const svgUrl: (strings: any, ...rest: any[]) => string; //# sourceMappingURL=template-literals.d.ts.map