guilded.ts
Version:
A powerful NPM module that allows you to easily interact with the Guilded API.
93 lines • 3.41 kB
TypeScript
import { APIDoc, APIMentions } from 'guilded-api-typings';
import { FetchOptions } from '../managers/BaseManager';
import { Base } from './Base';
import { DocChannel } from './channel/DocChannel';
/**
* Represents a doc on Guilded.
* @example new Doc(channel, rawDoc);
*/
export declare class Doc extends Base<number> {
readonly channel: DocChannel;
readonly raw: APIDoc;
/** The ID of the server the doc belongs to. */
readonly serverId: string;
/** The ID of the channel the doc belongs to. */
readonly channelId: string;
/** The title of the doc. */
readonly title: string;
/** The content of the doc. */
readonly content: string;
/** The mentions of the doc. */
readonly mentions?: APIMentions;
/** The date the doc was created. */
readonly createdAt: Date;
/** The ID of the user that created the doc. */
readonly createdBy: string;
/** The date the doc was edited. */
readonly editedAt?: Date;
/** The ID of the user that edited the doc. */
readonly editedBy?: string;
/**
* @param channel The doc channel the doc belongs to.
* @param raw The raw data of the doc.
* @param cache Whether to cache the doc.
*/
constructor(channel: DocChannel, raw: APIDoc, cache?: boolean);
/** Whether the doc is cached. */
get isCached(): boolean;
/** The server the doc belongs to. */
get server(): import("..").Server | undefined;
/** The timestamp the doc was created. */
get createdTimestamp(): number;
/** The server member that created the doc. */
get author(): import("..").ServerMember | undefined;
/** The ID of the user that created the doc. */
get authorId(): string;
/** The timestamp the doc was edited. */
get editedTimestamp(): number | undefined;
/** The server member that edited the doc. */
get editor(): import("..").ServerMember | undefined;
/**
* Fetch the doc.
* @param options The options to fetch the doc with.
* @returns The fetched doc.
* @example doc.fetch();
*/
fetch(options?: FetchOptions): Promise<this>;
/**
* Fetch the server the doc belongs to.
* @param options The options to fetch the server with.
* @returns The fetched server.
* @example doc.fetchServer();
*/
fetchServer(options?: FetchOptions): Promise<import("..").Server>;
/**
* Fetch the server member that created the doc.
* @param options The options to fetch the server member with.
* @returns The fetched server member.
* @example doc.fetchAuthor();
*/
fetchAuthor(options?: FetchOptions): Promise<import("..").ServerMember>;
/**
* Fetch the server member that edited the doc.
* @param options The options to fetch the server member with.
* @returns The fetched server member.
* @example doc.fetchEditor();
*/
fetchEditor(options?: FetchOptions): Promise<import("..").ServerMember | undefined>;
/**
* Edit the doc.
* @param title The title of the doc.
* @param content The content of the doc.
* @returns The edited doc.
* @example doc.edit('New title', 'New content');
*/
edit(title: string, content: string): Promise<this>;
/**
* Delete the doc.
* @returns The deleted doc.
* @example doc.delete();
*/
delete(): Promise<this>;
}
//# sourceMappingURL=Doc.d.ts.map