koishi-plugin-booru
Version:
Image service for Koishi
25 lines (24 loc) • 897 B
TypeScript
import { Context, Schema } from 'koishi';
import { ImageSource } from '../../source';
declare class SankakuComplexImageSource extends ImageSource<SankakuComplexImageSource.Config> {
languages: string[];
source: string;
constructor(ctx: Context, config: SankakuComplexImageSource.Config);
get keyPair(): SankakuComplexImageSource.KeyPair;
get(query: ImageSource.Query): Promise<ImageSource.Result[]>;
_login(keyPair: SankakuComplexImageSource.KeyPair): Promise<SankakuComplexImageSource.KeyPair>;
}
declare namespace SankakuComplexImageSource {
interface KeyPair {
login?: string;
password?: string;
tokenType?: string;
accessToken?: string;
}
interface Config extends ImageSource.Config {
keyPairs: KeyPair[];
userAgent: string;
}
const Config: Schema<Config>;
}
export default SankakuComplexImageSource;