import type { SeelenCommandArgument, SeelenCommandReturn, SeelenEventPayload } from "../../gen/types/mod.js"; import { type InvokeOptions } from "@tauri-apps/api/core"; import { type EventCallback, type Options as ListenerOptions } from "@tauri-apps/api/event"; import type { SeelenCommand } from "./commands.js"; import type { SeelenEvent } from "./events.js"; type $keyof = [Type] extends [never] ? keyof Type : Type extends Type ? keyof Type : never; type UnionToIntersection = { [Key in $keyof]: Extract[Key]; }; type MapNullToVoid = { [K in keyof Obj]: [Obj[K]] extends [null] ? void : Obj[K]; }; type MapNullToUndefined = { [K in keyof Obj]: [Obj[K]] extends [null] ? undefined : Obj[K]; }; export type AllSeelenCommandArguments = MapNullToUndefined>; export type AllSeelenCommandReturns = MapNullToVoid>; export type AllSeelenEventPayloads = UnionToIntersection; /** * Will call to the background process * @args Command to be called * @args Command arguments * @return Result of the command */ export declare function invoke(...args: [AllSeelenCommandArguments[T]] extends [undefined] ? [ command: T, args?: undefined, options?: InvokeOptions ] : [ command: T, args: AllSeelenCommandArguments[T], options?: InvokeOptions ]): Promise; export type UnSubscriber = () => void; export declare function subscribe(event: T, cb: EventCallback, options?: ListenerOptions): Promise; export * from "./events.js"; export * from "./commands.js"; //# sourceMappingURL=mod.d.ts.map