import { SerializedTemplateInfo , TemplateInfo , TemplateInfoFactory , } from "@opticss/template-api" ; export const TEMPLATE_NAME = "HandlebarsTemplate" ; export type TEMPLATE_TYPE = typeof TEMPLATE_NAME ; export class HandlebarsTemplate implements TemplateInfo < TEMPLATE_TYPE > { identifier : string ; fullPath : string ; relativePath : string ; type : TEMPLATE_TYPE = TEMPLATE_NAME ; constructor ( fullPath , relativePath ) { this . identifier = fullPath ; this . fullPath = fullPath ; this . relativePath = relativePath ; } serialize ( ) { return { type : this . type , identifier : this . identifier , data : [ this . relativePath , ] , } ; } static deserialize ( identifier , relativePath ) { return new HandlebarsTemplate ( identifier , < string > relativePath ) ; } } TemplateInfoFactory . constructors [ TEMPLATE_NAME ] = HandlebarsTemplate . deserialize ; declare module "@opticss/template-api" { interface TemplateTypes { [ TEMPLATE_NAME ] : HandlebarsTemplate ; } }