UNPKG

vite-plugin-shopify-theme-islands

Version:
29 lines (28 loc) 1.22 kB
import type { ResolveTagFn } from "./options.js"; export interface TagOwnershipRecord { absoluteFilePath: string; filePath: string; defaultTag: string; resolvedTag: string | false; } export interface TagOwnershipInputs { files: Array<{ absoluteFilePath: string; filePath: string; }>; tagSource: "registeredTag" | "filename"; resolveTag?: ResolveTagFn; getFileContent: (absoluteFilePath: string) => string | null; } export declare function readStaticDefinedTags(content: string): string[]; /** * Derives effective Tag ownership for every Island file in the inventory. * Throws when duplicate final Tag ownership is detected. * Warns (filename mode only) when the static Registered Tag mismatches the resolved Tag. */ export declare function analyzeTagOwnership(inputs: TagOwnershipInputs): TagOwnershipRecord[]; /** * Re-derives the effective tag for one Island file. * Returns null when unreadable or indeterminate (filename mode, or multiple/zero static tags). */ export declare function recomputeFileTagOwnership(absoluteFilePath: string, filePath: string, inputs: Pick<TagOwnershipInputs, "tagSource" | "resolveTag" | "getFileContent">): string | false | null;