@maizzle/framework
Version:
Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.
31 lines (30 loc) • 1.02 kB
TypeScript
import { ParsedPath } from "node:path";
//#region src/composables/useCurrentTemplate.d.ts
/**
* Internal — set by the build loop before each template iteration and
* cleared in `finally`. Not exported from the package entrypoint.
*/
declare function _setCurrentTemplate(parsed: ParsedPath | undefined): void;
/**
* Returns the parsed path of the template currently being processed,
* or `undefined` when called outside the per-template scope (e.g. from
* `beforeCreate` / `afterBuild`, or outside a build entirely).
*
* Usage in an SFC `<script setup>`:
* ```ts
* const file = useCurrentTemplate()
* console.log(file?.name) // 'welcome'
* ```
*
* Usage in an event handler:
* ```ts
* beforeRender() {
* const file = useCurrentTemplate()
* // file?.dir, file?.name, file?.ext, file?.base, file?.root
* }
* ```
*/
declare function useCurrentTemplate(): ParsedPath | undefined;
//#endregion
export { _setCurrentTemplate, useCurrentTemplate };
//# sourceMappingURL=useCurrentTemplate.d.ts.map