UNPKG

@thi.ng/imago

Version:

JSON & API-based declarative and extensible image processing trees/pipelines

38 lines 1.33 kB
import type { TypedArray } from "@thi.ng/api"; import type { ImgProcCtx, OutputSpec } from "./api.js"; /** * Expands/replaces all `{xyz}`-templated identifiers in given file path and * makes result an absolute path (if needed). * * @remarks * If the input path is not yet absolute, it will be joined with the * {@link ImgProcOpts.outDir}. * * The following built-in IDs are supported and custom IDs will be looked up via * the {@link ImgProcOpts.pathParts} options provided to {@link processImage}. * Any others will remain as is. Custom IDs take precedence over built-in ones. * * - `name`: original base filename (w/o ext) * - `sha1/224/256/384/512`: truncated hash of output * - `w`: current width * - `h`: current height * - `aspect`: "p" (portrait), "l" (landscape) or "sq" (square) * - `date`: yyyyMMdd * - `time`: HHmmss * - `year`: 4-digit year * - `month`: 2-digit month * - `week`: 2-digit week * - `day`: 2-digit day in month * - `hour`: 2-digit hour (24h system) * - `minute`: 2-digit minute * - `second`: 2-digit second * * All date/time related values will be in UTC. * * @param path * @param ctx * @param spec * @param buf */ export declare const formatPath: (path: string, ctx: ImgProcCtx, spec: OutputSpec, buf: Buffer | TypedArray) => string; //# sourceMappingURL=path.d.ts.map