UNPKG

@typed/content-hash

Version:

Content hash a directory of HTML/JS/CSS files and other static assets

38 lines 1.12 kB
import { Option } from 'fp-ts/Option'; export interface Document { readonly filePath: string; readonly fileExtension: string; readonly contents: string; readonly contentHash: Option<DocumentHash>; readonly dependencies: readonly Dependency[]; readonly sourceMap: Option<string>; readonly isBase64Encoded: boolean; } export interface Dependency { readonly specifier: string; readonly filePath: string; readonly fileExtension: string; readonly position: Position; } export interface Position { readonly start: number; readonly end: number; } export interface AssetManifest extends Readonly<Record<string, string>> { } export declare type DocumentHash = HashFor | ContentHash; /** * Use this hash if a Document should be rewritten with another Document's content hash */ export declare type HashFor = { readonly type: 'hashFor'; readonly filePath: string; }; /** * Use this hash if a Document should be rewritten with its own */ export declare type ContentHash = { readonly type: 'hash'; readonly hash: string; }; //# sourceMappingURL=model.d.ts.map