UNPKG

vite-plugin-vanjs

Version:

An async first mini meta-framework for VanJS powered by Vite

44 lines (32 loc) 1.2 kB
/// <reference path="global.d.ts" /> import { type PropsWithKnownKeys } from "vanjs-core"; import { type TagFunc } from "mini-van-plate/van-plate"; export const createHeadTags: () => Map< string, SupportedTags | TagFunc<SupportedTags> >; export const getHeadTags = () => (Map<string, SupportedTags | TagFunc<SupportedTags>>); export const resetHeadTags: () => void; export const initializeHeadTags: () => void | (() => Promise<void>); export type SupportedTags = | HTMLTitleElement | HTMLLinkElement | HTMLScriptElement | HTMLMetaElement; export type AllHeadTags = | HTMLTitleElement | HTMLMetaElement | HTMLScriptElement | HTMLLinkElement | HTMLStyleElement; export type TagProps = SupportedTags | PropsWithKnownKeys<SupportedTags>; export type HeadTags = AllHeadTags[] | TagFunc[]; export const addMeta = (_tag: string | Partial<SupportedTags>) => null; export const removeMeta = (_tag: string | Partial<SupportedTags>) => null; export const Head: () => HeadTags; export const parseAttributes: ( attributeString: string, ) => Record<string, string>; export const getTagAttribute: (tag: TagProps) => string; export const getTagKey: (tag: TagProps) => string;