
// Source-derived types for the upstream post.js facade (not emitted by embind).
export interface HeifRGBAImageData {
  width: number;
  height: number;
  data: Uint8ClampedArray;
}
export interface HeifPostImage {
  handle: heif_image_handle | null;
  get_width(): number;
  get_height(): number;
  is_primary(): boolean;
  has_alpha_channel(): boolean;
  is_premultiplied_alpha(): boolean;
  display(data: HeifRGBAImageData, callback: (result: HeifRGBAImageData | null) => void): void;
  free(): void;
}
export interface HeifPostDecoder {
  decoder: heif_context | null;
  decode(buffer: Uint8Array): HeifPostImage[];
}
interface HeifPostModule {
  HeifDecoder: { new(): HeifPostDecoder };
  HeifImage: { new(handle: heif_image_handle): HeifPostImage };
  fourcc(value: string): number;
}
type HeifFlatEnumValues = Omit<EmbindModule['heif_error_code'], 'values'>
  & Omit<EmbindModule['heif_suberror_code'], 'values'>
  & Omit<EmbindModule['heif_compression_format'], 'values'>
  & Omit<EmbindModule['heif_chroma'], 'values'>
  & Omit<EmbindModule['heif_colorspace'], 'values'>
  & Omit<EmbindModule['heif_channel'], 'values'>;
type HeifNativeAliases = {
  [K in keyof WasmModule as K extends `_${infer Name}`
    ? Name extends `heif_${string}` ? Name extends keyof EmbindModule ? never : Name : never
    : never]: WasmModule[K];
};
