/* tslint:disable */
/* eslint-disable */

/* auto-generated by NAPI-RS */

export interface JsMacroError {
  kind: number;
  message: string;
}
export declare function findAncestorFile(
  filenames: Array<string>,
  from: string,
  root: string,
): string | null;
export declare function findFirstFile(names: Array<string>): string | null;
export declare function findNodeModule(
  module: string,
  from: string,
): string | null;
export declare function hashString(s: string): string;
export declare function hashBuffer(buf: Buffer): string;
export declare function optimizeImage(kind: string, buf: Buffer): Buffer;
export declare function transformHtml(opts: object): unknown;
export declare function packageHtml(opts: object): unknown;
export declare function optimizeHtml(opts: object): unknown;
export declare function transformSvg(opts: object): unknown;
export declare function packageSvg(opts: object): unknown;
export declare function optimizeSvg(opts: object): unknown;
export declare function svgReact(opts: object): unknown;
export interface JsFileSystemOptions {
  read: (...args: any[]) => any;
  readLink: (...args: any[]) => any;
  kind: (...args: any[]) => any;
  includeNodeModules?: NapiSideEffectsVariants;
}
export interface FileSystem {
  fs?: JsFileSystemOptions;
  includeNodeModules?: NapiSideEffectsVariants;
  conditions?: number;
  moduleDirResolver?: (...args: any[]) => any;
  mode: number;
  entries?: number;
  extensions?: Array<string>;
  packageExports: boolean;
  typescript?: boolean;
}
export interface ResolveOptions {
  filename: string;
  specifierType: string;
  parent: string;
  packageConditions?: Array<string>;
}
export interface FilePathCreateInvalidation {
  filePath: string;
}
export interface FileNameCreateInvalidation {
  fileName: string;
  aboveFilePath: string;
}
export interface GlobCreateInvalidation {
  glob: string;
}
export interface ResolveResult {
  resolution: unknown;
  invalidateOnFileChange: Array<string>;
  invalidateOnFileCreate: Array<
    | FilePathCreateInvalidation
    | FileNameCreateInvalidation
    | GlobCreateInvalidation
  >;
  query?: string;
  sideEffects: boolean;
  error: unknown;
  moduleType: number;
}
export interface JsInvalidations {
  invalidateOnFileChange: Array<string>;
  invalidateOnFileCreate: Array<
    | FilePathCreateInvalidation
    | FileNameCreateInvalidation
    | GlobCreateInvalidation
  >;
  invalidateOnStartup: boolean;
}
export declare function transform(opts: object): unknown;
export declare function transformAsync(opts: object): object;
export declare class Hash {
  constructor();
  writeString(s: string): void;
  writeBuffer(buf: Buffer): void;
  finish(): string;
}
export declare class Resolver {
  constructor(projectRoot: string, options: FileSystem);
  resolve(options: ResolveOptions): ResolveResult;
  resolveAsync(): object;
  resolveAsync(options: ResolveOptions): object;
  getInvalidations(path: string): JsInvalidations;
  getInvalidations(path: string): JsInvalidations;
}
