/** * Copyright (c) 2015-present, Waysact Pty Ltd * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /// import type { AssetInfo, Chunk, Compilation, Compiler, sources } from "webpack"; import type { HtmlTagObject } from "./types"; export type ChunkGroup = ReturnType; export declare const sriHashVariableReference = "__webpack_require__.sriHashes"; export declare function assert(value: unknown, message: string): asserts value; export declare function getTagSrc(tag: HtmlTagObject): string | undefined; export declare const normalizePath: (p: string) => string; export declare const placeholderPrefix = "*-*-*-CHUNK-SRI-HASH-"; export declare const placeholderRegex: RegExp; export declare const computeIntegrity: (hashFuncNames: string[], source: string | Buffer) => string; export declare const makePlaceholder: (hashFuncNames: string[], id: string | number) => string; export declare function addIfNotExist(set: Set, item: T): boolean; export declare function findChunks(chunk: Chunk): Set; export declare function notNil(value: TValue | null | undefined): value is TValue; export declare function generateSriHashPlaceholders(chunks: Iterable, hashFuncNames: [string, ...string[]]): Record; export declare function intersect(sets: Iterable>): Generator; export declare function intersectSets(setsToIntersect: Iterable>): Set; export declare function unionSet(...sets: Iterable[]): Set; export declare function map(items: Iterable, fn: (item: T) => TResult): Generator; export declare function flatMap(collections: Iterable, fn: (item: T) => Iterable): Generator; export declare function allChunksInGroupIterable(chunkGroup: ChunkGroup): Generator; export declare function allChunksInChunkIterable(chunk: Chunk): Generator; export declare function allChunksInPrimaryChunkIterable(chunk: Chunk): Generator; export declare function updateAsset(compilation: Compilation, assetPath: string, source: sources.Source, integrity: string, onUpdate: (assetInfo: AssetInfo) => void): void; export declare function tryGetSource(source: sources.Source): string | Buffer | undefined; export declare function replaceInSource(compiler: Compiler, source: sources.Source, path: string, replacements: Map): sources.Source; export declare function usesAnyHash(assetInfo: AssetInfo): boolean; export declare function hasOwnProperty(obj: X, prop: Y): obj is X & Record; //# sourceMappingURL=util.d.ts.map