PEE/main.d.ts

65 lines
2.0 KiB
TypeScript
Raw Normal View History

2022-01-06 05:59:52 +00:00
declare module '*.css' {
export default string;
2022-01-08 18:01:01 +00:00
}
declare module '*.png' {
2022-01-12 05:31:58 +00:00
export default new Uint8Array;
}
2022-01-26 20:45:15 +00:00
declare module 'blockhash' {
export const hammingDistance: (a: string, b: string) => number;
export const blockhash: () => void;
export const blockhashData: (imgData: {
2022-01-26 20:45:15 +00:00
width: number,
height: number,
data: Uint8Array
}, bits: number, method: number) => string;
}
declare module "jpeg-js/lib/decoder" {
export interface RawImageData<T> {
width: number;
height: number;
data: T;
}
type BufferRet = RawImageData<Buffer>;
type UintArrRet = RawImageData<Uint8Array>;
type ImageData = BufferRet | UintArrRet;
type BufferLike = Buffer | Uint8Array | ArrayLike<number> | Iterable<number> | ArrayBuffer;
export declare function decode(
jpegData: BufferLike,
opts: {
useTArray: true;
colorTransform?: boolean;
formatAsRGBA?: boolean;
tolerantDecoding?: boolean;
maxResolutionInMP?: number;
maxMemoryUsageInMB?: number;
},
): UintArrRet & { comments?: string[] };
export declare function decode(
jpegData: BufferLike,
opts?: {
useTArray?: false;
colorTransform?: boolean;
formatAsRGBA?: boolean;
tolerantDecoding?: boolean;
maxResolutionInMP?: number;
maxMemoryUsageInMB?: number;
},
): BufferRet & { comments?: string[] };
}
2022-01-29 20:01:45 +00:00
declare const QR: any;
declare const BUILD_VERSION: [number, number];
declare const execution_mode: 'userscript' | 'chrome_api' | 'ff_api';
declare const isBackground: boolean;
declare const chrome: typeof browser;
2022-05-02 19:07:24 +00:00
declare const _DOMParser: typeof DOMParser;
declare const manifest: 2 | 3;
2022-05-09 12:32:05 +00:00
declare function GM_addElement(parent: HTMLElement, tagname: string, attrs: Record<string, string>);
declare function cloneInto<T>(e: T, where: Window & typeof globalThis | null): T;