Skip to content
On this page

API Report File for "entanclature"

Do not edit this file. It is a report generated by API Extractor.

ts

// @public
export type Decoded = {
    hash: string;
    meta: {
        type: Type;
        quality?: Quality;
    }[];
    check?: string;
};

// @public
export type Encoded = {
    name: string;
    type?: Type;
};

// @public
export const entanclature: typeof router & {
    fromURL: typeof fromURL;
    fromFile: typeof fromFile;
};

// @public
export type Ext = ValueOf<typeof GRAMMAR>["ext"][number];

// @public
export function fromFile(path: string, meta: Meta, opts: Opts): Promise<Result>;

// @public
export function fromURL(url: string | URL): Result;

// @public
export const GRAMMAR: {
    readonly A: {
        readonly type: "image/avif";
        readonly ext: readonly ["avif"];
    };
    readonly G: {
        readonly type: "image/gif";
        readonly ext: readonly ["gif"];
    };
    readonly J: {
        readonly type: "image/jpeg";
        readonly ext: readonly ["jpeg", "jpg"];
    };
    readonly P: {
        readonly type: "image/png";
        readonly ext: readonly ["png"];
    };
    readonly T: {
        readonly type: "image/tiff";
        readonly ext: readonly ["tiff", "tif"];
    };
    readonly W: {
        readonly type: "image/webp";
        readonly ext: readonly ["webp"];
    };
};

// @public
export type Mark = keyof typeof GRAMMAR;

// @public
export type Meta = Decoded["meta"];

// @public
export type Opts = {
    baseURL: string;
    fileDir: string;
    ext?: boolean;
};

// @public
export type Quality = number | "+" | "-" | undefined;

// @public
export type Result = {
    transform: boolean;
    baseURL: string;
    fileDir: string;
    files: Encoded[];
    urls: URL[];
};

// @public
export function router(url: string | URL): Promise<Result>;

// @public
export function router(path: string, meta: Meta, opts: Opts): Promise<Result>;

// @public
export type Type = ValueOf<typeof GRAMMAR>["type"];

// @public
export type ValueOf<T> = T[keyof T];

Released under the CC-BY-SA-4.0 License.