easy-api.ts
Version:
A powerful library to create your own API with ease.
43 lines (42 loc) • 1.16 kB
TypeScript
import { CompiledFunction } from "../../classes/internal/CompiledFunction";
import { APIFunction, ParamType } from "../../classes/structures/APIFunction";
import { Data } from "../../classes/structures/Data";
/**
* Represents a required JavaScript library.
*/
export interface RequiredPackages {
/**
* Library name to be required.
*/
name: string;
/**
* Property to be required from the library.
* Type "null" represents a CommonJS import.
*/
property: string | null;
}
export default class AddPackage extends APIFunction {
name: string;
description: string;
parameters: ({
name: string;
description: string;
type: ParamType;
required: boolean;
rest: boolean;
defaultValue: null;
} | {
name: string;
description: string;
type: ParamType;
required: boolean;
rest: boolean;
defaultValue: string;
})[];
usage: string;
returns: ParamType;
aliases: string[];
compile: boolean;
example: string;
run(this: CompiledFunction, d: Data, [name, property]: string[]): Promise<void>;
}