@@ -399,84 +399,84 @@ class TemplateClass<T = unknown> extends String {
399399 * @param extension The file extension (without the dot)
400400 * @returns A template tag function for the specified extension
401401 */
402- export function ext < Type extends string > (
402+ export function tag < Type extends string > (
403403 type : Type ,
404404 parser ?: ( text : string ) => unknown ,
405405 options ?: {
406406 indent : false | number ;
407407 } ,
408- ) : Ext < Type > {
408+ ) : Tag < Type > {
409409 return < T > (
410410 template : { raw : readonly string [ ] | ArrayLike < string > } ,
411411 ...substitutions : any [ ]
412412 ) => new TemplateClass ( type , template , substitutions , parser , options ) as Template < T > ;
413413}
414414
415- type Ext < Type extends string > = < T > (
415+ type Tag < Type extends string > = < T > (
416416 template : { raw : readonly string [ ] | ArrayLike < string > } ,
417417 ...substitutions : any [ ]
418418) => Template < T > ;
419419
420420// Export all template functions individually
421421// Web languages
422- export const html : Ext < "html" > = ext ( "html" ) ;
423- export const css : Ext < "css" > = ext ( "css" ) ;
424- export const js : Ext < "js" > = ext ( "js" ) ;
425- export const ts : Ext < "ts" > = ext ( "ts" ) ;
426- export const jsx : Ext < "jsx" > = ext ( "jsx" ) ;
427- export const tsx : Ext < "tsx" > = ext ( "tsx" ) ;
422+ export const html : Tag < "html" > = tag ( "html" ) ;
423+ export const css : Tag < "css" > = tag ( "css" ) ;
424+ export const js : Tag < "js" > = tag ( "js" ) ;
425+ export const ts : Tag < "ts" > = tag ( "ts" ) ;
426+ export const jsx : Tag < "jsx" > = tag ( "jsx" ) ;
427+ export const tsx : Tag < "tsx" > = tag ( "tsx" ) ;
428428
429429// Data formats
430- export const json : Ext < "json" > = ext ( "json" , JSON . parse ) ;
431- export const xml : Ext < "xml" > = ext ( "xml" ) ;
432- export const yaml : Ext < "yaml" > = ext ( "yaml" , YAML . parse ) ;
433- export const toml : Ext < "toml" > = ext ( "toml" ) ;
434- export const ini : Ext < "ini" > = ext ( "ini" ) ;
435- export const csv : Ext < "csv" > = ext ( "csv" ) ;
430+ export const json : Tag < "json" > = tag ( "json" , JSON . parse ) ;
431+ export const xml : Tag < "xml" > = tag ( "xml" ) ;
432+ export const yaml : Tag < "yaml" > = tag ( "yaml" , YAML . parse ) ;
433+ export const toml : Tag < "toml" > = tag ( "toml" ) ;
434+ export const ini : Tag < "ini" > = tag ( "ini" ) ;
435+ export const csv : Tag < "csv" > = tag ( "csv" ) ;
436436
437437// Markup languages
438- export const md : Ext < "md" > = ext ( "md" ) ;
439- export const tex : Ext < "tex" > = ext ( "tex" ) ;
440- export const rst : Ext < "rst" > = ext ( "rst" ) ;
438+ export const md : Tag < "md" > = tag ( "md" ) ;
439+ export const tex : Tag < "tex" > = tag ( "tex" ) ;
440+ export const rst : Tag < "rst" > = tag ( "rst" ) ;
441441
442442// Query languages
443- export const sql : Ext < "sql" > = ext ( "sql" ) ;
444- export const graphql : Ext < "graphql" > = ext ( "graphql" ) ;
443+ export const sql : Tag < "sql" > = tag ( "sql" ) ;
444+ export const graphql : Tag < "graphql" > = tag ( "graphql" ) ;
445445
446446// Shell scripting
447- export const sh : Ext < "sh" > = ext ( "sh" ) ;
448- export const ps1 : Ext < "ps1" > = ext ( "ps1" ) ;
449- export const bat : Ext < "bat" > = ext ( "bat" ) ;
447+ export const sh : Tag < "sh" > = tag ( "sh" ) ;
448+ export const ps1 : Tag < "ps1" > = tag ( "ps1" ) ;
449+ export const bat : Tag < "bat" > = tag ( "bat" ) ;
450450
451451// Programming languages
452- export const py : Ext < "py" > = ext ( "py" ) ;
453- export const rb : Ext < "rb" > = ext ( "rb" ) ;
454- export const go : Ext < "go" > = ext ( "go" ) ;
455- export const rs : Ext < "rs" > = ext ( "rs" ) ;
456- export const c : Ext < "c" > = ext ( "c" ) ;
457- export const cpp : Ext < "cpp" > = ext ( "cpp" ) ;
458- export const cs : Ext < "cs" > = ext ( "cs" ) ;
459- export const java : Ext < "java" > = ext ( "java" ) ;
460- export const php : Ext < "php" > = ext ( "php" ) ;
461- export const swift : Ext < "swift" > = ext ( "swift" ) ;
462- export const kt : Ext < "kt" > = ext ( "kt" ) ;
463- export const scala : Ext < "scala" > = ext ( "scala" ) ;
464- export const dart : Ext < "dart" > = ext ( "dart" ) ;
465- export const lua : Ext < "lua" > = ext ( "lua" ) ;
466- export const pl : Ext < "pl" > = ext ( "pl" ) ;
467- export const r : Ext < "r" > = ext ( "r" ) ;
468- export const elm : Ext < "elm" > = ext ( "elm" ) ;
469- export const fs : Ext < "fs" > = ext ( "fs" ) ;
470- export const clj : Ext < "clj" > = ext ( "clj" ) ;
471- export const hs : Ext < "hs" > = ext ( "hs" ) ;
452+ export const py : Tag < "py" > = tag ( "py" ) ;
453+ export const rb : Tag < "rb" > = tag ( "rb" ) ;
454+ export const go : Tag < "go" > = tag ( "go" ) ;
455+ export const rs : Tag < "rs" > = tag ( "rs" ) ;
456+ export const c : Tag < "c" > = tag ( "c" ) ;
457+ export const cpp : Tag < "cpp" > = tag ( "cpp" ) ;
458+ export const cs : Tag < "cs" > = tag ( "cs" ) ;
459+ export const java : Tag < "java" > = tag ( "java" ) ;
460+ export const php : Tag < "php" > = tag ( "php" ) ;
461+ export const swift : Tag < "swift" > = tag ( "swift" ) ;
462+ export const kt : Tag < "kt" > = tag ( "kt" ) ;
463+ export const scala : Tag < "scala" > = tag ( "scala" ) ;
464+ export const dart : Tag < "dart" > = tag ( "dart" ) ;
465+ export const lua : Tag < "lua" > = tag ( "lua" ) ;
466+ export const pl : Tag < "pl" > = tag ( "pl" ) ;
467+ export const r : Tag < "r" > = tag ( "r" ) ;
468+ export const elm : Tag < "elm" > = tag ( "elm" ) ;
469+ export const fs : Tag < "fs" > = tag ( "fs" ) ;
470+ export const clj : Tag < "clj" > = tag ( "clj" ) ;
471+ export const hs : Tag < "hs" > = tag ( "hs" ) ;
472472
473473// Configuration files
474- export const dockerfile : Ext < "dockerfile" > = ext ( "dockerfile" ) ;
475- export const makefile : Ext < "makefile" > = ext ( "makefile" ) ;
476- export const mk : Ext < "mk" > = ext ( "mk" ) ;
474+ export const dockerfile : Tag < "dockerfile" > = tag ( "dockerfile" ) ;
475+ export const makefile : Tag < "makefile" > = tag ( "makefile" ) ;
476+ export const mk : Tag < "mk" > = tag ( "mk" ) ;
477477
478478// Other
479- export const svg : Ext < "svg" > = ext ( "svg" ) ;
480- export const diff : Ext < "diff" > = ext ( "diff" ) ;
481- export const proto : Ext < "proto" > = ext ( "proto" ) ;
482- export const sol : Ext < "sol" > = ext ( "sol" ) ;
479+ export const svg : Tag < "svg" > = tag ( "svg" ) ;
480+ export const diff : Tag < "diff" > = tag ( "diff" ) ;
481+ export const proto : Tag < "proto" > = tag ( "proto" ) ;
482+ export const sol : Tag < "sol" > = tag ( "sol" ) ;
0 commit comments