@mymj/midjourney
Version:
Node.js client for the unofficial MidJourney API.
76 lines (75 loc) • 2.66 kB
TypeScript
import { LoadingHandler, MJConfig, MJConfigParam, MJMessage, MJEmit, MJSettings } from "./interfaces";
import { MidjourneyApi } from "./midjourney.api";
import { MidjourneyMessage } from "./discord.message";
export declare class Midjourney extends MidjourneyMessage {
config: MJConfig;
private wsClient?;
MJApi: MidjourneyApi;
constructor(defaults: MJConfigParam);
Connect(): Promise<this>;
init(): Promise<this>;
Imagine(prompt: string, loading?: LoadingHandler): Promise<MJMessage | null>;
private getWsClient;
Settings(): Promise<MJSettings>;
Reset(): Promise<void>;
Info(): Promise<import("./interfaces").MJInfo>;
Subscribe(): Promise<import("./interfaces").MJSubscribe>;
Stealth(): Promise<null>;
Turbo(): Promise<null>;
Fast(): Promise<null>;
Relax(): Promise<null>;
SwitchRemix(): Promise<any>;
Describe(imgUri: string): Promise<any>;
DescribeByBlob(blob: Blob): Promise<any>;
Shorten(prompt: string): Promise<any>;
Variation({ index, msgId, hash, content, flags, loading, }: {
index: 1 | 2 | 3 | 4;
msgId: string;
hash: string;
content?: string;
flags: number;
loading?: LoadingHandler;
}): Promise<MJMessage | null>;
Upscale({ index, msgId, hash, content, flags, loading, }: {
index: 1 | 2 | 3 | 4;
msgId: string;
hash: string;
content?: string;
flags: number;
loading?: LoadingHandler;
}): Promise<MJMessage | null>;
Custom({ msgId, customId, content, flags, loading, }: {
msgId: string;
customId: string;
content?: string;
flags: number;
loading?: LoadingHandler;
}): Promise<MJMessage | null>;
VaryRegion({ msgId, content, mask, flags, customId, loading, }: {
msgId: string;
flags: number;
content: string;
mask: string;
customId: string;
loading?: LoadingHandler;
}): Promise<MJMessage | null>;
ZoomOut({ level, msgId, hash, content, flags, loading, }: {
level: "high" | "low" | "2x" | "1.5x";
msgId: string;
hash: string;
content?: string;
flags: number;
loading?: LoadingHandler;
}): Promise<MJMessage | null>;
Reroll({ msgId, hash, content, flags, loading, }: {
msgId: string;
hash: string;
content?: string;
flags: number;
loading?: LoadingHandler;
}): Promise<MJMessage | null>;
FaceSwap(target: string, source: string): Promise<any>;
watch(callback: (msg: MJEmit) => void): void;
isReady(): Promise<boolean>;
Close(): void;
}