vite-plugin-shopify-theme-islands
Version:
Vite plugin for island architecture in Shopify themes
24 lines (23 loc) • 1.27 kB
TypeScript
/**
* Curated interaction events accepted by `client:interaction`.
*
* The list is intentionally narrow: these are the user-intent signals the
* plugin supports for now, and they are exposed as a package-owned union so
* config can be type-checked without relying on the DOM lib surface.
*/
export declare const INTERACTION_EVENT_NAMES: readonly ["mouseenter", "touchstart", "focusin"];
export type InteractionEventName = (typeof INTERACTION_EVENT_NAMES)[number];
export declare const DEFAULT_INTERACTION_EVENTS: readonly ["mouseenter", "touchstart", "focusin"];
export declare const INTERACTION_EVENT_NAMES_LABEL: string;
export interface InteractionEventTokenPartition {
valid: InteractionEventName[];
invalid: string[];
}
export declare function isInteractionEventName(value: string): value is InteractionEventName;
export declare function validateInteractionEvents(events: readonly string[] | undefined): asserts events is readonly InteractionEventName[];
export declare function partitionInteractionEventTokens(tokens: readonly string[]): InteractionEventTokenPartition;
export declare function formatUnsupportedInteractionTokenWarning(params: {
attribute: string;
invalidTokens: readonly string[];
usedDefaultEvents: boolean;
}): string;